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: Improvements and fixes for mips n32/n64 relocations


On Apr  8, 2003, Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de> wrote:

> Alexandre Oliva wrote:
> [snip]
>> @@ -3395,7 +3417,8 @@ macro_build_ldst_constoffset (place, cou
>> if (place != NULL)
>> place += 4;
>> macro_build (place, counter, (expressionS *) NULL,
>> -		   HAVE_32BIT_ADDRESSES ? "addu" : "daddu",
>> +		   HAVE_32BIT_ADDRESSES ? HAVE_NEWABI
>> +		   ? "add" : "addu" : "daddu",

> Some more parentheses might look better.

I couldn't find any parenthesizing that would look good.

HAVE_32BIT_ADDRESSES ? (HAVE_NEWABI
                        ? "add" : "addu" : "daddu")

looked ugly, whereas

HAVE_32BIT_ADDRESSES
? (HAVE_NEWABI ? "add" : "addu")
: "daddu"

looked wasteful.  I could go either way, it's not like any of the
alternatives is really pleasing.  Perhaps we should have some global
variable holding the kind of add and addi instruction to use for
address arithmetic?

> And if I read the n64 draft right, n64 also prefers 'dadd'.

Hmm...  Irix 6's /usr/include/sys/asm.h seems to disagree.  But then,
it doesn't use add for N32 either.

I see the elf64 spec uses both daddiu and dadd, so I'm a bit confused
as to why one would be preferred over the other.  It doesn't seem to
me like it would make any difference.  What am I missing?

> Otherwise it looks impressive. :-)

Thanks :-)  I thought you might like it :-)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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