[llvm-commits] [llvm] r118668 - /llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Tue Nov 9 18:22:44 PST 2010


Author: bruno
Date: Tue Nov  9 20:22:44 2010
New Revision: 118668

URL: http://llvm.org/viewvc/llvm-project?rev=118668&view=rev
Log:
Add a test to the previous added clo instruction. Patch by Akira again

Added:
    llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll

Added: llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll?rev=118668&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/2010-11-09-CountLeading.ll Tue Nov  9 20:22:44 2010
@@ -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
+}





More information about the llvm-commits mailing list