This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Overlapping operands in ARM mul and mla instructions


Paul Brook wrote:
2007-03-15 Mark Shinwell <shinwell@codesourcery.com>

	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.

Ok.
Please check if we already have a test for overlapping mls operands, and add one if not.

Applied thus, with mls testcases.


Mark

--


2007-03-18 Mark Shinwell <shinwell@codesourcery.com>


	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.


Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.314
diff -r1.314 tc-arm.c
7054,7055c7054
< /* 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). */
7056a7056
> && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6)
7058c7058
< as_tsktsk (_("rd and rm should be different in mla"));
---
> as_tsktsk (_("Rd and Rm should be different in mla"));
7064d7063
<
7172,7173c7171,7173
< 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"));
cvs diff: Diffing gas/doc
cvs diff: Diffing gas/po
cvs diff: Diffing gas/testsuite
cvs diff: Diffing gas/testsuite/config
cvs diff: Diffing gas/testsuite/gas
cvs diff: Diffing gas/testsuite/gas/all
cvs diff: Diffing gas/testsuite/gas/alpha
cvs diff: Diffing gas/testsuite/gas/arc
cvs diff: Diffing gas/testsuite/gas/arm
Index: gas/testsuite/gas/arm/mul-overlap-v6.d
===================================================================
RCS file: gas/testsuite/gas/arm/mul-overlap-v6.d
diff -N gas/testsuite/gas/arm/mul-overlap-v6.d
0a1,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
Index: gas/testsuite/gas/arm/mul-overlap-v6.s
===================================================================
RCS file: gas/testsuite/gas/arm/mul-overlap-v6.s
diff -N gas/testsuite/gas/arm/mul-overlap-v6.s
0a1,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
Index: gas/testsuite/gas/arm/mul-overlap.d
===================================================================
RCS file: gas/testsuite/gas/arm/mul-overlap.d
diff -N gas/testsuite/gas/arm/mul-overlap.d
0a1,2
> # name: Overlapping multiplication operands without architecture specification
> # error-output: mul-overlap.l
Index: gas/testsuite/gas/arm/mul-overlap.l
===================================================================
RCS file: gas/testsuite/gas/arm/mul-overlap.l
diff -N gas/testsuite/gas/arm/mul-overlap.l
0a1,3
> [^:]*: Assembler messages:
> [^:]*:6: Rd and Rm should be different in mul
> [^:]*:7: Rd and Rm should be different in mla
Index: gas/testsuite/gas/arm/mul-overlap.s
===================================================================
RCS file: gas/testsuite/gas/arm/mul-overlap.s
diff -N gas/testsuite/gas/arm/mul-overlap.s
0a1,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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]