aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-04-22 23:24:18 +0000
committerJim Grosbach <grosbach@apple.com>2010-04-22 23:24:18 +0000
commit3a1287b470bde29d10e7c6998fb69b74d2265b6c (patch)
treed00a44ac8e3298c397a18e44107ddec9c03e82ed /test/CodeGen/ARM
parentfff6c5332f748d477e6ad0bd9b60b49ae867ab42 (diff)
downloadexternal_llvm-3a1287b470bde29d10e7c6998fb69b74d2265b6c.zip
external_llvm-3a1287b470bde29d10e7c6998fb69b74d2265b6c.tar.gz
external_llvm-3a1287b470bde29d10e7c6998fb69b74d2265b6c.tar.bz2
Update ARM DAGtoDAG for matching UBFX instruction for unsigned bitfield
extraction. This fixes PR5998. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM')
-rw-r--r--test/CodeGen/ARM/bfx.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/bfx.ll b/test/CodeGen/ARM/bfx.ll
new file mode 100644
index 0000000..fcca191
--- /dev/null
+++ b/test/CodeGen/ARM/bfx.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s -march=arm -mattr=+v7a | FileCheck %s
+
+define i32 @sbfx1(i32 %a) {
+; CHECK: sbfx1
+; CHECK: sbfx r0, r0, #7, #11
+ %t1 = lshr i32 %a, 7
+ %t2 = trunc i32 %t1 to i11
+ %t3 = sext i11 %t2 to i32
+ ret i32 %t3
+}
+
+define i32 @ubfx1(i32 %a) {
+; CHECK: ubfx1
+; CHECK: ubfx r0, r0, #7, #11
+ %t1 = lshr i32 %a, 7
+ %t2 = trunc i32 %t1 to i11
+ %t3 = zext i11 %t2 to i32
+ ret i32 %t3
+}
+
+define i32 @ubfx2(i32 %a) {
+; CHECK: ubfx2
+; CHECK: ubfx r0, r0, #7, #11
+ %t1 = lshr i32 %a, 7
+ %t2 = and i32 %t1, 2047
+ ret i32 %t2
+}
+