Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
      2 
      3 ; CHECK: r{{[0-9]+}}:{{[0-9]+}} |= lsr(r{{[0-9]+}}:{{[0-9]+}}, #4)
      4 ; CHECK: r{{[0-9]+}}:{{[0-9]+}} &= lsr(r{{[0-9]+}}:{{[0-9]+}}, #2)
      5 ; CHECK: r{{[0-9]+}} += lsr(r{{[0-9]+}}, #4)
      6 
      7 define i32 @foo(i64 %a, i32 %b) nounwind  {
      8 entry:
      9         %tmp0 = tail call i64 @llvm.ctlz.i64( i64 %a, i1 true )
     10         %tmp1 = tail call i64 @llvm.cttz.i64( i64 %a, i1 true )
     11         %tmp2 = tail call i32 @llvm.ctlz.i32( i32 %b, i1 true )
     12         %tmp3 = tail call i32 @llvm.cttz.i32( i32 %b, i1 true )
     13         %tmp4 = tail call i64 @llvm.ctpop.i64( i64 %a )
     14         %tmp5 = tail call i32 @llvm.ctpop.i32( i32 %b )
     15 
     16 
     17         %tmp6 = trunc i64 %tmp0 to i32
     18         %tmp7 = trunc i64 %tmp1 to i32
     19         %tmp8 = trunc i64 %tmp4 to i32
     20         %tmp9 = add i32 %tmp6, %tmp7
     21         %tmp10 = add i32 %tmp9, %tmp8
     22         %tmp11 = add i32 %tmp10, %tmp2
     23         %tmp12 = add i32 %tmp11, %tmp3
     24         %tmp13 = add i32 %tmp12, %tmp5
     25 
     26         ret i32 %tmp13
     27 }
     28 
     29 declare i64 @llvm.ctlz.i64(i64, i1) nounwind readnone
     30 declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
     31 declare i64 @llvm.cttz.i64(i64, i1) nounwind readnone
     32 declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone
     33 declare i64 @llvm.ctpop.i64(i64) nounwind readnone
     34 declare i32 @llvm.ctpop.i32(i32) nounwind readnone
     35