This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inline assembly syntax
- From: Stan Shebs <shebs at apple dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 07 May 2004 18:18:45 -0700
- Subject: Re: Inline assembly syntax
- References: <m3y8o3u7eg.fsf@gossamer.airs.com>
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