2011-09-10 07:14:58 +08:00
|
|
|
; RUN: llc -march=mips < %s | FileCheck %s
|
2010-11-10 10:22:44 +08:00
|
|
|
|
|
|
|
; CHECK: clz $2, $4
|
|
|
|
define i32 @t1(i32 %X) nounwind readnone {
|
|
|
|
entry:
|
2011-12-12 19:59:10 +08:00
|
|
|
%tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X, i1 true)
|
2010-11-10 10:22:44 +08:00
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
|
|
|
|
2011-12-12 19:59:10 +08:00
|
|
|
declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
|
2010-11-10 10:22:44 +08:00
|
|
|
|
|
|
|
; CHECK: clz $2, $4
|
|
|
|
define i32 @t2(i32 %X) nounwind readnone {
|
|
|
|
entry:
|
2011-12-12 19:59:10 +08:00
|
|
|
%tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X, i1 true)
|
2010-11-10 10:22:44 +08:00
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clo $2, $4
|
|
|
|
define i32 @t3(i32 %X) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%neg = xor i32 %X, -1
|
2011-12-12 19:59:10 +08:00
|
|
|
%tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg, i1 true)
|
2010-11-10 10:22:44 +08:00
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clo $2, $4
|
|
|
|
define i32 @t4(i32 %X) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%neg = xor i32 %X, -1
|
2011-12-12 19:59:10 +08:00
|
|
|
%tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg, i1 true)
|
2010-11-10 10:22:44 +08:00
|
|
|
ret i32 %tmp1
|
|
|
|
}
|