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] change to MIPS 4650 instruction support


dmj+@andrew.cmu.edu (Daniel Jacobowitz) writes:
> The 4650 support in binutils changed after 2.8.1 - it now both adds the
> new instructions (mad, madu, mul) and imposes restrictions on the
> available instructions (double floating point).  Up till now, GCC has
> translated -mmad on its command line into -m4650 in binutils, but that
> doesn't work any more.
> 
> This is my proposed solution - I add a separate flag, implied by
> -m4650, to control the new instructions.
>
> Comments?  The patch is actually against 2.10.91.0.2 rather than HEAD,
> but I can provide it for the head if wanted.

I'm wondering what your end goal is with this change.  I.e., is it to
support a different CPU which doesn't have those restrictions, is it
to support compilation of code that works both with the 4650 and less
limited CPUs in the same object file, etc...

I'm not convinced it's a particularly good change to make as
submitted.  (I say this as the last person to touch the
OPCODE_IS_MEMBER crud... 8-)

Really, in the long run, I think OPCODE_IS_MEMBER should take one,
maybe two masks:

	(1) ISA
	(2) set of CPU-related extensions to enable

(plus the 'gp32' flag if that's _really_ necessary...)  adding random
flags isn't the way to go, and adding essentially a cpu-specific flag
to mips_set_options is definitely not.

If you're trying to support a new CPU type, it seems obvious how to do
that without rewriting a bunch of code.

If you're trying to allow compilation of multiple cpu types in the
same object file, a feature i've wanted for a while is the ability to
say:

	.set push
	.set cpu=foo
	...
	.set pop

and similar.  I think there's a good argument for having a generic
notion of CPU type in mips_set_options.  I've jut not gotten around to
implementing it yet.

Note also that the rest of the stuff in mips_set_options can be used
as described above, i.e. they're changeable state.  Even if this patch
was otherwise OK (and I don't particularly like it, but i'm not in a
position to reject it 8-), then mad4650 should be .set'able.




cgd


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