aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-05-11 23:45:54 +0000
committerNate Begeman <natebegeman@mac.com>2005-05-11 23:45:54 +0000
commite066d68eb4c2fe227fb60f4836247e3b03320e7e (patch)
tree6a3e46239418c5abfe80f2cf69ff1579389c1d59
parentd7c4a4a6c048d4174b8795598f50fd76c30731ed (diff)
Add testcase for legalizing ISD::CTTZ efficiently. On PPC, ctlz(int) is
now codegen'd as this: addi r2, r3, -1 andc r2, r2, r3 cntlzw r2, r2 subfic r3, r2, 32 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21881 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/PowerPC/cttz.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/cttz.ll b/test/CodeGen/PowerPC/cttz.ll
new file mode 100644
index 0000000000..f860456d64
--- /dev/null
+++ b/test/CodeGen/PowerPC/cttz.ll
@@ -0,0 +1,12 @@
+; Make sure this testcase does not use ctpop
+; RUN: llvm-as < %s | llc -march=ppc32 | grep -i 'cntlzw'
+
+declare int %llvm.cttz(int)
+
+implementation ; Functions:
+
+int %bar(int %x) {
+entry:
+ %tmp.1 = call int %llvm.cttz( int %x )
+ ret int %tmp.1
+}