From: Maciej W. Rozycki Date: Fri, 19 Jul 2024 10:42:16 +0000 (+0100) Subject: MIPS/opcodes: Exclude $0 from "-x" R6 operand type X-Git-Tag: binutils-2_43~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6f05f3659440efbd31c811d262d5af0c3d3849a;p=thirdparty%2Fbinutils-gdb.git MIPS/opcodes: Exclude $0 from "-x" R6 operand type The "-x" operand type is used for the reverse encoding of the BOVC and BNVC instructions, where 'rs' and 'rt' have been supplied as the second and the first operand respectively rather than the order the instruction expects. In this case we require the register associated with the "-x" operand to have a higher number than the register associated with the preceding "t" operand, which precludes the use of $0. The case where 'rs' and 'rt' both refer to the same register is handled by the straight encoding of the BOVC and BNVC instructions, which come in the opcode table ahead of the corresponding reverse encoding. Therefore clear the ZERO_OK flag for the "-x" operand. No need for an extra test case as the encodings involved are already covered by "r6" and its associated GAS tests. --- diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c index c6cbb66178c..2ee2983fa6a 100644 --- a/opcodes/mips-opc.c +++ b/opcodes/mips-opc.c @@ -52,7 +52,7 @@ decode_mips_operand (const char *p) case 'u': PREV_CHECK (5, 16, true, false, false, false); case 'v': PREV_CHECK (5, 16, true, true, false, false); case 'w': PREV_CHECK (5, 16, false, true, true, true); - case 'x': PREV_CHECK (5, 21, true, false, false, true); + case 'x': PREV_CHECK (5, 21, true, false, false, false); case 'y': PREV_CHECK (5, 21, false, true, false, false); case 'A': PCREL (19, 0, true, 2, 2, false, false); case 'B': PCREL (18, 0, true, 3, 3, false, false);