]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
microMIPS/opcodes: Refer FPRs rather than FCRs with DMTC1
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 29 May 2021 01:26:32 +0000 (03:26 +0200)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 29 May 2021 01:26:32 +0000 (03:26 +0200)
commitc9de3168a9568c6fb8038b9b83a912a9a391152b
tree202fa18a854ee6f77377b8ddf439e8af8c81c2d7
parent25663db430bca74d152f6181e7f25edae1acc602
microMIPS/opcodes: Refer FPRs rather than FCRs with DMTC1

The DMTC1 instruction operates on a floating-point general register as
its second operand, however in the disassembly of the microMIPS encoding
a floating-point control register is shown instead.  This is due to an
incorrect ordering of the two "dmtc1" entries in the opcode table, which
gives precedence to one using the `G' aka coprocessor format over one
using the `S' or floating-point register format.

The coprocessor format, or OP_REG_COPRO, is used so that GAS supports
referring to FPRs by their numbers in assembly, such as $0, $1, etc.
however in the case of CP1/FPU it is also used by the disassembler to
decode those numbers to the names of corresponding control registers.
This in turn causes nonsensical disassembly such as:

dmtc1 a1,c1_fir

in a reference to $f0.  It has been like this ever since microMIPS ISA
support has been added.

Correct the ordering of the two entries then by swapping them with each
other, making disassembly output consistent with the regular MIPS DMTC1
instruction as well all the remaining CP1 move instructions.  Adjust all
the test cases affected accordingly.

opcodes/
* micromips-opc.c (micromips_opcodes): Swap the two "dmtc1"
entries with each other.

gas/
* testsuite/gas/mips/micromips.d: Update disassembly according
to "dmtc1" entry fix with opcodes.
* testsuite/gas/mips/micromips-compact.d: Likewise.
* testsuite/gas/mips/micromips-insn32.d: Likewise.
* testsuite/gas/mips/micromips-noinsn32.d: Likewise.
* testsuite/gas/mips/micromips-trap.d: Likewise.
* testsuite/gas/mips/micromips@isa-override-1.d: Likewise.
gas/ChangeLog
gas/testsuite/gas/mips/micromips-compact.d
gas/testsuite/gas/mips/micromips-insn32.d
gas/testsuite/gas/mips/micromips-noinsn32.d
gas/testsuite/gas/mips/micromips-trap.d
gas/testsuite/gas/mips/micromips.d
gas/testsuite/gas/mips/micromips@isa-override-1.d
opcodes/ChangeLog
opcodes/micromips-opc.c