m68k: fix constraints of move.[bw] for ISA_B/C
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 8 Jan 2016 10:38:00 +0000 (11:38 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 8 Jan 2016 10:42:10 +0000 (11:42 +0100)
For ISA_B/C only the combination #,d(An) is allowed in addition to the
ISA_A combinations for move.b and move.w (and pc-relative is never
allowed as destination).

opcodes/
PR gas/13050
* m68k-opc.c (moveb, movew): For ISA_B/C only allow #,d(An) in
addition to ISA_A.

gas/
PR gas/13050
* testsuite/gas/m68k/all.exp: Add tests p13050-1 and p13050-2.
* testsuite/gas/m68k/p13050-1.s: New file.
* testsuite/gas/m68k/p13050-2.d: New file.
* testsuite/gas/m68k/p13050-2.s: New file.

gas/ChangeLog
gas/testsuite/gas/m68k/all.exp
gas/testsuite/gas/m68k/p13050-1.s [new file with mode: 0644]
gas/testsuite/gas/m68k/p13050-2.d [new file with mode: 0644]
gas/testsuite/gas/m68k/p13050-2.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/m68k-opc.c

index 8e8a79c..509dc96 100644 (file)
@@ -1,3 +1,11 @@
+2016-01-08  Andreas Schwab  <schwab@linux-m68k.org>
+
+       PR gas/13050
+       * testsuite/gas/m68k/all.exp: Add tests p13050-1 and p13050-2.
+       * testsuite/gas/m68k/p13050-1.s: New file.
+       * testsuite/gas/m68k/p13050-2.d: New file.
+       * testsuite/gas/m68k/p13050-2.s: New file.
+
 2016-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * testsuite/gas/arc/adc.d: Add 'R_' prefix to relocation names.
index 2f7a655..ace776f 100644 (file)
@@ -90,6 +90,9 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
 
     gas_test_error "p11673.s" "-march=isab" "movel immediate with offset unsupported on isab"
 
+    gas_test_error "p13050-1.s" "-march=isab" "moveb (d8,An,Xi),(d16,An) unsupported on isab"
+    run_dump_test p13050-2
+
     if { [istarget *-*-*aout] || [istarget *-*-netbsd] || [istarget *-*-openbsd*] } then {
       run_dump_test p3041
       run_dump_test p3041data
diff --git a/gas/testsuite/gas/m68k/p13050-1.s b/gas/testsuite/gas/m68k/p13050-1.s
new file mode 100644 (file)
index 0000000..7750eab
--- /dev/null
@@ -0,0 +1,2 @@
+# The following addressing mode is forbidden even on isab or higher (PR13050)
+       move.b  (2,%a0,%d0.l),1(%a1)
diff --git a/gas/testsuite/gas/m68k/p13050-2.d b/gas/testsuite/gas/m68k/p13050-2.d
new file mode 100644 (file)
index 0000000..cedcdc6
--- /dev/null
@@ -0,0 +1,11 @@
+#name: p13050-2.d
+#objdump: -dr
+#as: -march=isab
+
+.*:     file format .*
+
+Disassembly of section .text:
+
+0+ <.*>:
+   0:  137c 0005 0001  moveb #5,%a1@\(1\)
+   6:  337c 0005 0001  movew #5,%a1@\(1\)
diff --git a/gas/testsuite/gas/m68k/p13050-2.s b/gas/testsuite/gas/m68k/p13050-2.s
new file mode 100644 (file)
index 0000000..191954f
--- /dev/null
@@ -0,0 +1,3 @@
+# Test that #,(d16,An) is accepted on ISA_B with move.[bw]
+       move.b  #5,1(%a1)
+       move.w  #5,1(%a1)
index 4f7f0e5..d585f56 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-08  Andreas Schwab  <schwab@linux-m68k.org>
+
+       PR gas/13050
+       * m68k-opc.c (moveb, movew): For ISA_B/C only allow #,d(An) in
+       addition to ISA_A.
+
 2016-01-01  Alan Modra  <amodra@gmail.com>
 
        Update year range in copyright notice of all files.
index 6ec6163..dc07f72 100644 (file)
@@ -1575,13 +1575,13 @@ const struct m68k_opcode m68k_opcodes[] =
 {"moveb", 2,   one(0010200),   one(0170700), "obad", mcfisa_a },
 {"moveb", 2,   one(0010300),   one(0170700), "ob+d", mcfisa_a },
 {"moveb", 2,   one(0010400),   one(0170700), "ob-d", mcfisa_a },
-{"moveb", 2,   one(0010000),   one(0170000), "obnd", mcfisa_b | mcfisa_c },
+{"moveb", 2,   one(0010074),   one(0170077), "#bpd", mcfisa_b | mcfisa_c },
 
 {"movew", 2,   one(0030000),   one(0170000), "*w%d", m68000up },
 {"movew", 2,   one(0030000),   one(0170000), "ms%d", mcfisa_a },
 {"movew", 2,   one(0030000),   one(0170000), "nspd", mcfisa_a },
 {"movew", 2,   one(0030000),   one(0170000), "owmd", mcfisa_a },
-{"movew", 2,   one(0030000),   one(0170000), "ownd", mcfisa_b | mcfisa_c },
+{"movew", 2,   one(0030074),   one(0170077), "#wpd", mcfisa_b | mcfisa_c },
 {"movew", 2,   one(0040300),   one(0177700), "Ss$s", m68000up },
 {"movew", 2,   one(0040300),   one(0177770), "SsDs", mcfisa_a },
 {"movew", 2,   one(0041300),   one(0177700), "Cs$s", m68010up },
@@ -1630,7 +1630,7 @@ const struct m68k_opcode m68k_opcodes[] =
 {"move", 2,    one(0030000),   one(0170000), "ms%d", mcfisa_a },
 {"move", 2,    one(0030000),   one(0170000), "nspd", mcfisa_a },
 {"move", 2,    one(0030000),   one(0170000), "owmd", mcfisa_a },
-{"move", 2,    one(0030000),   one(0170000), "ownd", mcfisa_b | mcfisa_c },
+{"move", 2,    one(0030074),   one(0170077), "#wpd", mcfisa_b | mcfisa_c },
 {"move", 2,    one(0040300),   one(0177700), "Ss$s", m68000up },
 {"move", 2,    one(0040300),   one(0177770), "SsDs", mcfisa_a },
 {"move", 2,    one(0041300),   one(0177700), "Cs$s", m68010up },