summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-06-26 16:52:40 +0000
committerTim Northover <tnorthover@apple.com>2013-06-26 16:52:40 +0000
commitc19bd321362166805194cbaf170e06a4790d2da9 (patch)
treeb3a213b067b0c0c3797077f5e24a57bb36265967 /test
parentc1a91dd97b000128189421eda6c5bb7905b1f467 (diff)
downloadllvm-c19bd321362166805194cbaf170e06a4790d2da9.tar.gz
llvm-c19bd321362166805194cbaf170e06a4790d2da9.tar.bz2
llvm-c19bd321362166805194cbaf170e06a4790d2da9.tar.xz
ARM: fix more cases where predication may or may not be allowed
Unfortunately this addresses two issues (by the time I'd disentangled the logic it wasn't worth putting it back to half-broken): + Coprocessor instructions should all be predicable in Thumb mode. + BKPT should never be predicable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/ARM/basic-arm-instructions.s12
-rw-r--r--test/MC/ARM/diagnostics.s14
-rw-r--r--test/MC/ARM/thumb-only-conditionals.s35
-rw-r--r--test/MC/ARM/thumb2-diagnostics.s4
4 files changed, 65 insertions, 0 deletions
diff --git a/test/MC/ARM/basic-arm-instructions.s b/test/MC/ARM/basic-arm-instructions.s
index 3061c0f70e..a7c54ff3a5 100644
--- a/test/MC/ARM/basic-arm-instructions.s
+++ b/test/MC/ARM/basic-arm-instructions.s
@@ -465,6 +465,8 @@ Lforward:
@ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xfe]
@ CHECK: cdp2 p10, #0, c6, c12, c0, #7 @ encoding: [0xe0,0x6a,0x0c,0xfe]
+ cdpne p7, #1, c1, c1, c1, #4
+@ CHECK: cdpne p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0x1e]
@------------------------------------------------------------------------------
@ CLREX
@@ -969,6 +971,9 @@ Lforward:
@ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xee]
@ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xfe]
+ mcrls p7, #1, r5, c1, c1, #4
+@ CHECK: mcrls p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0x9e]
+
@------------------------------------------------------------------------------
@ MCRR/MCRR2
@------------------------------------------------------------------------------
@@ -978,6 +983,8 @@ Lforward:
@ CHECK: mcrr p7, #15, r5, r4, c1 @ encoding: [0xf1,0x57,0x44,0xec]
@ CHECK: mcrr2 p7, #15, r5, r4, c1 @ encoding: [0xf1,0x57,0x44,0xfc]
+ mcrrgt p7, #15, r5, r4, c1
+@ CHECK: mcrrgt p7, #15, r5, r4, c1 @ encoding: [0xf1,0x57,0x44,0xcc]
@------------------------------------------------------------------------------
@ MLA
@@ -1081,6 +1088,9 @@ Lforward:
@ CHECK: mrc2 p10, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0x30,0xfa,0xff,0xfe]
@ CHECK: mrc2 p10, #7, pc, c15, c0, #1 @ encoding: [0x30,0xfa,0xff,0xfe]
+ mrceq p15, #7, pc, c15, c6, #6
+@ CHECK: mrceq p15, #7, pc, c15, c6, #6 @ encoding: [0xd6,0xff,0xff,0x0e]
+
@------------------------------------------------------------------------------
@ MRRC/MRRC2
@------------------------------------------------------------------------------
@@ -1090,6 +1100,8 @@ Lforward:
@ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xec]
@ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xfc]
+ mrrclo p7, #1, r5, r4, c1
+@ CHECK: mrrclo p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0x3c]
@------------------------------------------------------------------------------
@ MRS
diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s
index 21fda1cce1..1aea1174af 100644
--- a/test/MC/ARM/diagnostics.s
+++ b/test/MC/ARM/diagnostics.s
@@ -393,3 +393,17 @@
@ CHECK-ERRORS: error: instruction 'dmb' is not predicable, but condition code specified
@ CHECK-ERRORS: error: instruction 'dsb' is not predicable, but condition code specified
@ CHECK-ERRORS: error: instruction 'isb' is not predicable, but condition code specified
+
+ mcr2le p7, #1, r5, c1, c1, #4
+ mcrr2ne p7, #15, r5, r4, c1
+ mrc2lo p14, #0, r1, c1, c2, #4
+ mrrc2lo p7, #1, r5, r4, c1
+ cdp2hi p10, #0, c6, c12, c0, #7
+@ CHECK-ERRORS: error: instruction 'mcr2' is not predicable, but condition code specified
+@ CHECK-ERRORS: error: instruction 'mcrr2' is not predicable, but condition code specified
+@ CHECK-ERRORS: error: instruction 'mrc2' is not predicable, but condition code specified
+@ CHECK-ERRORS: error: instruction 'mrrc2' is not predicable, but condition code specified
+@ CHECK-ERRORS: error: instruction 'cdp2' is not predicable, but condition code specified
+
+ bkpteq #7
+@ CHECK-ERRORS: error: instruction 'bkpt' is not predicable, but condition code specified
diff --git a/test/MC/ARM/thumb-only-conditionals.s b/test/MC/ARM/thumb-only-conditionals.s
index 55b2cf4c68..6d13ce5cc9 100644
--- a/test/MC/ARM/thumb-only-conditionals.s
+++ b/test/MC/ARM/thumb-only-conditionals.s
@@ -17,3 +17,38 @@
@ CHECK-NEXT: dmble sy
@ CHECK-NEXT: dsbgt sy
@ CHECK-NEXT: isble sy
+
+ itt gt
+ cdpgt p7, #1, c1, c1, c1, #4
+ cdp2gt p7, #1, c1, c1, c1, #4
+@ CHECK: itt gt
+@ CHECK-NEXT: cdpgt p7, #1, c1, c1, c1, #4
+@ CHECK-NEXT: cdp2gt p7, #1, c1, c1, c1, #4
+
+ itt ne
+ mcrne p0, #0, r0, c0, c0, #0
+ mcr2ne p0, #0, r0, c0, c0, #0
+@ CHECK: itt ne
+@ CHECK-NEXT: mcrne p0, #0, r0, c0, c0, #0
+@ CHECK-NEXT: mcr2ne p0, #0, r0, c0, c0, #0
+
+ ite le
+ mcrrle p7, #15, r5, r4, c1
+ mcrr2gt p7, #15, r5, r4, c1
+@ CHECK: ite le
+@ CHECK-NEXT: mcrrle p7, #15, r5, r4, c1
+@ CHECK-NEXT: mcrr2gt p7, #15, r5, r4, c1
+
+ ite eq
+ mrceq p11, #1, r1, c2, c2
+ mrc2ne p12, #3, r3, c3, c4
+@ CHECK: ite eq
+@ CHECK-NEXT: mrceq p11, #1, r1, c2, c2
+@ CHECK-NEXT: mrc2ne p12, #3, r3, c3, c4
+
+ itt lo
+ mrrclo p7, #1, r5, r4, c1
+ mrrc2lo p7, #1, r5, r4, c1
+@ CHECK: itt lo
+@ CHECK-NEXT: mrrclo p7, #1, r5, r4, c1
+@ CHECK-NEXT: mrrc2lo p7, #1, r5, r4, c1
diff --git a/test/MC/ARM/thumb2-diagnostics.s b/test/MC/ARM/thumb2-diagnostics.s
index b7fe44d2cd..e1c005872f 100644
--- a/test/MC/ARM/thumb2-diagnostics.s
+++ b/test/MC/ARM/thumb2-diagnostics.s
@@ -47,3 +47,7 @@
isb #16
@ CHECK-ERRORS: error: immediate value out of range
@ CHECK-ERRORS: error: immediate value out of range
+
+ itt eq
+ bkpteq #1
+@ CHECK-ERRORS: error: instruction 'bkpt' is not predicable, but condition code specified