Add a warning for some problematic MIPS constants
Daniel Jacobowitz
drow@false.org
Wed Sep 19 15:25:00 GMT 2007
On Wed, Sep 19, 2007 at 03:42:26PM +0100, Maciej W. Rozycki wrote:
> On Wed, 19 Sep 2007, Daniel Jacobowitz wrote:
>
> > The cases I'm trying to warn about are instructions that do not have a
> > clear explicit width. For instance, "li" and "dli" are obvious, but
> > bne and sltu are not. If you write "bne $4,0x80000000,label" gas
> > zero extends the constant, and Diab sign extends it.
>
> So is there a way to express 2147483648 as a hexadecimal number with this
> macro with that Diab tool?
I don't know. I strongly suspect that the answer is "no". The
obvious would be "bne $4,0x0000000080000000,label" and that sign
extends too. Unfortunately there's nothing I can do about that :-(
All their macros appear to be defined to take 32-bit signed values;
it warns and discards the upper bits if you try a constant such as
0x180000000.
--
Daniel Jacobowitz
CodeSourcery
More information about the Binutils
mailing list