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


Eric Christopher wrote:
> 
> >  
> > +#define ADDRESS_ADD_INSN						\
> > +   (HAVE_32BIT_ADDRESSES ? HAVE_NEWABI ? "add" : "addu" : "daddu")
> > +
> > +#define ADDRESS_ADDI_INSN						\
> > +   (HAVE_32BIT_ADDRESSES ? HAVE_NEWABI ? "addi" : "addiu" : "daddiu")
> > +
> 
> Hey, can you add some parens here and maybe some comments explaining the
> abis? :)

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")

#define ADDRESS_LOAD_INSN						\
   (HAVE_32BIT_ADDRESSES ? "lw" : "ld")

#define ADDRESS_STORE_INSN						\
   (HAVE_32BIT_ADDRESSES ? "sw" : "sd")


Thiemo


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