From 8fb9d7b9aa21d34743316ad6f5928d06e9a57e02 Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Sun, 18 Mar 2007 16:21:27 +0000 Subject: [PATCH] gas/ * 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 | 7 +++++++ gas/config/tc-arm.c | 12 ++++++------ gas/testsuite/ChangeLog | 8 ++++++++ gas/testsuite/gas/arm/mul-overlap-v6.d | 10 ++++++++++ gas/testsuite/gas/arm/mul-overlap-v6.s | 10 ++++++++++ gas/testsuite/gas/arm/mul-overlap.d | 2 ++ gas/testsuite/gas/arm/mul-overlap.l | 3 +++ gas/testsuite/gas/arm/mul-overlap.s | 9 +++++++++ 8 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 gas/testsuite/gas/arm/mul-overlap-v6.d create mode 100644 gas/testsuite/gas/arm/mul-overlap-v6.s create mode 100644 gas/testsuite/gas/arm/mul-overlap.d create mode 100644 gas/testsuite/gas/arm/mul-overlap.l create mode 100644 gas/testsuite/gas/arm/mul-overlap.s diff --git a/gas/ChangeLog b/gas/ChangeLog index d8c2bfab109..735fd4f6889 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2007-03-18 Mark Shinwell + + * 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 * config/tc-m68k.c (m68k_cpus): Add an entry for fidoa. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index b463d9615bd..aa2ac05f24d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -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 diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index e6a5da4caac..fd8431de5a0 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-03-18 Mark Shinwell + + * 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 * 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 index 00000000000..ff42190a5d0 --- /dev/null +++ b/gas/testsuite/gas/arm/mul-overlap-v6.d @@ -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 index 00000000000..478a650ced5 --- /dev/null +++ b/gas/testsuite/gas/arm/mul-overlap-v6.s @@ -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 index 00000000000..53406e3f413 --- /dev/null +++ b/gas/testsuite/gas/arm/mul-overlap.d @@ -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 index 00000000000..a9eb4ec5e06 --- /dev/null +++ b/gas/testsuite/gas/arm/mul-overlap.l @@ -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 index 00000000000..854036cb16f --- /dev/null +++ b/gas/testsuite/gas/arm/mul-overlap.s @@ -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 -- 2.30.2