aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2016-11-03 12:00:53 +0000
committerJiong Wang <jiong.wang@arm.com>2016-11-03 12:00:53 +0000
commitbada43421274615d0d5f629a61a60b7daa71bc15 (patch)
tree9c1be5a6a202d2d65d8f1d5baabe37be2d1b43fe /gas/testsuite
parent225b362d1036121a611f3dd17fdb6780070ba51f (diff)
downloadgdb-bada43421274615d0d5f629a61a60b7daa71bc15.zip
gdb-bada43421274615d0d5f629a61a60b7daa71bc15.tar.gz
gdb-bada43421274615d0d5f629a61a60b7daa71bc15.tar.bz2
[ARM] Allow MOV/MOV.W to accept all possible immediates
gas/ * config/tc-arm.c (SBIT_SHIFT): New. (T2_SBIT_SHIFT): Likewise. (t32_insn_ok): Return TRUE for MOV in ARMv8-M Baseline. (md_apply_fix): Try UINT16 encoding when ARM/Thumb modified immediate encoding failed. * testsuite/gas/arm/archv6t2-bad.s: New error case. * testsuite/gas/arm/archv6t2-bad.l: New error match. * testsuite/gas/arm/archv6t2.s: New testcase. * testsuite/gas/arm/archv6t2.d: New expected result. * testsuite/gas/arm/archv8m.s: New testcase. * testsuite/gas/arm/archv8m-base.d: New expected result. * testsuite/gas/arm/archv8m-main.d: Likewise. * testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/arm/archv6t2-bad.l1
-rw-r--r--gas/testsuite/gas/arm/archv6t2-bad.s5
-rw-r--r--gas/testsuite/gas/arm/archv6t2.d1
-rw-r--r--gas/testsuite/gas/arm/archv6t2.s3
-rw-r--r--gas/testsuite/gas/arm/archv8m-base.d2
-rw-r--r--gas/testsuite/gas/arm/archv8m-main-dsp-1.d2
-rw-r--r--gas/testsuite/gas/arm/archv8m-main.d2
-rw-r--r--gas/testsuite/gas/arm/archv8m.s8
8 files changed, 23 insertions, 1 deletions
diff --git a/gas/testsuite/gas/arm/archv6t2-bad.l b/gas/testsuite/gas/arm/archv6t2-bad.l
index 0f00db3..89c28ec 100644
--- a/gas/testsuite/gas/arm/archv6t2-bad.l
+++ b/gas/testsuite/gas/arm/archv6t2-bad.l
@@ -38,3 +38,4 @@
[^:]*:53: Warning: source register same as write-back base
[^:]*:59: Error: instruction does not accept this addressing mode -- `ldrex r0,r2'
[^:]*:60: Error: instruction does not accept this addressing mode -- `strex r1,r0,r2'
+[^:]*:64: Error: invalid constant \(999\) after fixup
diff --git a/gas/testsuite/gas/arm/archv6t2-bad.s b/gas/testsuite/gas/arm/archv6t2-bad.s
index af13972..008088d 100644
--- a/gas/testsuite/gas/arm/archv6t2-bad.s
+++ b/gas/testsuite/gas/arm/archv6t2-bad.s
@@ -58,4 +58,7 @@ x:
@ to a label called "r2".
ldrex r0, r2
strex r1, r0, r2
- \ No newline at end of file
+
+ @ movs shouldn't be extened to accept UINT16 can't fit into ARM modified
+ @ immediate format.
+ movs r0, #0x0999
diff --git a/gas/testsuite/gas/arm/archv6t2.d b/gas/testsuite/gas/arm/archv6t2.d
index eb76a32..8769b3f 100644
--- a/gas/testsuite/gas/arm/archv6t2.d
+++ b/gas/testsuite/gas/arm/archv6t2.d
@@ -61,3 +61,4 @@ Disassembly of section .text:
0+d4 <[^>]+> e06100b2 strht r0, \[r1\], #-2
0+d8 <[^>]+> 10e100b2 strhtne r0, \[r1\], #2
0+dc <[^>]+> 106100b2 strhtne r0, \[r1\], #-2
+0+e0 <[^>]+> e3009999 movw r9, #2457 ; 0x999
diff --git a/gas/testsuite/gas/arm/archv6t2.s b/gas/testsuite/gas/arm/archv6t2.s
index 81ff501..8d74359 100644
--- a/gas/testsuite/gas/arm/archv6t2.s
+++ b/gas/testsuite/gas/arm/archv6t2.s
@@ -65,3 +65,6 @@ x:
strht r0, [r1], #-2
strneht r0, [r1], #2
strneht r0, [r1], #-2
+
+ @ mov accept A2 encoding as well.
+ mov r9, #0x0999
diff --git a/gas/testsuite/gas/arm/archv8m-base.d b/gas/testsuite/gas/arm/archv8m-base.d
index 6a2ee87..6075ee0 100644
--- a/gas/testsuite/gas/arm/archv8m-base.d
+++ b/gas/testsuite/gas/arm/archv8m-base.d
@@ -16,6 +16,8 @@ Disassembly of section .text:
0+.* <[^>]*> e849 f840 ttt r8, r9
0+.* <[^>]*> f24f 1023 movw r0, #61731 ; 0xf123
0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1023 movt r0, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1823 movt r8, #61731 ; 0xf123
0+.* <[^>]*> b154 cbz r4, 0+.* <[^>]*>
diff --git a/gas/testsuite/gas/arm/archv8m-main-dsp-1.d b/gas/testsuite/gas/arm/archv8m-main-dsp-1.d
index c8f9d7b..8c2c12d 100644
--- a/gas/testsuite/gas/arm/archv8m-main-dsp-1.d
+++ b/gas/testsuite/gas/arm/archv8m-main-dsp-1.d
@@ -16,6 +16,8 @@ Disassembly of section .text:
0+.* <[^>]*> e849 f840 ttt r8, r9
0+.* <[^>]*> f24f 1023 movw r0, #61731 ; 0xf123
0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1023 movt r0, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1823 movt r8, #61731 ; 0xf123
0+.* <[^>]*> b154 cbz r4, 0+.* <[^>]*>
diff --git a/gas/testsuite/gas/arm/archv8m-main.d b/gas/testsuite/gas/arm/archv8m-main.d
index a0c40e9..0b76db1 100644
--- a/gas/testsuite/gas/arm/archv8m-main.d
+++ b/gas/testsuite/gas/arm/archv8m-main.d
@@ -16,6 +16,8 @@ Disassembly of section .text:
0+.* <[^>]*> e849 f840 ttt r8, r9
0+.* <[^>]*> f24f 1023 movw r0, #61731 ; 0xf123
0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
+0+.* <[^>]*> f24f 1823 movw r8, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1023 movt r0, #61731 ; 0xf123
0+.* <[^>]*> f2cf 1823 movt r8, #61731 ; 0xf123
0+.* <[^>]*> b154 cbz r4, 0+.* <[^>]*>
diff --git a/gas/testsuite/gas/arm/archv8m.s b/gas/testsuite/gas/arm/archv8m.s
index 5f8aafe..a82582e 100644
--- a/gas/testsuite/gas/arm/archv8m.s
+++ b/gas/testsuite/gas/arm/archv8m.s
@@ -11,6 +11,14 @@ tt r8, r9
ttt r0, r1
ttt r8, r9
movw r0, #0xF123
+@ mov accept all immediate formats, including T3. It's also the suggested
+@ assembly to use.
+mov r8, #0xF123
+@ .w means wide, specifies that the assembler must select a 32-bit encoding for
+@ the instruction if it is possible, it should accept both T2 (Thumb modified
+@ immediate) and T3 (UINT16) encoding. See the section "Standard assembler
+@ syntax fields" on latest ARM-ARM.
+mov.w r8, #0xF123
movw r8, #0xF123
movt r0, #0xF123
movt r8, #0xF123