1 ; RUN: llc -march=arc < %s | FileCheck %s
5 declare i32 @llvm.ctlz.i32(i32, i1)
6 declare i32 @llvm.cttz.i32(i32, i1)
7 declare i64 @llvm.readcyclecounter()
9 ; CHECK-LABEL: test_ctlz_i32:
10 ; CHECK: fls.f %r0, %r0
11 ; CHECK-NEXT: mov.eq %r0, 32
12 ; CHECK-NEXT: rsub.ne %r0, %r0, 31
13 define i32 @test_ctlz_i32(i32 %x) {
14 %a = call i32 @llvm.ctlz.i32(i32 %x, i1 false)
18 ; CHECK-LABEL: test_cttz_i32:
19 ; CHECK: ffs.f %r0, %r0
20 ; CHECK-NEXT: mov.eq %r0, 32
21 define i32 @test_cttz_i32(i32 %x) {
22 %a = call i32 @llvm.cttz.i32(i32 %x, i1 false)
26 ; CHECK-LABEL: test_readcyclecounter:
28 ; CHECK-NEXT: mov %r1, 0
29 define i64 @test_readcyclecounter() nounwind {
30 %a = call i64 @llvm.readcyclecounter()