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


Richard Sandiford wrote:
[snip]
> 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.

-gp64 sets the mips_64 flag and unsets mips_gp32, so it implies the
effect of -64, but without checking for compiled in 64bit support
first. This is likely to be another bug in the current CVS code.

This also means your desription of -mgp64 as "no effect but accepted for 
symmetry" is misleading.

> I'm not sure it
> would make sense for it to do so.

Well, I don't see the sense of it either. I must admit I'm worried
about the subtle side effects of these options and how they are
intended to be used.

> 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.

A 32bit MIPS chip with 64bit FP would be a really weird thing.
I think (hope) there does none exist.

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

To add the next question: Why have -mgp64 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.

It's surely a win to have one point in the code where such checks
are defined.

> 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.

the *32 variants might be useful in contexts where ABI-conformance
isn't an issue, as Eric already explained. The problem with the
*64 variants is that they can't made to be simple inverses of *32,
so it's IMHO better to leave them out.

> 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?

AFAICS yes, it should imply GPR=32 and FPR=32.


Thiemo


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