Inline assembly syntax
Stan Shebs
shebs@apple.com
Sat May 8 01:34:00 GMT 2004
Ian Lance Taylor wrote:
>
>These lead us in the direction of
>
>asm
> {
> add r0, foo, bar // register r0 = variable foo + variable bar
> add r0, "r1", r2 // register r0 = variable r1 + register r2
> { // instructions in block may not be rearranged
> cli // disable interrupts
> add 0(r0), 1 // * (register r0) += 1
> sti // enable interuppts
> }
> svc 21 __clobber__(r0,r1,r2) // supervisor call
> __noschedule__ // scheduling barrier
> addi r0, r1, constant __constraint__(i) // specify constraint
> }
>
Coool... This is rather more ambitious than what I was proposing, but
I'm not going to complain! This is both compatible with CW syntax,
and addresses many of its limitations.
Incidentally, as I was thinking about the assembly grokking problem,
it occurred that we already have a rich mine of info about operand
constraints - the machine descriptions themselves. Not always
expressed as per-instruction, but for at least the one-instruction
output strings, one could make up a table of instructions/constraint
letters/types that would be pretty accurate, and not need special
per-target hackery.
Stan
More information about the Gcc
mailing list