summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/bfi.ll
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-07-17 03:30:54 +0000
committerJim Grosbach <grosbach@apple.com>2010-07-17 03:30:54 +0000
commitb97e2bbe32bf83dbc653d2a3a586b433f4acd846 (patch)
tree086f1b8af144042613e88c84d62e491e8fa7273b /llvm/test/CodeGen/ARM/bfi.ll
parentceb16a5ce9829323b8ff62f7bd521b139d3ddc25 (diff)
downloadbcm5719-llvm-b97e2bbe32bf83dbc653d2a3a586b433f4acd846.tar.gz
bcm5719-llvm-b97e2bbe32bf83dbc653d2a3a586b433f4acd846.zip
Add combiner patterns to more effectively utilize the BFI (bitfield insert)
instruction for non-constant operands. This includes the case referenced in the README.txt regarding a bitfield copy. llvm-svn: 108608
Diffstat (limited to 'llvm/test/CodeGen/ARM/bfi.ll')
-rw-r--r--llvm/test/CodeGen/ARM/bfi.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/bfi.ll b/llvm/test/CodeGen/ARM/bfi.ll
index 48ef43762f0..59e2b43a917 100644
--- a/llvm/test/CodeGen/ARM/bfi.ll
+++ b/llvm/test/CodeGen/ARM/bfi.ll
@@ -15,3 +15,26 @@ entry:
store i32 %2, i32* bitcast (%struct.F* @X to i32*), align 4
ret void
}
+
+define i32 @f2(i32 %A, i32 %B) nounwind readnone optsize {
+entry:
+; CHECK: f2
+; CHECK: mov r1, r1, lsr #7
+; CHECK: bfi r0, r1, #7, #16
+ %and = and i32 %A, -8388481 ; <i32> [#uses=1]
+ %and2 = and i32 %B, 8388480 ; <i32> [#uses=1]
+ %or = or i32 %and2, %and ; <i32> [#uses=1]
+ ret i32 %or
+}
+
+define i32 @f3(i32 %A, i32 %B) nounwind readnone optsize {
+entry:
+; CHECK: f3
+; CHECK: mov r2, r0, lsr #7
+; CHECK: mov r0, r1
+; CHECK: bfi r0, r2, #7, #16
+ %and = and i32 %A, 8388480 ; <i32> [#uses=1]
+ %and2 = and i32 %B, -8388481 ; <i32> [#uses=1]
+ %or = or i32 %and2, %and ; <i32> [#uses=1]
+ ret i32 %or
+}
OpenPOWER on IntegriCloud