aboutsummaryrefslogtreecommitdiff
path: root/opcodes/m68k-opc.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2020-04-18 14:32:39 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2020-04-21 16:53:36 +0200
commitbb2a1453479dfa2589f3b62853d4e1cf60825e98 (patch)
tree059cbf2028ab35d527c7f415f6e0bb55cacde748 /opcodes/m68k-opc.c
parentc36876fe5b5bac1c404ab2ca82bfbfb2ed9a2717 (diff)
downloadgdb-bb2a1453479dfa2589f3b62853d4e1cf60825e98.zip
gdb-bb2a1453479dfa2589f3b62853d4e1cf60825e98.tar.gz
gdb-bb2a1453479dfa2589f3b62853d4e1cf60825e98.tar.bz2
Disallow PC relative for CMPI on MC68000/10
The MC68000/10 decodes the second operand of CMPI strictly as destination operand, which disallows PC relative addressing, even though the insn doesn't write to the operand. This restriction has only been lifted for the MC68020+ and CPU32. opcodes: PR 25848 * m68k-opc.c (m68k_opcodes): Allow pc-rel for second operand of cmpi only on m68020up and cpu32. gas: PR 25848 * testsuite/gas/m68k/operands.s: Add tests for cmpi. * testsuite/gas/m68k/operands.d: Update. * testsuite/gas/m68k/op68000.d: Update for new error messages.
Diffstat (limited to 'opcodes/m68k-opc.c')
-rw-r--r--opcodes/m68k-opc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/opcodes/m68k-opc.c b/opcodes/m68k-opc.c
index e13f116..db19894 100644
--- a/opcodes/m68k-opc.c
+++ b/opcodes/m68k-opc.c
@@ -265,11 +265,14 @@ const struct m68k_opcode m68k_opcodes[] =
{"cmpaw", 2, one(0130300), one(0170700), "*wAd", m68000up },
{"cmpal", 2, one(0130700), one(0170700), "*lAd", m68000up | mcfisa_a },
-{"cmpib", 4, one(0006000), one(0177700), "#b@s", m68000up },
+{"cmpib", 4, one(0006000), one(0177700), "#b$s", m68000 | m68010 },
+{"cmpib", 4, one(0006000), one(0177700), "#b@s", m68020up | cpu32 | fido_a },
{"cmpib", 4, one(0006000), one(0177700), "#bDs", mcfisa_b | mcfisa_c },
-{"cmpiw", 4, one(0006100), one(0177700), "#w@s", m68000up },
+{"cmpiw", 4, one(0006100), one(0177700), "#w$s", m68000 | m68010 },
+{"cmpiw", 4, one(0006100), one(0177700), "#w@s", m68020up | cpu32 | fido_a },
{"cmpiw", 4, one(0006100), one(0177700), "#wDs", mcfisa_b | mcfisa_c },
-{"cmpil", 6, one(0006200), one(0177700), "#l@s", m68000up },
+{"cmpil", 6, one(0006200), one(0177700), "#l$s", m68000 | m68010 },
+{"cmpil", 6, one(0006200), one(0177700), "#l@s", m68020up | cpu32 | fido_a },
{"cmpil", 6, one(0006200), one(0177700), "#lDs", mcfisa_a },
{"cmpmb", 2, one(0130410), one(0170770), "+s+d", m68000up },
@@ -277,18 +280,21 @@ const struct m68k_opcode m68k_opcodes[] =
{"cmpml", 2, one(0130610), one(0170770), "+s+d", m68000up },
/* The cmp opcode can generate the cmpa, cmpm, and cmpi instructions. */
-{"cmpb", 4, one(0006000), one(0177700), "#b@s", m68000up },
+{"cmpb", 4, one(0006000), one(0177700), "#b$s", m68000 | m68010 },
+{"cmpb", 4, one(0006000), one(0177700), "#b@s", m68020up | cpu32 | fido_a },
{"cmpb", 4, one(0006000), one(0177700), "#bDs", mcfisa_b | mcfisa_c },
{"cmpb", 2, one(0130410), one(0170770), "+s+d", m68000up },
{"cmpb", 2, one(0130000), one(0170700), ";bDd", m68000up },
{"cmpb", 2, one(0130000), one(0170700), "*bDd", mcfisa_b | mcfisa_c },
{"cmpw", 2, one(0130300), one(0170700), "*wAd", m68000up },
-{"cmpw", 4, one(0006100), one(0177700), "#w@s", m68000up },
+{"cmpw", 4, one(0006100), one(0177700), "#w$s", m68000 | m68010 },
+{"cmpw", 4, one(0006100), one(0177700), "#w@s", m68020up | cpu32 | fido_a },
{"cmpw", 4, one(0006100), one(0177700), "#wDs", mcfisa_b | mcfisa_c },
{"cmpw", 2, one(0130510), one(0170770), "+s+d", m68000up },
{"cmpw", 2, one(0130100), one(0170700), "*wDd", m68000up | mcfisa_b | mcfisa_c },
{"cmpl", 2, one(0130700), one(0170700), "*lAd", m68000up | mcfisa_a },
-{"cmpl", 6, one(0006200), one(0177700), "#l@s", m68000up },
+{"cmpl", 6, one(0006200), one(0177700), "#l$s", m68000 | m68010 },
+{"cmpl", 6, one(0006200), one(0177700), "#l@s", m68020up | cpu32 | fido_a },
{"cmpl", 6, one(0006200), one(0177700), "#lDs", mcfisa_a },
{"cmpl", 2, one(0130610), one(0170770), "+s+d", m68000up },
{"cmpl", 2, one(0130200), one(0170700), "*lDd", m68000up | mcfisa_a },