ppc instructions in gas

Richard Henderson rth@cygnus.com
Thu May 6 16:56:00 GMT 1999

On Thu, May 06, 1999 at 05:16:40PM -0600, Cort Dougan wrote:
> Ah-ha!  The problem is this:
> We do immediate loads of (for example) 0xffff.  Even with lis (which takes
> a signed 16-bit value) this works with 32-bit.  It shouldn't since 0xffff
> is > +32k.  When I assemble with -Wa,-mppc64 it doesn't work and complains
> that 0xffff is > +32k.
> Eh?  Any idea what's going on?

In gas/config/tc-ppc.c --

1067              if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0
1068                  && ppc_size == PPC_OPCODE_32)
1069                max = (1 << operand->bits) - 1;

Looks like there's some backward compatibility thing going on. 

You said lis takes a signed value?  Meaning that the register
gets 0xffffffffffff0000?  If so, in my opinion the assembler is
correct to bitch at you for 0xffff as an operand.


More information about the Gas2 mailing list