1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -verify-machineinstrs -mattr=+mve %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <2 x i64> @cttz_2i64_0_t(<2 x i64> %src){
5 ; CHECK-LABEL: cttz_2i64_0_t:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vmov r0, r1, d1
8 ; CHECK-NEXT: rbit r1, r1
9 ; CHECK-NEXT: rbit r2, r0
10 ; CHECK-NEXT: clz r1, r1
11 ; CHECK-NEXT: cmp r0, #0
12 ; CHECK-NEXT: add.w r1, r1, #32
14 ; CHECK-NEXT: clzne r1, r2
15 ; CHECK-NEXT: vmov s2, r1
16 ; CHECK-NEXT: vmov r0, r1, d0
17 ; CHECK-NEXT: vldr s1, .LCPI0_0
18 ; CHECK-NEXT: vmov.f32 s3, s1
19 ; CHECK-NEXT: rbit r1, r1
20 ; CHECK-NEXT: rbit r2, r0
21 ; CHECK-NEXT: clz r1, r1
22 ; CHECK-NEXT: cmp r0, #0
23 ; CHECK-NEXT: add.w r1, r1, #32
25 ; CHECK-NEXT: clzne r1, r2
26 ; CHECK-NEXT: vmov s0, r1
28 ; CHECK-NEXT: .p2align 2
29 ; CHECK-NEXT: @ %bb.1:
30 ; CHECK-NEXT: .LCPI0_0:
31 ; CHECK-NEXT: .long 0x00000000 @ float 0
33 %0 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %src, i1 0)
37 define arm_aapcs_vfpcc <4 x i32> @cttz_4i32_0_t(<4 x i32> %src){
38 ; CHECK-LABEL: cttz_4i32_0_t:
39 ; CHECK: @ %bb.0: @ %entry
40 ; CHECK-NEXT: movs r0, #32
41 ; CHECK-NEXT: vbrsr.32 q0, q0, r0
42 ; CHECK-NEXT: vclz.i32 q0, q0
45 %0 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %src, i1 0)
49 define arm_aapcs_vfpcc <8 x i16> @cttz_8i16_0_t(<8 x i16> %src){
50 ; CHECK-LABEL: cttz_8i16_0_t:
51 ; CHECK: @ %bb.0: @ %entry
52 ; CHECK-NEXT: movs r0, #16
53 ; CHECK-NEXT: vbrsr.16 q0, q0, r0
54 ; CHECK-NEXT: vclz.i16 q0, q0
57 %0 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %src, i1 0)
61 define arm_aapcs_vfpcc <16 x i8> @cttz_16i8_0_t(<16 x i8> %src) {
62 ; CHECK-LABEL: cttz_16i8_0_t:
63 ; CHECK: @ %bb.0: @ %entry
64 ; CHECK-NEXT: movs r0, #8
65 ; CHECK-NEXT: vbrsr.8 q0, q0, r0
66 ; CHECK-NEXT: vclz.i8 q0, q0
69 %0 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %src, i1 0)
73 define arm_aapcs_vfpcc <2 x i64> @cttz_2i64_1_t(<2 x i64> %src){
74 ; CHECK-LABEL: cttz_2i64_1_t:
75 ; CHECK: @ %bb.0: @ %entry
76 ; CHECK-NEXT: vmov r0, r1, d1
77 ; CHECK-NEXT: rbit r1, r1
78 ; CHECK-NEXT: rbit r2, r0
79 ; CHECK-NEXT: clz r1, r1
80 ; CHECK-NEXT: cmp r0, #0
81 ; CHECK-NEXT: add.w r1, r1, #32
83 ; CHECK-NEXT: clzne r1, r2
84 ; CHECK-NEXT: vmov s2, r1
85 ; CHECK-NEXT: vmov r0, r1, d0
86 ; CHECK-NEXT: vldr s1, .LCPI4_0
87 ; CHECK-NEXT: vmov.f32 s3, s1
88 ; CHECK-NEXT: rbit r1, r1
89 ; CHECK-NEXT: rbit r2, r0
90 ; CHECK-NEXT: clz r1, r1
91 ; CHECK-NEXT: cmp r0, #0
92 ; CHECK-NEXT: add.w r1, r1, #32
94 ; CHECK-NEXT: clzne r1, r2
95 ; CHECK-NEXT: vmov s0, r1
97 ; CHECK-NEXT: .p2align 2
98 ; CHECK-NEXT: @ %bb.1:
99 ; CHECK-NEXT: .LCPI4_0:
100 ; CHECK-NEXT: .long 0x00000000 @ float 0
102 %0 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %src, i1 1)
106 define arm_aapcs_vfpcc <4 x i32> @cttz_4i32_1_t(<4 x i32> %src){
107 ; CHECK-LABEL: cttz_4i32_1_t:
108 ; CHECK: @ %bb.0: @ %entry
109 ; CHECK-NEXT: movs r0, #32
110 ; CHECK-NEXT: vbrsr.32 q0, q0, r0
111 ; CHECK-NEXT: vclz.i32 q0, q0
114 %0 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %src, i1 1)
118 define arm_aapcs_vfpcc <8 x i16> @cttz_8i16_1_t(<8 x i16> %src){
119 ; CHECK-LABEL: cttz_8i16_1_t:
120 ; CHECK: @ %bb.0: @ %entry
121 ; CHECK-NEXT: movs r0, #16
122 ; CHECK-NEXT: vbrsr.16 q0, q0, r0
123 ; CHECK-NEXT: vclz.i16 q0, q0
126 %0 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %src, i1 1)
130 define arm_aapcs_vfpcc <16 x i8> @cttz_16i8_1_t(<16 x i8> %src) {
131 ; CHECK-LABEL: cttz_16i8_1_t:
132 ; CHECK: @ %bb.0: @ %entry
133 ; CHECK-NEXT: movs r0, #8
134 ; CHECK-NEXT: vbrsr.8 q0, q0, r0
135 ; CHECK-NEXT: vclz.i8 q0, q0
138 %0 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %src, i1 1)
143 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
144 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
145 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
146 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)