Inline assembly syntax

Timothy J. Wood tjw@omnigroup.com
Sat May 8 01:02:00 GMT 2004


On Friday, May 7, 2004, at 04:47  PM, Ian Lance Taylor wrote:
[...]
> So, putting these together, the ideal assembler syntax would have
> characteristics like these:

   What about having a really good set of intrinsic functions.  For 
example, Apple ships with a header called ppc_intrinsics.h that has 
single-instruction inline functions for all the common instructions 
(with presumably correct constraints).

> * Straightforward mapping from C variables to assembler operands.

   Intrinsics handle this.

> * Avoid string constants and associated backslash syntax.

   And this.

> * Compiler would automatically determine side effects of known
>   instructions.

   And this by virtue of the compiler writers implementing the 
instruction wrappers.

> * Support specifying additional side effects.

   And this (excepting specific memory clobbers).

> * Scheduling barriers could be inserted.

   Add __builtin_noschedule() or something like that?

> * Clobbering of precise memory locations could be discerned and
>   described.

   As I understand it, this would be needed with any scheme.

   You could also add a __attribute__ for function arguments that 
requires the argument to be a constant to handle the addi probably 
(actually, doesn't the Altivec support use something like this already?)

-tim




More information about the Gcc mailing list