[tremor] Support for ARM ASM with non GNU based tools

Nicolas Pitre nico at cam.org
Fri Sep 13 08:33:40 PDT 2002



On Thu, 12 Sep 2002, Segher Boessenkool wrote:

> > // we need some temporary variables to get as outputs from the asm so we
> > declare them
> >   int lo,hi;
> > 
> > // the actual asm we want to perform
> >   asm volatile("smull  %0,%1,%2,%3;\n"
> > 
> > // result variables
> >                : "=&r"(lo),"=&r"(hi)
> > 
> > // input variables  (note that I'm not sure what %r is needed for?
> >                : "%r"(x),"r"(y));
> 
> It means  x  isn't allowed to alias  lo  or  hi (or y, but the compiler
> already knows that).  This is a requirement of the ARM cpu, so better
> make the compiler know about it ;-)

Not exactly.  From gcc's manual:

`%'
     Declares the instruction to be commutative for this operand and the
     following operand.  This means that the compiler may interchange
     the two operands if that is the cheapest way to make all operands
     fit the constraints.  This is often used in patterns for addition
     instructions that really have only two operands: the result must
     go in one of the arguments.

So that means that "x * y" can be switched to "y * x" if the compiler sees a 
reason to do so.

<p>Nicolas

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list