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]

Re: Patch to add -mfp32 support to MIPS gas


Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> > Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> > 
> > > Another Question, what happens if somebody specifies
> > > "-mips1 -mcpu=r10000 -mfp=64" ? AFAICS it sets mips_32bitmode
> > > and uses 64bit FPR's, which creates bad ELF object files.

Sorry, I should have read that more carefully.  Those options will make GAS
use 32-bit FPRs.  The patch was to provide a way of forcing registers to be
32 bits wide on a 64-bit ISA, but not the other way round.  As for why...

The current behaviour of -mgp* options seems to be that -mgp32 forces GAS to
use 32-bit GPRs when a 64-bit ISA is selected (at least in some contexts).
Unless I'm missing something, -mgp64 is essentially a no-op in that it does
not force the use of 64-bit registers on a 32-bit ISA.  I'm not sure it
would make sense for it to do so.

My patch duplicates that behaviour for -mfp* and FPRs.  And again, I don't
think it makes sense for -mfp64 to force the use of 64-bit registers on a
32-bit ISA.

Which begs the question, why have -mfp64 at all?

I think I may have been unduly influenced by GCC here.  When I looked at
macro-generating code in GAS, I saw that some code depended on the FPR size,
some depended on the GPR size, and some depended on the address size.  But
it often wasn't explicitly stated which.  It seemed a good idea to have
separate macros for each size, if only to make the code clearer.  And once
those macros were in, it seemed natural enough to add GCC's -mfp* options to
GAS.  I think you've convinced me that those options aren't so great after
all.

What I want is a way of making GAS use the 32-bit variants of macros when
the O32 ABI is used on a 64-bit ISA.  Note that "gas -mips4 -mabi=32" will
currently generate the 64-bit versions of macros.

In your first reply, you said that register size ought to be affected by the
ABI.  Would it be OK to make -mabi=32 imply that the registers are 32 bits
wide, regardless of the chosen CPU and ISA?

Richard


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