From 4ce1dea8afaa97c4c1b98de9eae6f7d533e4ce06 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Wed, 11 May 2005 23:45:54 +0000 Subject: [PATCH] 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 llvm-svn: 21881 --- llvm/test/Regression/CodeGen/PowerPC/cttz.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 llvm/test/Regression/CodeGen/PowerPC/cttz.ll diff --git a/llvm/test/Regression/CodeGen/PowerPC/cttz.ll b/llvm/test/Regression/CodeGen/PowerPC/cttz.ll new file mode 100644 index 000000000000..f860456d647c --- /dev/null +++ b/llvm/test/Regression/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 +}