public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jie Zhang <jie@codesourcery.com>
To: binutils@sourceware.org
Subject: [RFA] Make ARM GAS accept valid strexd instruction
Date: Fri, 26 Feb 2010 11:35:00 -0000	[thread overview]
Message-ID: <4B87A2B5.7040803@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

we don't need operand[1] != operand[2] constraint for strexd, otherwise 
valid instructions like:

strexd	r1, r3, r3, [r4]

would be rejected. This patch removes this constraint. Tested with 
arm-none-eabi. Is it OK?


Jie

[-- Attachment #2: fsf-gas-arm-fix-thumb-strexd-contraint.diff --]
[-- Type: text/x-patch, Size: 6860 bytes --]

2010-02-26  Jie Zhang  <jie@codesourcery.com>

	* config/tc-arm.c (do_t_strexd): Remove
	operand[1] != operand[2] contraint.

	testsuite/
	* gas/arm/thumb32.s, gas/arm/thumb32.d: Add a new test
	for strexd.
	* gas/arm/thumb32.l: Adjust.


Index: config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.433
diff -u -p -r1.433 tc-arm.c
--- config/tc-arm.c	23 Feb 2010 18:04:12 -0000	1.433
+++ config/tc-arm.c	26 Feb 2010 10:24:27 -0000
@@ -11275,8 +11275,7 @@ do_t_strexd (void)
 
   constraint (inst.operands[0].reg == inst.operands[1].reg
 	      || inst.operands[0].reg == inst.operands[2].reg
-	      || inst.operands[0].reg == inst.operands[3].reg
-	      || inst.operands[1].reg == inst.operands[2].reg,
+	      || inst.operands[0].reg == inst.operands[3].reg,
 	      BAD_OVERLAP);
 
   inst.instruction |= inst.operands[0].reg;
Index: testsuite/gas/arm/thumb32.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/arm/thumb32.d,v
retrieving revision 1.35
diff -u -p -r1.35 thumb32.d
--- testsuite/gas/arm/thumb32.d	24 Feb 2010 15:11:44 -0000	1.35
+++ testsuite/gas/arm/thumb32.d	26 Feb 2010 10:24:27 -0000
@@ -555,6 +555,7 @@ Disassembly of section .text:
 0[0-9a-f]+ <[^>]+> e8c4 2f51 	strexh	r1, r2, \[r4\]
 0[0-9a-f]+ <[^>]+> e844 2100 	strex	r1, r2, \[r4\]
 0[0-9a-f]+ <[^>]+> e8c4 2371 	strexd	r1, r2, r3, \[r4\]
+0[0-9a-f]+ <[^>]+> e8c4 3371 	strexd	r1, r3, r3, \[r4\]
 0[0-9a-f]+ <[^>]+> e854 1f81 	ldrex	r1, \[r4, #516\].*
 0[0-9a-f]+ <[^>]+> e844 2181 	strex	r1, r2, \[r4, #516\].*
 0[0-9a-f]+ <[^>]+> c80e      	ldmia	r0!, \{r1, r2, r3\}
@@ -944,26 +945,26 @@ Disassembly of section .text:
 0[0-9a-f]+ <[^>]+> fa52 f183 	uxtab	r1, r2, r3
 0[0-9a-f]+ <[^>]+> fa32 f183 	uxtab16	r1, r2, r3
 0[0-9a-f]+ <[^>]+> fa12 f183 	uxtah	r1, r2, r3
-0[0-9a-f]+ <[^>]+> f89f 12aa 	ldrb\.w	r1, \[pc, #682\]	; 0+e7e <[^>]+>
-0[0-9a-f]+ <[^>]+> f89f 1155 	ldrb\.w	r1, \[pc, #341\]	; 0+d2d <[^>]+>
-0[0-9a-f]+ <[^>]+> f81f 12aa 	ldrb\.w	r1, \[pc, #-682\]	; 0+932 <[^>]+>
-0[0-9a-f]+ <[^>]+> f81f 1155 	ldrb\.w	r1, \[pc, #-341\]	; 0+a8b <[^>]+>
-0[0-9a-f]+ <[^>]+> f99f 12aa 	ldrsb\.w	r1, \[pc, #682\]	; 0+e8e <[^>]+>
-0[0-9a-f]+ <[^>]+> f99f 1155 	ldrsb\.w	r1, \[pc, #341\]	; 0+d3d <[^>]+>
-0[0-9a-f]+ <[^>]+> f91f 12aa 	ldrsb\.w	r1, \[pc, #-682\]	; 0+942 <[^>]+>
-0[0-9a-f]+ <[^>]+> f91f 1155 	ldrsb\.w	r1, \[pc, #-341\]	; 0+a9b <[^>]+>
-0[0-9a-f]+ <[^>]+> f8bf 12aa 	ldrh\.w	r1, \[pc, #682\]	; 0+e9e <[^>]+>
-0[0-9a-f]+ <[^>]+> f8bf 1155 	ldrh\.w	r1, \[pc, #341\]	; 0+d4d <[^>]+>
-0[0-9a-f]+ <[^>]+> f83f 12aa 	ldrh\.w	r1, \[pc, #-682\]	; 0+952 <[^>]+>
-0[0-9a-f]+ <[^>]+> f83f 1155 	ldrh\.w	r1, \[pc, #-341\]	; 0+aab <[^>]+>
-0[0-9a-f]+ <[^>]+> f9bf 12aa 	ldrsh\.w	r1, \[pc, #682\]	; 0+eae <[^>]+>
-0[0-9a-f]+ <[^>]+> f9bf 1155 	ldrsh\.w	r1, \[pc, #341\]	; 0+d5d <[^>]+>
-0[0-9a-f]+ <[^>]+> f93f 12aa 	ldrsh\.w	r1, \[pc, #-682\]	; 0+962 <[^>]+>
-0[0-9a-f]+ <[^>]+> f93f 1155 	ldrsh\.w	r1, \[pc, #-341\]	; 0+abb <[^>]+>
-0[0-9a-f]+ <[^>]+> f8df 12aa 	ldr\.w	r1, \[pc, #682\]	; 0+ebe <[^>]+>
-0[0-9a-f]+ <[^>]+> f8df 1155 	ldr\.w	r1, \[pc, #341\]	; 0+d6d <[^>]+>
-0[0-9a-f]+ <[^>]+> f85f 12aa 	ldr\.w	r1, \[pc, #-682\]	; 0+972 <[^>]+>
-0[0-9a-f]+ <[^>]+> f85f 1155 	ldr\.w	r1, \[pc, #-341\]	; 0+acb <[^>]+>
+0[0-9a-f]+ <[^>]+> f89f 12aa 	ldrb\.w	r1, \[pc, #682\]	; 0+e82 <[^>]+>
+0[0-9a-f]+ <[^>]+> f89f 1155 	ldrb\.w	r1, \[pc, #341\]	; 0+d31 <[^>]+>
+0[0-9a-f]+ <[^>]+> f81f 12aa 	ldrb\.w	r1, \[pc, #-682\]	; 0+936 <[^>]+>
+0[0-9a-f]+ <[^>]+> f81f 1155 	ldrb\.w	r1, \[pc, #-341\]	; 0+a8f <[^>]+>
+0[0-9a-f]+ <[^>]+> f99f 12aa 	ldrsb\.w	r1, \[pc, #682\]	; 0+e92 <[^>]+>
+0[0-9a-f]+ <[^>]+> f99f 1155 	ldrsb\.w	r1, \[pc, #341\]	; 0+d41 <[^>]+>
+0[0-9a-f]+ <[^>]+> f91f 12aa 	ldrsb\.w	r1, \[pc, #-682\]	; 0+946 <[^>]+>
+0[0-9a-f]+ <[^>]+> f91f 1155 	ldrsb\.w	r1, \[pc, #-341\]	; 0+a9f <[^>]+>
+0[0-9a-f]+ <[^>]+> f8bf 12aa 	ldrh\.w	r1, \[pc, #682\]	; 0+ea2 <[^>]+>
+0[0-9a-f]+ <[^>]+> f8bf 1155 	ldrh\.w	r1, \[pc, #341\]	; 0+d51 <[^>]+>
+0[0-9a-f]+ <[^>]+> f83f 12aa 	ldrh\.w	r1, \[pc, #-682\]	; 0+956 <[^>]+>
+0[0-9a-f]+ <[^>]+> f83f 1155 	ldrh\.w	r1, \[pc, #-341\]	; 0+aaf <[^>]+>
+0[0-9a-f]+ <[^>]+> f9bf 12aa 	ldrsh\.w	r1, \[pc, #682\]	; 0+eb2 <[^>]+>
+0[0-9a-f]+ <[^>]+> f9bf 1155 	ldrsh\.w	r1, \[pc, #341\]	; 0+d61 <[^>]+>
+0[0-9a-f]+ <[^>]+> f93f 12aa 	ldrsh\.w	r1, \[pc, #-682\]	; 0+966 <[^>]+>
+0[0-9a-f]+ <[^>]+> f93f 1155 	ldrsh\.w	r1, \[pc, #-341\]	; 0+abf <[^>]+>
+0[0-9a-f]+ <[^>]+> f8df 12aa 	ldr\.w	r1, \[pc, #682\]	; 0+ec2 <[^>]+>
+0[0-9a-f]+ <[^>]+> f8df 1155 	ldr\.w	r1, \[pc, #341\]	; 0+d71 <[^>]+>
+0[0-9a-f]+ <[^>]+> f85f 12aa 	ldr\.w	r1, \[pc, #-682\]	; 0+976 <[^>]+>
+0[0-9a-f]+ <[^>]+> f85f 1155 	ldr\.w	r1, \[pc, #-341\]	; 0+acf <[^>]+>
 0[0-9a-f]+ <[^>]+> f200 0900 	addw	r9, r0, #0
 0[0-9a-f]+ <[^>]+> f60f 76ff 	addw	r6, pc, #4095	; 0xfff
 0[0-9a-f]+ <[^>]+> f6a9 2685 	subw	r6, r9, #2693	; 0xa85
Index: testsuite/gas/arm/thumb32.l
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/arm/thumb32.l,v
retrieving revision 1.2
diff -u -p -r1.2 thumb32.l
--- testsuite/gas/arm/thumb32.l	29 Jan 2009 11:52:26 -0000	1.2
+++ testsuite/gas/arm/thumb32.l	26 Feb 2010 10:24:27 -0000
@@ -1,8 +1,4 @@
 [^;]*: Assembler messages:
-[^;]*:447: Warning: s suffix on comparison instruction is deprecated
-[^;]*:447: Warning: s suffix on comparison instruction is deprecated
-[^;]*:447: Warning: s suffix on comparison instruction is deprecated
-[^;]*:447: Warning: s suffix on comparison instruction is deprecated
 [^;]*:448: Warning: s suffix on comparison instruction is deprecated
 [^;]*:448: Warning: s suffix on comparison instruction is deprecated
 [^;]*:448: Warning: s suffix on comparison instruction is deprecated
@@ -15,3 +11,7 @@
 [^;]*:450: Warning: s suffix on comparison instruction is deprecated
 [^;]*:450: Warning: s suffix on comparison instruction is deprecated
 [^;]*:450: Warning: s suffix on comparison instruction is deprecated
+[^;]*:451: Warning: s suffix on comparison instruction is deprecated
+[^;]*:451: Warning: s suffix on comparison instruction is deprecated
+[^;]*:451: Warning: s suffix on comparison instruction is deprecated
+[^;]*:451: Warning: s suffix on comparison instruction is deprecated
Index: testsuite/gas/arm/thumb32.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/arm/thumb32.s,v
retrieving revision 1.17
diff -u -p -r1.17 thumb32.s
--- testsuite/gas/arm/thumb32.s	29 Jan 2009 11:52:26 -0000	1.17
+++ testsuite/gas/arm/thumb32.s	26 Feb 2010 10:24:27 -0000
@@ -400,6 +400,7 @@ ldxstx:
 	strexh	r1, r2, [r4]
 	strex	r1, r2, [r4]
 	strexd	r1, r2, r3, [r4]
+	strexd	r1, r3, r3, [r4]
 
 	ldrex	r1, [r4,#516]
 	strex	r1, r2, [r4,#516]

             reply	other threads:[~2010-02-26 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 11:35 Jie Zhang [this message]
2010-02-26 15:09 ` Nick Clifton
2010-02-26 16:58   ` Jie Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B87A2B5.7040803@codesourcery.com \
    --to=jie@codesourcery.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).