summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/bfi.ll
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-07-16 23:05:05 +0000
committerJim Grosbach <grosbach@apple.com>2010-07-16 23:05:05 +0000
commit469bbdb597f27d6900c95b6d8ae20a45b79ce91b (patch)
tree3972372fc21435a8b44745ef8375f13d90c10521 /test/CodeGen/ARM/bfi.ll
parent6dd26ba4bab4e3ebb1545e7e2211297f66e61e0b (diff)
downloadllvm-469bbdb597f27d6900c95b6d8ae20a45b79ce91b.tar.gz
llvm-469bbdb597f27d6900c95b6d8ae20a45b79ce91b.tar.bz2
llvm-469bbdb597f27d6900c95b6d8ae20a45b79ce91b.tar.xz
Add basic support to code-gen the ARM/Thumb2 bit-field insert (BFI) instruction
and a combine pattern to use it for setting a bit-field to a constant value. More to come for non-constant stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/bfi.ll')
-rw-r--r--test/CodeGen/ARM/bfi.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/bfi.ll b/test/CodeGen/ARM/bfi.ll
new file mode 100644
index 0000000000..48ef43762f
--- /dev/null
+++ b/test/CodeGen/ARM/bfi.ll
@@ -0,0 +1,17 @@
+; RUN: llc -march=arm -mattr=+v6t2 < %s | FileCheck %s
+
+%struct.F = type { [3 x i8], i8 }
+
+@X = common global %struct.F zeroinitializer, align 4 ; <%struct.F*> [#uses=1]
+
+define void @f1([1 x i32] %f.coerce0) nounwind {
+entry:
+; CHECK: f1
+; CHECK: mov r2, #10
+; CHECK: bfi r1, r2, #22, #4
+ %0 = load i32* bitcast (%struct.F* @X to i32*), align 4 ; <i32> [#uses=1]
+ %1 = and i32 %0, -62914561 ; <i32> [#uses=1]
+ %2 = or i32 %1, 41943040 ; <i32> [#uses=1]
+ store i32 %2, i32* bitcast (%struct.F* @X to i32*), align 4
+ ret void
+}