specifier on operand in asm inline

Ian Lance Taylor iant@google.com
Fri Oct 12 16:50:00 GMT 2007


Mihail Platonov <dofg@ya.ru> writes:

> what is the semantics of "r" specifier in subx operand (%r2)?
> and what is the meaning of connection between this specifier and "J"
> constraint?
>     __asm__ __volatile__ (
> ...
>             "subx %r2,%3,%%g1\n\t"
>            : "=&r" ((USItype)(r1)),
>              "=&r" ((USItype)(r0))
>            : "%rJ" ((USItype)(x3)),
>              "rI" ((USItype)(y3)),
> ...

The 'r' constraint means that that operand must be a general register.
The 'J' constraint means that it must be the integer zero.  Using both
rJ and together means that the operand must be either a general
register or the integer zero.

The '%' means that the operands are commutative, which seems to me to
be extremely unlikely for a sub instruction.  Unless this is used in
some very strange way, that almost has to be a bug.

Ian



More information about the Gcc-help mailing list