This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Additional Thumb instructions for ARMv6K
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 10 Mar 2005 09:45:35 -0800
- Subject: Re: PATCH: Additional Thumb instructions for ARMv6K
- References: <87u0nlhb09.fsf@codesourcery.com> <422EEE54.80006@redhat.com>
Nick Clifton <nickc@redhat.com> writes:
> Hi Zack,
>
>> The only possibly problematic part of this patch is the NOP changes.
>
> Do you have a patch for the ARM simulator to handle these new
> instructions ? Especially the NOP instruction ?
I don't. CodeSourcery's client is not paying us to improve the
simulator, and there are also intellectual-property issues.
This version of the patch drops the NOP changes (except for the
disassembler recognizing 0xbf00 as a Thumb NOP). Will you take this
without corresponding simulator improvements?
zw
gas:
* config/tc-arm.c (tinsns): Add ARMv6K instructions sev, wfe,
wfi, yield.
opcodes:
* arm-dis.c (thumb_opcodes): Add ARMv6K instructions nop, sev,
wfe, wfi, yield.
gas/testsuite:
* gas/arm/thumbv6k.d, gas/arm/thumbv6k.s: New dump test.
* gas/arm/arm.exp: Run it.
===================================================================
Index: gas/config/tc-arm.c
--- gas/config/tc-arm.c 23 Feb 2005 12:28:03 -0000 1.193
+++ gas/config/tc-arm.c 10 Mar 2005 17:43:18 -0000
@@ -10950,6 +10950,12 @@ static const struct thumb_opcode tinsns[
{"sxtb", 0xb240, 2, ARM_EXT_V6, do_t_arit},
{"uxth", 0xb280, 2, ARM_EXT_V6, do_t_arit},
{"uxtb", 0xb2c0, 2, ARM_EXT_V6, do_t_arit},
+
+ /* ARM V6K. */
+ {"sev", 0xbf40, 2, ARM_EXT_V6K, do_empty},
+ {"wfe", 0xbf20, 2, ARM_EXT_V6K, do_empty},
+ {"wfi", 0xbf30, 2, ARM_EXT_V6K, do_empty},
+ {"yield", 0xbf10, 2, ARM_EXT_V6K, do_empty},
};
void
===================================================================
Index: gas/testsuite/gas/arm/arm.exp
--- gas/testsuite/gas/arm/arm.exp 4 Mar 2005 15:28:36 -0000 1.35
+++ gas/testsuite/gas/arm/arm.exp 10 Mar 2005 17:43:18 -0000
@@ -50,6 +50,7 @@ if {[istarget *arm*-*-*] || [istarget "x
run_dump_test "maverick"
run_dump_test "archv6"
run_dump_test "thumbv6"
+ run_dump_test "thumbv6k"
run_dump_test "arch6zk"
run_errors_test "vfp-bad" "-mfpu=vfp" "VFP errors"
===================================================================
Index: gas/testsuite/gas/arm/thumbv6k.d
--- gas/testsuite/gas/arm/thumbv6k.d 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/thumbv6k.d 10 Mar 2005 17:43:18 -0000
@@ -0,0 +1,15 @@
+#name: THUMB V6K instructions
+#as: -march=armv6k -mthumb
+#objdump: -dr --prefix-addresses --show-raw-insn -M force-thumb
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <[^>]*> bf10 * yield
+0+002 <[^>]*> bf20 * wfe
+0+004 <[^>]*> bf30 * wfi
+0+006 <[^>]*> bf40 * sev
+0+008 <[^>]*> 46c0 * nop[ \t]+\(mov r8, r8\)
+0+00a <[^>]*> 46c0 * nop[ \t]+\(mov r8, r8\)
+0+00c <[^>]*> 46c0 * nop[ \t]+\(mov r8, r8\)
+0+00e <[^>]*> 46c0 * nop[ \t]+\(mov r8, r8\)
===================================================================
Index: gas/testsuite/gas/arm/thumbv6k.s
--- gas/testsuite/gas/arm/thumbv6k.s 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/thumbv6k.s 10 Mar 2005 17:43:18 -0000
@@ -0,0 +1,14 @@
+ .text
+ .align 0
+ .thumb
+label:
+ yield
+ wfe
+ wfi
+ sev
+ # arm-aout wants the segment padded to an 16-byte boundary;
+ # do this explicitly so it's consistent for all object formats.
+ nop
+ nop
+ nop
+ nop
===================================================================
Index: opcodes/arm-dis.c
--- opcodes/arm-dis.c 29 Nov 2004 10:12:57 -0000 1.41
+++ opcodes/arm-dis.c 10 Mar 2005 17:43:19 -0000
@@ -622,6 +622,13 @@ static const struct thumb_opcode thumb_o
{
/* Thumb instructions. */
+ /* ARM V6K no-argument instructions. */
+ {ARM_EXT_V6K, 0xbf00, 0xffff, "nop"},
+ {ARM_EXT_V6K, 0xbf10, 0xffff, "yield"},
+ {ARM_EXT_V6K, 0xbf20, 0xffff, "wfe"},
+ {ARM_EXT_V6K, 0xbf30, 0xffff, "wfi"},
+ {ARM_EXT_V6K, 0xbf40, 0xffff, "sev"},
+
/* ARM V6. */
{ARM_EXT_V6, 0xb660, 0xfff8, "cpsie\t%2'a%1'i%0'f"},
{ARM_EXT_V6, 0xb670, 0xfff8, "cpsid\t%2'a%1'i%0'f"},