This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] fix illegal iwmmxt instruction (wldrb, wldrh, wstrb, wstrh)
- From: "Bridge Wu" <mingqiao dot wu at gmail dot com>
- To: binutils <binutils at sourceware dot org>
- Cc: "Bridge Wu" <mingqiao dot wu at gmail dot com>
- Date: Tue, 26 Sep 2006 16:20:39 +0800
- Subject: [PATCH] fix illegal iwmmxt instruction (wldrb, wldrh, wstrb, wstrh)
Current binutils has an error when assembling wldrb/wldrh/wstrb/wstrh
instructions with immediate number #0. Here is the patch based on
binutils snapshot 20060925, with testcase and ChangeLog entries.
Tested iwmmxt.s with arm-iwmmxt-linux-gnueabi. The test case failed
without this patch and passed with this patch. Thanks Joseph's help.
Is this fine?
gas/
2006-09-26 Bridge Wu <mingqiao.wu@gmail.com>
* config/tc-arm.c
(md_apply_fix): do not clear write_back bit
gas/testsuite/
2006-09-26 Bridge Wu <mingqiao.wu@gmail.com>
* gas/arm/iwmmxt-wldstbh.s: New file.
* gas/arm/iwmmxt-wldstbh.d: New file.
diff -Nurp binutils-060925.orig/gas/config/tc-arm.c
binutils-060925/gas/config/tc-arm.c
--- binutils-060925.orig/gas/config/tc-arm.c 2006-09-26
16:07:48.000000000 +0800
+++ binutils-060925/gas/config/tc-arm.c 2006-09-26 16:09:06.000000000 +0800
@@ -18021,8 +18021,6 @@ md_apply_fix (fixS * fixP,
newval = get_thumb32_insn (buf);
newval &= 0xff7fff00;
newval |= (value >> 2) | (sign ? INDEX_UP : 0);
- if (value == 0)
- newval &= ~WRITE_BACK;
if (fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM
|| fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM_S2)
md_number_to_chars (buf, newval, INSN_SIZE);
diff -Nurp binutils-060925.orig/gas/testsuite/gas/arm/iwmmxt-wldstbh.d
binutils-060925/gas/testsuite/gas/arm/iwmmxt-wldstbh.d
--- binutils-060925.orig/gas/testsuite/gas/arm/iwmmxt-wldstbh.d
1970-01-01 08:00:00.000000000 +0800
+++ binutils-060925/gas/testsuite/gas/arm/iwmmxt-wldstbh.d
2006-09-26 16:08:11.000000000 +0800
@@ -0,0 +1,11 @@
+#objdump: -dr --prefix-addresses --show-raw-insn -miwmmxt
+#name: Intel(r) Wireless MMX(tm) technology instructions version 1
+#as: -mcpu=xscale+iwmmxt -EL
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <iwmmxt> ecb11000[ ]+wldrb[ ]+wr1, \[r1\]
+0+004 <[^>]*> ecf11000[ ]+wldrh[ ]+wr1, \[r1\]
+0+008 <[^>]*> eca11000[ ]+wstrb[ ]+wr1, \[r1\]
+0+00c <[^>]*> ece11000[ ]+wstrh[ ]+wr1, \[r1\]
diff -Nurp binutils-060925.orig/gas/testsuite/gas/arm/iwmmxt-wldstbh.s
binutils-060925/gas/testsuite/gas/arm/iwmmxt-wldstbh.s
--- binutils-060925.orig/gas/testsuite/gas/arm/iwmmxt-wldstbh.s
1970-01-01 08:00:00.000000000 +0800
+++ binutils-060925/gas/testsuite/gas/arm/iwmmxt-wldstbh.s
2006-09-26 16:08:11.000000000 +0800
@@ -0,0 +1,8 @@
+ .text
+ .global iwmmxt
+iwmmxt:
+
+ wldrb wr1, [r1], #0
+ wldrh wr1, [r1], #0
+ wstrb wr1, [r1], #0
+ wstrh wr1, [r1], #0
--
best regards,
-Bridge