tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Assembly instructions like "foo.bar"


From: Danny Milosavljevic
Subject: [Tinycc-devel] Assembly instructions like "foo.bar"
Date: Thu, 21 Jan 2021 19:28:04 +0100

Hi,

I've pushed patches 1 to 6 (only) of my latest patchset to tinycc mob.

For the remaining patches, I'd like to ask you how to implement instructions
with a dot suffix, for example:

  vmul.f32 s0, s1

Unfortunately, the ".f32" suffix is not optional for VFP arithmetic
instructions in GNU as--which means that all working source code uses it
(sigh...).

It seems that the preprocessor macro DEF_ASM does not support tokens with
dot yet.  It's defined like this:

> ./tcc.h:#define DEF_ASM(x) DEF(TOK_ASM_ ## x, #x)

(causes compilation error if there's a dot in x)

So I tried to add them like

 DEF(TOK_ASM_ ## x ## _ ## y, #x "." #y)

instead--but those token are not detected by tcc at runtime.

I suspect that's because '.' is not in the accepted set of characters for
a keyword token.

If that is the case, I would suggest NOT to add '.' to that set.

Instead, we can interpret it as

  ["vmul", ".f32", "s0", "s1"]

since there is support for dot directives in the assembler anyway (and,
with the currently supported instruction set, the suffixes wouldn't add
any new information anyway).

Or, alternatively,

  ["vmul", ".", "f32", "s0", "s1"]

(Note: In the non-deprecated subset of VFP assembly, these .f32 .f64
suffixes are completely unnecessary to determine the operand sizes.
But if we wanted to support deprecated VFP features then we would need
to support these and other suffixes, because VFP has a (SEQUENTIAL--as
opposed to parallel) vector processing unit.  But the use of vectors in
VFP has been deprecated in favor of NEON anyway--so why bother?)

What do you think?  Which way should we use?

Attachment: pgpYgLml2HZZB.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]