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

Segher Boessenkool segher at koffie.nl
Wed Sep 11 22:13:03 PDT 2002



> // 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 ;-)

> 
> all the variables are numbered in order of output then input variables from
> 0 upwards.  If you need to have a variable that's both input and output
> you'd use something like:
> 
>                 : "=&r"(inout)
>                 : "0"(inout)

<p>: "+r"(inout) :

<p>Cheers,

Segher

<p>--- >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