summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-11-10 02:22:44 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-11-10 02:22:44 +0000
commita4ceea8cd86c4fc649c7c79499ae9dddb9ea20e0 (patch)
tree2ccd1ba85a27b554e50fabbe1c805743deb67b70 /llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll
parent67fc18a493913a721e1aa4187818167391626f82 (diff)
downloadbcm5719-llvm-a4ceea8cd86c4fc649c7c79499ae9dddb9ea20e0.tar.gz
bcm5719-llvm-a4ceea8cd86c4fc649c7c79499ae9dddb9ea20e0.zip
Add a test to the previous added clo instruction. Patch by Akira again
llvm-svn: 118668
Diffstat (limited to 'llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll')
-rw-r--r--llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll b/llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll
new file mode 100644
index 00000000000..d592fef331a
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/2010-11-09-CountLeading.ll
@@ -0,0 +1,33 @@
+; RUN: llc -march=mips -mcpu=4ke < %s | FileCheck %s
+
+; CHECK: clz $2, $4
+define i32 @t1(i32 %X) nounwind readnone {
+entry:
+ %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X)
+ ret i32 %tmp1
+}
+
+declare i32 @llvm.ctlz.i32(i32) nounwind readnone
+
+; CHECK: clz $2, $4
+define i32 @t2(i32 %X) nounwind readnone {
+entry:
+ %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X)
+ ret i32 %tmp1
+}
+
+; CHECK: clo $2, $4
+define i32 @t3(i32 %X) nounwind readnone {
+entry:
+ %neg = xor i32 %X, -1
+ %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg)
+ ret i32 %tmp1
+}
+
+; CHECK: clo $2, $4
+define i32 @t4(i32 %X) nounwind readnone {
+entry:
+ %neg = xor i32 %X, -1
+ %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg)
+ ret i32 %tmp1
+}
OpenPOWER on IntegriCloud