Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mips < %s | FileCheck %s
      2 
      3 ; CHECK: clz $2, $4
      4 define i32 @t1(i32 %X) nounwind readnone {
      5 entry:
      6   %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X)
      7   ret i32 %tmp1
      8 }
      9 
     10 declare i32 @llvm.ctlz.i32(i32) nounwind readnone
     11 
     12 ; CHECK: clz $2, $4
     13 define i32 @t2(i32 %X) nounwind readnone {
     14 entry:
     15   %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %X)
     16   ret i32 %tmp1
     17 }
     18 
     19 ; CHECK: clo $2, $4
     20 define i32 @t3(i32 %X) nounwind readnone {
     21 entry:
     22   %neg = xor i32 %X, -1
     23   %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg)
     24   ret i32 %tmp1
     25 }
     26 
     27 ; CHECK: clo $2, $4
     28 define i32 @t4(i32 %X) nounwind readnone {
     29 entry:
     30   %neg = xor i32 %X, -1
     31   %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %neg)
     32   ret i32 %tmp1
     33 }
     34