This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [mips patch rfa] Add MIPS32 Release 2 support.


cgd@broadcom.com writes:
> Ultimately, I broke down and concluded: (1) it's not really 32 and
> users should have some way to differentiate, and (2) one good way to
> convince them not to use that define is to put strange values in it.
> 8-)

I agree that __mips isn't good for 32r2-aware code because it
isn't descriptive enough.  That's why setting __mips to 32
makes sense IMO.  Any existing mips32 code that checks __mips
should work OK for mips32r2 as well.

I'm not sure what you mean by "it's not really 32".  OK, so it's
not the original mips32, but MIPS (and the gcc option names) treat
it as a variation of mips32.  It seems more intuitive to me to
have __mips set to 32 instead of some articial not-really-an-ISA
number like 33.

> > E.g.
> > 
> > enum mips_isa {
> >   ISA_MIPS1,
> >   ...,
> >   ISA_MIPS32,
> >   ISA_MIPS32R2,
> >   ...
> > };
> ...
> They'd have to be other than that.  But yes, that idea.

Doh!

> That would seem sensible, but...  given the current implementation,
> mips_isa_string has the value after -mips...  i.e., 32r2, 32, 64, 1,
> 2, 3, etc.  I.e., it's not a complete mipsNN string.

Couldn't you use mips_isa_string[-4]?  If you don't like that...

> I suppose there are two ways to go: sprintf into a string then look
> that up, or check for the explicitly allowed cases using strcmp.  I
> think i'm going to go for the latter.

You could use concat() instead of sprintf(): no horrible fixed-length
buffers to worry about.  Personally I like the idea of "-mips" being
a shorthand for "-march=mips".  It also avoids having to duplicate
bits of mips_cpu_info_table[] in C code.

Richard


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