commutative asm operands
Roman Zippel
zippel@linux-m68k.org
Tue Aug 6 16:17:00 GMT 2002
Hi,
On Tue, 6 Aug 2002, Alan Modra wrote:
> > The "3, 5, 3" line isn't correct, it's conflicting with the constraints.
>
> Oh? This is from (doing some renumbering of constraints)
>
> asm ("addc %0, %1, %2" : "=r" (a) : "%0" (c), "r" (a));
>
> Or expanding the "%" constraint:
>
> asm ("addc %0, %1, %2" : "=r,r" (a) : "0,r" (c), "r,0" (a));
>
> Tell me why this conflicts.
While thinking more about it, I think it's not really correct to exchange
the constraint, reload should only try to exchange the operands, e.g.
asm("add %0,%2" : "=r" (a) : "%0" (b), "g" (c));
has to work as well. An example like is mentioned in the docs, the first
and second operand must be the same, otherwise you'll break some machines.
Richard, could you please confirm/correct this?
bye, Roman
More information about the Gcc
mailing list