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]
Other format: [Raw text]

Re: [PATCH] MIPS gas: Cleanup address insn conditionals


Maciej W. Rozycki wrote:
> On Mon, 16 Jun 2003, Thiemo Seufer wrote:
> 
> > I changed it to:
> > 
> > /* Addresses are loaded in different ways, depending on the address
> >    size in use and the ABI.  N32_ABI uses additions with overflow
> >    checking, this allows to catch code generation errors which would
> >    distort the proper sign extension of the 64-bit wide registers.  */
> > #define ADDRESS_ADD_INSN						\
> >    (HAVE_32BIT_ADDRESSES ? (HAVE_NEWABI ? "add" : "addu") : "daddu")
> > 
> > #define ADDRESS_ADDI_INSN						\
> >    (HAVE_32BIT_ADDRESSES ? (HAVE_NEWABI ? "addi" : "addiu") : "daddiu")
> 
>  Hmm, this effectively disables addresses in the ranges of 0x7fff8000 -
> 0x7fffffff and 0xffff8000 - 0xffffffff for certain operations for the n32
> ABI.  The latter is probably out of the scope of the ABI, but the former
> certainly is not.

Well, IRIX works this way, and the n32 ABI documentation mandates the
use of add/addi.

> Does any of the ABI documents contain any specific
> comment on a special treatment of the range?  Why do you think such an
> overflow check should be done -- what advantages are there?  Certainly
> "addu" and "addiu" cannot result in improper sign-extension of low 32-bit
> halfs of registers. 

Right, the idea of catching improper sign-extension was only valid
for n64 (where it isn't done). I'll fix the comment.


Thiemo


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