This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PowerPC gas/ immediate range checking?


Becky Gill wrote:
> 
> I have a question about gas on PowerPC.  The assembly instruction
> 
> addi    r3,r3,0xdead

Whoops, copied the wrong line.  I mean 0xbeef .... cut-and-pasted the wrong
instruction to match the error message.

> 
> Generates this warning:
> 
> Error: operand out of range (000000000000beef not between -32768 and 32767)
> 
> However, this immediate value is perfectly valid for the addi instruction.  It
> looks as though gas is treating it as unsigned by default, filling in with
> zeroes, and then range checking that number. This results in an incorrect
> error, since the above instruction is valid.
> 
> So, 2 questions:
> 
> 1) Why is gas implemented as it is currently?  Is this intentional?
> 2) Is there a way to get around this problem when hand-coding assembly?
> 

FYI - it looks like I have gas 2.10.90.

Thanks,
Becky


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]