1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 ; CHECK: count_leading_0:
5 define i32 @count_leading_0(i32 %p) #0 {
6 %1 = call i32 @llvm.ctlz.i32(i32 %p, i1 false)
10 ; CHECK: count_leading_0p:
12 define i32 @count_leading_0p(i64 %p) #0 {
13 %1 = call i64 @llvm.ctlz.i64(i64 %p, i1 false)
14 %2 = trunc i64 %1 to i32
18 ; CHECK: count_leading_1:
20 define i32 @count_leading_1(i32 %p) #0 {
22 %2 = call i32 @llvm.ctlz.i32(i32 %1, i1 false)
26 ; CHECK: count_leading_1p:
28 define i32 @count_leading_1p(i64 %p) #0 {
30 %2 = call i64 @llvm.ctlz.i64(i64 %1, i1 false)
31 %3 = trunc i64 %2 to i32
37 ; CHECK: count_trailing_0:
39 define i32 @count_trailing_0(i32 %p) #0 {
40 %1 = call i32 @llvm.cttz.i32(i32 %p, i1 false)
44 ; CHECK: count_trailing_0p:
46 define i32 @count_trailing_0p(i64 %p) #0 {
47 %1 = call i64 @llvm.cttz.i64(i64 %p, i1 false)
48 %2 = trunc i64 %1 to i32
52 ; CHECK: count_trailing_1:
54 define i32 @count_trailing_1(i32 %p) #0 {
56 %2 = call i32 @llvm.cttz.i32(i32 %1, i1 false)
60 ; CHECK: count_trailing_1p:
62 define i32 @count_trailing_1p(i64 %p) #0 {
64 %2 = call i64 @llvm.cttz.i64(i64 %1, i1 false)
65 %3 = trunc i64 %2 to i32
69 declare i32 @llvm.ctlz.i32(i32, i1)
70 declare i64 @llvm.ctlz.i64(i64, i1)
71 declare i32 @llvm.cttz.i32(i32, i1)
72 declare i64 @llvm.cttz.i64(i64, i1)
74 attributes #0 = { nounwind "target-cpu"="hexagonv55" }