This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mipsisa32-unknown-elf-as: Error: too large constant specified
Alan Modra wrote:
> On Wed, Oct 15, 2003 at 01:03:11PM +0200, Thiemo Seufer wrote:
> > + if (ex->X_op == O_constant && HAVE_32BIT_GPRS)
> > + {
> > + if (ex->X_add_number < 0)
> > + ex->X_add_number = ((ex->X_add_number + 0x80000000) & 0xffffffff)
> > + - 0x80000000;
> > + else
> > + ex->X_add_number &= 0xffffffff;
> > + }
>
> Better:
>
> if (ex->X_op == O_constant && HAVE_32BIT_GPRS)
> ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000)
> - 0x80000000);
I don't want to sign-extend it. I want to discard the high bits.
Thiemo