1 ; RUN: llc < %s -mtriple arm-eabi -mattr=+v6t2 | FileCheck %s
2 ; RUN: llc < %s -mtriple arm-eabi -mattr=+v6t2 -mattr=+neon | FileCheck %s
4 ; This test checks the @llvm.cttz.* intrinsics for integers.
6 declare i8 @llvm.cttz.i8(i8, i1)
7 declare i16 @llvm.cttz.i16(i16, i1)
8 declare i32 @llvm.cttz.i32(i32, i1)
9 declare i64 @llvm.cttz.i64(i64, i1)
11 ;------------------------------------------------------------------------------
13 define i8 @test_i8(i8 %a) {
14 ; CHECK-LABEL: test_i8:
15 ; CHECK: orr [[REG:r[0-9]+]], [[REG]], #256
18 %tmp = call i8 @llvm.cttz.i8(i8 %a, i1 false)
22 define i16 @test_i16(i16 %a) {
23 ; CHECK-LABEL: test_i16:
24 ; CHECK: orr [[REG:r[0-9]+]], [[REG]], #65536
27 %tmp = call i16 @llvm.cttz.i16(i16 %a, i1 false)
31 define i32 @test_i32(i32 %a) {
32 ; CHECK-LABEL: test_i32:
35 %tmp = call i32 @llvm.cttz.i32(i32 %a, i1 false)
39 define i64 @test_i64(i64 %a) {
40 ; CHECK-LABEL: test_i64:
47 %tmp = call i64 @llvm.cttz.i64(i64 %a, i1 false)
51 ;------------------------------------------------------------------------------
53 define i8 @test_i8_zero_undef(i8 %a) {
54 ; CHECK-LABEL: test_i8_zero_undef:
58 %tmp = call i8 @llvm.cttz.i8(i8 %a, i1 true)
62 define i16 @test_i16_zero_undef(i16 %a) {
63 ; CHECK-LABEL: test_i16_zero_undef:
67 %tmp = call i16 @llvm.cttz.i16(i16 %a, i1 true)
72 define i32 @test_i32_zero_undef(i32 %a) {
73 ; CHECK-LABEL: test_i32_zero_undef:
76 %tmp = call i32 @llvm.cttz.i32(i32 %a, i1 true)
80 define i64 @test_i64_zero_undef(i64 %a) {
81 ; CHECK-LABEL: test_i64_zero_undef:
88 %tmp = call i64 @llvm.cttz.i64(i64 %a, i1 true)