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: Does -march=r5000 imply HAVE_64BIT_GPRS?


cgd@broadcom.com wrote:
> ica2_ts@csv.ica.uni-stuttgart.de ("Thiemo Seufer") writes:
> > Of course, in the case of r5000 this makes no difference since it
> > has no insns which aren't covered by an ISA (WRT binutils). An
> > example might be the VR4100: Restrict it to MIPS II but use it's
> > "standby" and "suspend" opcodes. With runtime CPU detection it is
> > easy to find a scenario where this makes sense.
> 
> right, so, my answer to "how do you do this" is:
> 
> -mipsN or -march=XXX sets the file-level flags and default options.
> 
> then, if you're doing runtime CPU detection and asm, or whatever, you
> should do .set push ; .set whatever ; ... ; .set pop in your asm.
> 
> note that that implies the ability to set all of the random arch
> values in .set directives like one could historically do .set mipsN.
> I don't know if the binutils allow that with the most recent
> arch-related patches, but if not, i'd recommend:
> 
> 	.set arch=XXX
> 
> as the syntax.  8-)

This looks nice, but it isn't implemented for now. And it doesn't
answer how the ELF header should look like in a case with both
-mipsN an -march=XXX, what can in the end be destilled in this
question:

   - Is EF_MIPS_MACH independent from EF_MIPS_ARCH or does it
     provide an override for EF_MIPS_ARCH for some cpu's?

Current behaviour is "override".

H.J.'s patch says also "override", but tells the assembler to fall
back to the most restrictive header flags while generating code
for the less restrictive settings.

My patch does a step towards "independent" and may break things.

Now, what's The Right Thing [TM] to do?

In my now changed opinion, the "independent" case violates the
K.I.S.S. principle without much gain. The "override" case OTOH
should maintain consistency between header flags and the actual
code, so -mipsN and -march=XXX should be _generally_ made
incompatible. If there is need for something like the scenario
above, Chris' scenario is AFAICS the best approach to solve it.


Thiemo


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