aboutsummaryrefslogtreecommitdiff
path: root/gas
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 /gas
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 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/testsuite/gas/m68k/op68000.d6
-rw-r--r--gas/testsuite/gas/m68k/operands.d12
-rw-r--r--gas/testsuite/gas/m68k/operands.s15
4 files changed, 40 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 7572633..cccb6bc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2020-04-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ 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.
+
2020-04-21 Tamar Christina <tamar.christina@arm.com>
PR binutils/24753
diff --git a/gas/testsuite/gas/m68k/op68000.d b/gas/testsuite/gas/m68k/op68000.d
index 568d5a3..b5d1d7b 100644
--- a/gas/testsuite/gas/m68k/op68000.d
+++ b/gas/testsuite/gas/m68k/op68000.d
@@ -193,3 +193,9 @@
.*statement `pea \(\[%zpc,%a0\],2000\)' ignored
.*statement `pea \(\[%zpc,%d0:w:2\]\)' ignored
.*statement `pea \(\[%d0,%zpc\]\)' ignored
+.*statement `cmpib &1,0\(%pc\)' ignored
+.*statement `cmpiw &1,0\(%pc\)' ignored
+.*statement `cmpil &1,0\(%pc\)' ignored
+.*statement `cmpb &1,0\(%pc\)' ignored
+.*statement `cmpw &1,0\(%pc\)' ignored
+.*statement `cmpl &1,0\(%pc\)' ignored
diff --git a/gas/testsuite/gas/m68k/operands.d b/gas/testsuite/gas/m68k/operands.d
index 5b383c3..465ae88 100644
--- a/gas/testsuite/gas/m68k/operands.d
+++ b/gas/testsuite/gas/m68k/operands.d
@@ -240,3 +240,15 @@ Disassembly of section .text:
0+508 <foo\+(0x|)508> addiw #1,%d0
0+50c <foo\+(0x|)50c> addil #1,%d0
0+512 <foo\+(0x|)512> addqb #1,%d0
+0+514 <foo\+(0x|)514> cmpib #1,%d0
+0+518 <foo\+(0x|)518> cmpib #1,%pc@\(0+51c <foo\+(0x|)51c>\)
+0+51e <foo\+(0x|)51e> cmpiw #1,%d0
+0+522 <foo\+(0x|)522> cmpiw #1,%pc@\(0+526 <foo\+(0x|)526>\)
+0+528 <foo\+(0x|)528> cmpil #1,%d0
+0+52e <foo\+(0x|)52e> cmpil #1,%pc@\(0+534 <foo\+(0x|)534>\)
+0+536 <foo\+(0x|)536> cmpib #1,%d0
+0+53a <foo\+(0x|)53a> cmpib #1,%pc@\(0+53e <foo\+(0x|)53e>\)
+0+540 <foo\+(0x|)540> cmpiw #1,%d0
+0+544 <foo\+(0x|)544> cmpiw #1,%pc@\(0+548 <foo\+(0x|)548>\)
+0+54a <foo\+(0x|)54a> cmpil #1,%d0
+0+550 <foo\+(0x|)550> cmpil #1,%pc@\(0+556 <foo\+(0x|)556>\)
diff --git a/gas/testsuite/gas/m68k/operands.s b/gas/testsuite/gas/m68k/operands.s
index b09f56f..382d95d 100644
--- a/gas/testsuite/gas/m68k/operands.s
+++ b/gas/testsuite/gas/m68k/operands.s
@@ -270,3 +270,18 @@ foo:
addiw &1,%d0
addil &1,%d0
addqb &1,%d0
+
+ | cmpi
+ cmpib &1,%d0
+ cmpib &1,0(%pc)
+ cmpiw &1,%d0
+ cmpiw &1,0(%pc)
+ cmpil &1,%d0
+ cmpil &1,0(%pc)
+ cmpb &1,%d0
+ cmpb &1,0(%pc)
+ cmpw &1,%d0
+ cmpw &1,0(%pc)
+ cmpl &1,%d0
+ cmpl &1,0(%pc)
+