Small gas patch for reading alternate forms of MIPS coprocessor register names

Matt Hiller hiller@redhat.com
Mon Apr 29 12:52:00 GMT 2002


On 23 Apr 2002 cgd@broadcom.com wrote:

> (1) you should only allow the coprocessor named in the reg name to be
>     the coprocessor that's correct for the instruction in question.
> 
>     i.e., "mtc1 $1, $c0r7" should be right out.  8-)
> 
>     The opcodes in the instruction table which use copN regs are
>     marked with appropriate flags.  I believe you can check those
>     flags.

There are WR_C0, RD_C2, etc. flags that can be part of an instruction's
pinfo, but they all define to the same value, INSN_COP. And there don't
seem to be any spare pinfo bits to play with... phooey. Should I just
check INSN_COP at first, then peek at the insn directly to determine which
coprocessor its looking at?

> (2) personally, I'd strongly encourage you to provide at least a small
>     test case for the binutils test suite, which covers the following:
> 
> 	* for each operand type letter you use, all valid
>           coprocessors.  (i.e., at least one insn using a 'G' spec for
>           each coprocessor, one instruction using an 'E' spec for each
> 	  coprocessor which has such an instruction.)
> 
> 	* if you're feeling nice, create a test using run_list_test
> 	  which checks for a least a few errors of the form
> 	  where the coprocessor used doesn't match the instruction.

Sure.

Matt



More information about the Binutils mailing list