gas/
authorMark Shinwell <shinwell@codesourcery.com>
Sun, 18 Mar 2007 16:21:27 +0000 (16:21 +0000)
committerMark Shinwell <shinwell@codesourcery.com>
Sun, 18 Mar 2007 16:21:27 +0000 (16:21 +0000)
* config/tc-arm.c (do_mul): Don't warn about overlapping
Rd and Rm operands when assembling for v6 or above.
Correctly capitalize register names in the messages.
(do_mlas): Likewise.  Delete spurious blank line.

gas/testsuite/
* gas/arm/mul-overlap.s: New.
* gas/arm/mul-overlap.d: New.
* gas/arm/mul-overlap.l: New.
* gas/arm/mul-overlap-v6.s: New.
* gas/arm/mul-overlap-v6.d: New.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/mul-overlap-v6.d [new file with mode: 0644]
gas/testsuite/gas/arm/mul-overlap-v6.s [new file with mode: 0644]
gas/testsuite/gas/arm/mul-overlap.d [new file with mode: 0644]
gas/testsuite/gas/arm/mul-overlap.l [new file with mode: 0644]
gas/testsuite/gas/arm/mul-overlap.s [new file with mode: 0644]

index d8c2bfa..735fd4f 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-18  Mark Shinwell  <shinwell@codesourcery.com>
+
+       * config/tc-arm.c (do_mul): Don't warn about overlapping
+       Rd and Rm operands when assembling for v6 or above.
+       Correctly capitalize register names in the messages.
+       (do_mlas): Likewise.  Delete spurious blank line.
+
 2007-03-16  Kazu Hirata  <kazu@codesourcery.com>
 
        * config/tc-m68k.c (m68k_cpus): Add an entry for fidoa.
index b463d96..aa2ac05 100644 (file)
@@ -7051,17 +7051,16 @@ do_lstc (void)
 static void
 do_mlas (void)
 {
-  /* This restriction does not apply to mls (nor to mla in v6, but
-     that's hard to detect at present).         */
+  /* This restriction does not apply to mls (nor to mla in v6 or later).  */
   if (inst.operands[0].reg == inst.operands[1].reg
+      && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6)
       && !(inst.instruction & 0x00400000))
-    as_tsktsk (_("rd and rm should be different in mla"));
+    as_tsktsk (_("Rd and Rm should be different in mla"));
 
   inst.instruction |= inst.operands[0].reg << 16;
   inst.instruction |= inst.operands[1].reg;
   inst.instruction |= inst.operands[2].reg << 8;
   inst.instruction |= inst.operands[3].reg << 12;
-
 }
 
 static void
@@ -7169,8 +7168,9 @@ do_mul (void)
   inst.instruction |= inst.operands[1].reg;
   inst.instruction |= inst.operands[2].reg << 8;
 
-  if (inst.operands[0].reg == inst.operands[1].reg)
-    as_tsktsk (_("rd and rm should be different in mul"));
+  if (inst.operands[0].reg == inst.operands[1].reg
+      && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6))
+    as_tsktsk (_("Rd and Rm should be different in mul"));
 }
 
 /* Long Multiply Parser
index e6a5da4..fd8431d 100644 (file)
@@ -1,3 +1,11 @@
+2007-03-18  Mark Shinwell  <shinwell@codesourcery.com>
+
+       * gas/arm/mul-overlap.s: New.
+       * gas/arm/mul-overlap.d: New.
+       * gas/arm/mul-overlap.l: New.
+       * gas/arm/mul-overlap-v6.s: New.
+       * gas/arm/mul-overlap-v6.d: New.
+
 2007-03-14  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gas/arm/thumbver.d, gas/arm/thumbver.s: New test.
diff --git a/gas/testsuite/gas/arm/mul-overlap-v6.d b/gas/testsuite/gas/arm/mul-overlap-v6.d
new file mode 100644 (file)
index 0000000..ff42190
--- /dev/null
@@ -0,0 +1,10 @@
+# name: Overlapping multiplication operands for ARMv6
+# objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> e0000090    mul     r0, r0, r0
+0[0-9a-f]+ <[^>]+> e0202190    mla     r0, r0, r1, r2
+0[0-9a-f]+ <[^>]+> e0602190    mls     r0, r0, r1, r2
+0[0-9a-f]+ <[^>]+> e12fff1e    bx      lr
diff --git a/gas/testsuite/gas/arm/mul-overlap-v6.s b/gas/testsuite/gas/arm/mul-overlap-v6.s
new file mode 100644 (file)
index 0000000..478a650
--- /dev/null
@@ -0,0 +1,10 @@
+       .arch   armv6t2
+       .text
+       .align  2
+       .global foo
+       .type   foo, %function
+foo:
+       mul     r0, r0, r0
+       mla     r0, r0, r1, r2
+       mls     r0, r0, r1, r2
+       bx      lr
diff --git a/gas/testsuite/gas/arm/mul-overlap.d b/gas/testsuite/gas/arm/mul-overlap.d
new file mode 100644 (file)
index 0000000..53406e3
--- /dev/null
@@ -0,0 +1,2 @@
+# name: Overlapping multiplication operands without architecture specification
+# error-output: mul-overlap.l
diff --git a/gas/testsuite/gas/arm/mul-overlap.l b/gas/testsuite/gas/arm/mul-overlap.l
new file mode 100644 (file)
index 0000000..a9eb4ec
--- /dev/null
@@ -0,0 +1,3 @@
+[^:]*: Assembler messages:
+[^:]*:6: Rd and Rm should be different in mul
+[^:]*:7: Rd and Rm should be different in mla
diff --git a/gas/testsuite/gas/arm/mul-overlap.s b/gas/testsuite/gas/arm/mul-overlap.s
new file mode 100644 (file)
index 0000000..854036c
--- /dev/null
@@ -0,0 +1,9 @@
+       .text
+       .align  2
+       .global foo
+       .type   foo, %function
+foo:
+       mul     r0, r0, r0
+       mla     r0, r0, r1, r2
+       mls     r0, r0, r1, r2
+       bx      lr