1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-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, s2
8 ; CHECK-NEXT: cmp r0, #0
9 ; CHECK-NEXT: rbit r0, r0
10 ; CHECK-NEXT: cset r1, ne
11 ; CHECK-NEXT: lsls r1, r1, #31
12 ; CHECK-NEXT: vmov r1, s3
13 ; CHECK-NEXT: rbit r1, r1
14 ; CHECK-NEXT: clz r1, r1
15 ; CHECK-NEXT: add.w r1, r1, #32
17 ; CHECK-NEXT: clzne r1, r0
18 ; CHECK-NEXT: vmov r0, s0
19 ; CHECK-NEXT: vmov s6, r1
20 ; CHECK-NEXT: cmp r0, #0
21 ; CHECK-NEXT: rbit r0, r0
22 ; CHECK-NEXT: cset r1, ne
23 ; CHECK-NEXT: lsls r1, r1, #31
24 ; CHECK-NEXT: vmov r1, s1
25 ; CHECK-NEXT: rbit r1, r1
26 ; CHECK-NEXT: clz r1, r1
27 ; CHECK-NEXT: add.w r1, r1, #32
29 ; CHECK-NEXT: clzne r1, r0
30 ; CHECK-NEXT: vmov s4, r1
31 ; CHECK-NEXT: vldr s5, .LCPI0_0
32 ; CHECK-NEXT: vmov.f32 s7, s5
33 ; CHECK-NEXT: vmov q0, q1
35 ; CHECK-NEXT: .p2align 2
36 ; CHECK-NEXT: @ %bb.1:
37 ; CHECK-NEXT: .LCPI0_0:
38 ; CHECK-NEXT: .long 0 @ float 0
40 %0 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %src, i1 0)
44 define arm_aapcs_vfpcc <4 x i32> @cttz_4i32_0_t(<4 x i32> %src){
45 ; CHECK-LABEL: cttz_4i32_0_t:
46 ; CHECK: @ %bb.0: @ %entry
47 ; CHECK-NEXT: movs r0, #32
48 ; CHECK-NEXT: vbrsr.32 q0, q0, r0
49 ; CHECK-NEXT: vclz.i32 q0, q0
52 %0 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %src, i1 0)
56 define arm_aapcs_vfpcc <8 x i16> @cttz_8i16_0_t(<8 x i16> %src){
57 ; CHECK-LABEL: cttz_8i16_0_t:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: movs r0, #16
60 ; CHECK-NEXT: vbrsr.16 q0, q0, r0
61 ; CHECK-NEXT: vclz.i16 q0, q0
64 %0 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %src, i1 0)
68 define arm_aapcs_vfpcc <16 x i8> @cttz_16i8_0_t(<16 x i8> %src) {
69 ; CHECK-LABEL: cttz_16i8_0_t:
70 ; CHECK: @ %bb.0: @ %entry
71 ; CHECK-NEXT: movs r0, #8
72 ; CHECK-NEXT: vbrsr.8 q0, q0, r0
73 ; CHECK-NEXT: vclz.i8 q0, q0
76 %0 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %src, i1 0)
80 define arm_aapcs_vfpcc <2 x i64> @cttz_2i64_1_t(<2 x i64> %src){
81 ; CHECK-LABEL: cttz_2i64_1_t:
82 ; CHECK: @ %bb.0: @ %entry
83 ; CHECK-NEXT: vmov r0, s2
84 ; CHECK-NEXT: cmp r0, #0
85 ; CHECK-NEXT: rbit r0, r0
86 ; CHECK-NEXT: cset r1, ne
87 ; CHECK-NEXT: lsls r1, r1, #31
88 ; CHECK-NEXT: vmov r1, s3
89 ; CHECK-NEXT: rbit r1, r1
90 ; CHECK-NEXT: clz r1, r1
91 ; CHECK-NEXT: add.w r1, r1, #32
93 ; CHECK-NEXT: clzne r1, r0
94 ; CHECK-NEXT: vmov r0, s0
95 ; CHECK-NEXT: vmov s6, r1
96 ; CHECK-NEXT: cmp r0, #0
97 ; CHECK-NEXT: rbit r0, r0
98 ; CHECK-NEXT: cset r1, ne
99 ; CHECK-NEXT: lsls r1, r1, #31
100 ; CHECK-NEXT: vmov r1, s1
101 ; CHECK-NEXT: rbit r1, r1
102 ; CHECK-NEXT: clz r1, r1
103 ; CHECK-NEXT: add.w r1, r1, #32
105 ; CHECK-NEXT: clzne r1, r0
106 ; CHECK-NEXT: vmov s4, r1
107 ; CHECK-NEXT: vldr s5, .LCPI4_0
108 ; CHECK-NEXT: vmov.f32 s7, s5
109 ; CHECK-NEXT: vmov q0, q1
111 ; CHECK-NEXT: .p2align 2
112 ; CHECK-NEXT: @ %bb.1:
113 ; CHECK-NEXT: .LCPI4_0:
114 ; CHECK-NEXT: .long 0 @ float 0
116 %0 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %src, i1 1)
120 define arm_aapcs_vfpcc <4 x i32> @cttz_4i32_1_t(<4 x i32> %src){
121 ; CHECK-LABEL: cttz_4i32_1_t:
122 ; CHECK: @ %bb.0: @ %entry
123 ; CHECK-NEXT: movs r0, #32
124 ; CHECK-NEXT: vbrsr.32 q0, q0, r0
125 ; CHECK-NEXT: vclz.i32 q0, q0
128 %0 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %src, i1 1)
132 define arm_aapcs_vfpcc <8 x i16> @cttz_8i16_1_t(<8 x i16> %src){
133 ; CHECK-LABEL: cttz_8i16_1_t:
134 ; CHECK: @ %bb.0: @ %entry
135 ; CHECK-NEXT: movs r0, #16
136 ; CHECK-NEXT: vbrsr.16 q0, q0, r0
137 ; CHECK-NEXT: vclz.i16 q0, q0
140 %0 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %src, i1 1)
144 define arm_aapcs_vfpcc <16 x i8> @cttz_16i8_1_t(<16 x i8> %src) {
145 ; CHECK-LABEL: cttz_16i8_1_t:
146 ; CHECK: @ %bb.0: @ %entry
147 ; CHECK-NEXT: movs r0, #8
148 ; CHECK-NEXT: vbrsr.8 q0, q0, r0
149 ; CHECK-NEXT: vclz.i8 q0, q0
152 %0 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %src, i1 1)
157 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
158 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
159 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
160 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)