aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@redhat.com>2024-07-19 11:42:16 +0100
committerMaciej W. Rozycki <macro@redhat.com>2024-07-19 11:42:16 +0100
commite6f05f3659440efbd31c811d262d5af0c3d3849a (patch)
tree22ab6e6a58d930c8149ad0b874f6f1451448b1dc
parent91a082c1bac121c31778b7d4634be898cec4ea62 (diff)
downloadgdb-e6f05f3659440efbd31c811d262d5af0c3d3849a.zip
gdb-e6f05f3659440efbd31c811d262d5af0c3d3849a.tar.gz
gdb-e6f05f3659440efbd31c811d262d5af0c3d3849a.tar.bz2
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.
-rw-r--r--opcodes/mips-opc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
index c6cbb66..2ee2983 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);