Thumb-2 has CLZ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Goodwin 2009-06-26 20:47:43 +00:00
parent 7ce720b448
commit 24062ac5be
2 changed files with 9 additions and 1 deletions

View File

@ -266,7 +266,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
setOperationAction(ISD::ROTL, MVT::i32, Expand);
setOperationAction(ISD::CTTZ, MVT::i32, Expand);
setOperationAction(ISD::CTPOP, MVT::i32, Expand);
if (!Subtarget->hasV5TOps() || Subtarget->isThumb())
if (!Subtarget->hasV5TOps() || Subtarget->isThumb1Only())
setOperationAction(ISD::CTLZ, MVT::i32, Expand);
// Only ARMv6 has BSWAP.

View File

@ -0,0 +1,8 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2,+v7a | grep "clz " | count 1
define i32 @f1(i32 %a) {
%tmp = tail call i32 @llvm.ctlz.i32(i32 %a)
ret i32 %tmp
}
declare i32 @llvm.ctlz.i32(i32) nounwind readnone