Debian Codegraph @

llvm/test/CodeGen/Thumb2/mve-intrinsics/strict-compare.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve.fp -o - %s | FileCheck %s
3
4 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_f16(<8 x half> %a, <8 x half> %b) #0 {
5 ; CHECK-LABEL: test_vcmpeqq_f16:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vcmp.f16 eq, q0, q1
8 ; CHECK-NEXT: vmrs r0, p0
9 ; CHECK-NEXT: bx lr
10 entry:
11 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.eq.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
12 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
13 %2 = trunc nuw i32 %1 to i16
14 ret i16 %2
15 }
16
17 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_f32(<4 x float> %a, <4 x float> %b) #0 {
18 ; CHECK-LABEL: test_vcmpeqq_f32:
19 ; CHECK: @ %bb.0: @ %entry
20 ; CHECK-NEXT: vcmp.f32 eq, q0, q1
21 ; CHECK-NEXT: vmrs r0, p0
22 ; CHECK-NEXT: bx lr
23 entry:
24 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.eq.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
25 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
26 %2 = trunc nuw i32 %1 to i16
27 ret i16 %2
28 }
29
30 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_n_f16(<8 x half> %a, half %b) #0 {
31 ; CHECK-LABEL: test_vcmpeqq_n_f16:
32 ; CHECK: @ %bb.0: @ %entry
33 ; CHECK-NEXT: vmov.f16 r0, s4
34 ; CHECK-NEXT: vcmp.f16 eq, q0, r0
35 ; CHECK-NEXT: vmrs r0, p0
36 ; CHECK-NEXT: bx lr
37 entry:
38 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
39 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
40 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.eq.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
41 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
42 %2 = trunc nuw i32 %1 to i16
43 ret i16 %2
44 }
45
46 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_n_f32(<4 x float> %a, float %b) #0 {
47 ; CHECK-LABEL: test_vcmpeqq_n_f32:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: vmov r0, s4
50 ; CHECK-NEXT: vcmp.f32 eq, q0, r0
51 ; CHECK-NEXT: vmrs r0, p0
52 ; CHECK-NEXT: bx lr
53 entry:
54 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
55 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
56 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.eq.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
57 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
58 %2 = trunc nuw i32 %1 to i16
59 ret i16 %2
60 }
61
62 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
63 ; CHECK-LABEL: test_vcmpeqq_m_f16:
64 ; CHECK: @ %bb.0: @ %entry
65 ; CHECK-NEXT: vmsr p0, r0
66 ; CHECK-NEXT: vpst
67 ; CHECK-NEXT: vcmpt.f16 eq, q0, q1
68 ; CHECK-NEXT: vmrs r0, p0
69 ; CHECK-NEXT: bx lr
70 entry:
71 %0 = zext i16 %p to i32
72 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
73 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.eq.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
74 %3 = and <8 x i1> %1, %2
75 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
76 %5 = trunc nuw i32 %4 to i16
77 ret i16 %5
78 }
79
80 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
81 ; CHECK-LABEL: test_vcmpeqq_m_f32:
82 ; CHECK: @ %bb.0: @ %entry
83 ; CHECK-NEXT: vmsr p0, r0
84 ; CHECK-NEXT: vpst
85 ; CHECK-NEXT: vcmpt.f32 eq, q0, q1
86 ; CHECK-NEXT: vmrs r0, p0
87 ; CHECK-NEXT: bx lr
88 entry:
89 %0 = zext i16 %p to i32
90 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
91 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.eq.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
92 %3 = and <4 x i1> %1, %2
93 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
94 %5 = trunc nuw i32 %4 to i16
95 ret i16 %5
96 }
97
98 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
99 ; CHECK-LABEL: test_vcmpeqq_m_n_f16:
100 ; CHECK: @ %bb.0: @ %entry
101 ; CHECK-NEXT: vmov.f16 r1, s4
102 ; CHECK-NEXT: vmsr p0, r0
103 ; CHECK-NEXT: vpst
104 ; CHECK-NEXT: vcmpt.f16 eq, q0, r1
105 ; CHECK-NEXT: vmrs r0, p0
106 ; CHECK-NEXT: bx lr
107 entry:
108 %0 = zext i16 %p to i32
109 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
110 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
111 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
112 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.eq.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
113 %3 = and <8 x i1> %1, %2
114 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
115 %5 = trunc nuw i32 %4 to i16
116 ret i16 %5
117 }
118
119 define arm_aapcs_vfpcc zeroext i16 @test_vcmpeqq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
120 ; CHECK-LABEL: test_vcmpeqq_m_n_f32:
121 ; CHECK: @ %bb.0: @ %entry
122 ; CHECK-NEXT: vmov r1, s4
123 ; CHECK-NEXT: vmsr p0, r0
124 ; CHECK-NEXT: vpst
125 ; CHECK-NEXT: vcmpt.f32 eq, q0, r1
126 ; CHECK-NEXT: vmrs r0, p0
127 ; CHECK-NEXT: bx lr
128 entry:
129 %0 = zext i16 %p to i32
130 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
131 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
132 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
133 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.eq.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
134 %3 = and <4 x i1> %1, %2
135 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
136 %5 = trunc nuw i32 %4 to i16
137 ret i16 %5
138 }
139
140 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_f16(<8 x half> %a, <8 x half> %b) #0 {
141 ; CHECK-LABEL: test_vcmpneq_f16:
142 ; CHECK: @ %bb.0: @ %entry
143 ; CHECK-NEXT: vcmp.f16 ne, q0, q1
144 ; CHECK-NEXT: vmrs r0, p0
145 ; CHECK-NEXT: bx lr
146 entry:
147 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.ne.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
148 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
149 %2 = trunc nuw i32 %1 to i16
150 ret i16 %2
151 }
152
153 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_f32(<4 x float> %a, <4 x float> %b) #0 {
154 ; CHECK-LABEL: test_vcmpneq_f32:
155 ; CHECK: @ %bb.0: @ %entry
156 ; CHECK-NEXT: vcmp.f32 ne, q0, q1
157 ; CHECK-NEXT: vmrs r0, p0
158 ; CHECK-NEXT: bx lr
159 entry:
160 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.ne.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
161 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
162 %2 = trunc nuw i32 %1 to i16
163 ret i16 %2
164 }
165
166 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_n_f16(<8 x half> %a, half %b) #0 {
167 ; CHECK-LABEL: test_vcmpneq_n_f16:
168 ; CHECK: @ %bb.0: @ %entry
169 ; CHECK-NEXT: vmov.f16 r0, s4
170 ; CHECK-NEXT: vcmp.f16 ne, q0, r0
171 ; CHECK-NEXT: vmrs r0, p0
172 ; CHECK-NEXT: bx lr
173 entry:
174 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
175 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
176 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.ne.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
177 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
178 %2 = trunc nuw i32 %1 to i16
179 ret i16 %2
180 }
181
182 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_n_f32(<4 x float> %a, float %b) #0 {
183 ; CHECK-LABEL: test_vcmpneq_n_f32:
184 ; CHECK: @ %bb.0: @ %entry
185 ; CHECK-NEXT: vmov r0, s4
186 ; CHECK-NEXT: vcmp.f32 ne, q0, r0
187 ; CHECK-NEXT: vmrs r0, p0
188 ; CHECK-NEXT: bx lr
189 entry:
190 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
191 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
192 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.ne.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
193 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
194 %2 = trunc nuw i32 %1 to i16
195 ret i16 %2
196 }
197
198 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
199 ; CHECK-LABEL: test_vcmpneq_m_f16:
200 ; CHECK: @ %bb.0: @ %entry
201 ; CHECK-NEXT: vmsr p0, r0
202 ; CHECK-NEXT: vpst
203 ; CHECK-NEXT: vcmpt.f16 ne, q0, q1
204 ; CHECK-NEXT: vmrs r0, p0
205 ; CHECK-NEXT: bx lr
206 entry:
207 %0 = zext i16 %p to i32
208 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
209 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.ne.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
210 %3 = and <8 x i1> %1, %2
211 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
212 %5 = trunc nuw i32 %4 to i16
213 ret i16 %5
214 }
215
216 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
217 ; CHECK-LABEL: test_vcmpneq_m_f32:
218 ; CHECK: @ %bb.0: @ %entry
219 ; CHECK-NEXT: vmsr p0, r0
220 ; CHECK-NEXT: vpst
221 ; CHECK-NEXT: vcmpt.f32 ne, q0, q1
222 ; CHECK-NEXT: vmrs r0, p0
223 ; CHECK-NEXT: bx lr
224 entry:
225 %0 = zext i16 %p to i32
226 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
227 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.ne.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
228 %3 = and <4 x i1> %1, %2
229 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
230 %5 = trunc nuw i32 %4 to i16
231 ret i16 %5
232 }
233
234 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
235 ; CHECK-LABEL: test_vcmpneq_m_n_f16:
236 ; CHECK: @ %bb.0: @ %entry
237 ; CHECK-NEXT: vmov.f16 r1, s4
238 ; CHECK-NEXT: vmsr p0, r0
239 ; CHECK-NEXT: vpst
240 ; CHECK-NEXT: vcmpt.f16 ne, q0, r1
241 ; CHECK-NEXT: vmrs r0, p0
242 ; CHECK-NEXT: bx lr
243 entry:
244 %0 = zext i16 %p to i32
245 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
246 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
247 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
248 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.ne.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
249 %3 = and <8 x i1> %1, %2
250 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
251 %5 = trunc nuw i32 %4 to i16
252 ret i16 %5
253 }
254
255 define arm_aapcs_vfpcc zeroext i16 @test_vcmpneq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
256 ; CHECK-LABEL: test_vcmpneq_m_n_f32:
257 ; CHECK: @ %bb.0: @ %entry
258 ; CHECK-NEXT: vmov r1, s4
259 ; CHECK-NEXT: vmsr p0, r0
260 ; CHECK-NEXT: vpst
261 ; CHECK-NEXT: vcmpt.f32 ne, q0, r1
262 ; CHECK-NEXT: vmrs r0, p0
263 ; CHECK-NEXT: bx lr
264 entry:
265 %0 = zext i16 %p to i32
266 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
267 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
268 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
269 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.ne.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
270 %3 = and <4 x i1> %1, %2
271 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
272 %5 = trunc nuw i32 %4 to i16
273 ret i16 %5
274 }
275
276 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_f16(<8 x half> %a, <8 x half> %b) #0 {
277 ; CHECK-LABEL: test_vcmpgeq_f16:
278 ; CHECK: @ %bb.0: @ %entry
279 ; CHECK-NEXT: vcmp.f16 ge, q0, q1
280 ; CHECK-NEXT: vmrs r0, p0
281 ; CHECK-NEXT: bx lr
282 entry:
283 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.ge.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
284 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
285 %2 = trunc nuw i32 %1 to i16
286 ret i16 %2
287 }
288
289 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_f32(<4 x float> %a, <4 x float> %b) #0 {
290 ; CHECK-LABEL: test_vcmpgeq_f32:
291 ; CHECK: @ %bb.0: @ %entry
292 ; CHECK-NEXT: vcmp.f32 ge, q0, q1
293 ; CHECK-NEXT: vmrs r0, p0
294 ; CHECK-NEXT: bx lr
295 entry:
296 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.ge.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
297 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
298 %2 = trunc nuw i32 %1 to i16
299 ret i16 %2
300 }
301
302 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_n_f16(<8 x half> %a, half %b) #0 {
303 ; CHECK-LABEL: test_vcmpgeq_n_f16:
304 ; CHECK: @ %bb.0: @ %entry
305 ; CHECK-NEXT: vmov.f16 r0, s4
306 ; CHECK-NEXT: vcmp.f16 ge, q0, r0
307 ; CHECK-NEXT: vmrs r0, p0
308 ; CHECK-NEXT: bx lr
309 entry:
310 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
311 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
312 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.ge.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
313 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
314 %2 = trunc nuw i32 %1 to i16
315 ret i16 %2
316 }
317
318 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_n_f32(<4 x float> %a, float %b) #0 {
319 ; CHECK-LABEL: test_vcmpgeq_n_f32:
320 ; CHECK: @ %bb.0: @ %entry
321 ; CHECK-NEXT: vmov r0, s4
322 ; CHECK-NEXT: vcmp.f32 ge, q0, r0
323 ; CHECK-NEXT: vmrs r0, p0
324 ; CHECK-NEXT: bx lr
325 entry:
326 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
327 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
328 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.ge.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
329 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
330 %2 = trunc nuw i32 %1 to i16
331 ret i16 %2
332 }
333
334 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
335 ; CHECK-LABEL: test_vcmpgeq_m_f16:
336 ; CHECK: @ %bb.0: @ %entry
337 ; CHECK-NEXT: vmsr p0, r0
338 ; CHECK-NEXT: vpst
339 ; CHECK-NEXT: vcmpt.f16 ge, q0, q1
340 ; CHECK-NEXT: vmrs r0, p0
341 ; CHECK-NEXT: bx lr
342 entry:
343 %0 = zext i16 %p to i32
344 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
345 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.ge.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
346 %3 = and <8 x i1> %1, %2
347 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
348 %5 = trunc nuw i32 %4 to i16
349 ret i16 %5
350 }
351
352 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
353 ; CHECK-LABEL: test_vcmpgeq_m_f32:
354 ; CHECK: @ %bb.0: @ %entry
355 ; CHECK-NEXT: vmsr p0, r0
356 ; CHECK-NEXT: vpst
357 ; CHECK-NEXT: vcmpt.f32 ge, q0, q1
358 ; CHECK-NEXT: vmrs r0, p0
359 ; CHECK-NEXT: bx lr
360 entry:
361 %0 = zext i16 %p to i32
362 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
363 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.ge.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
364 %3 = and <4 x i1> %1, %2
365 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
366 %5 = trunc nuw i32 %4 to i16
367 ret i16 %5
368 }
369
370 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
371 ; CHECK-LABEL: test_vcmpgeq_m_n_f16:
372 ; CHECK: @ %bb.0: @ %entry
373 ; CHECK-NEXT: vmov.f16 r1, s4
374 ; CHECK-NEXT: vmsr p0, r0
375 ; CHECK-NEXT: vpst
376 ; CHECK-NEXT: vcmpt.f16 ge, q0, r1
377 ; CHECK-NEXT: vmrs r0, p0
378 ; CHECK-NEXT: bx lr
379 entry:
380 %0 = zext i16 %p to i32
381 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
382 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
383 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
384 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.ge.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
385 %3 = and <8 x i1> %1, %2
386 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
387 %5 = trunc nuw i32 %4 to i16
388 ret i16 %5
389 }
390
391 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgeq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
392 ; CHECK-LABEL: test_vcmpgeq_m_n_f32:
393 ; CHECK: @ %bb.0: @ %entry
394 ; CHECK-NEXT: vmov r1, s4
395 ; CHECK-NEXT: vmsr p0, r0
396 ; CHECK-NEXT: vpst
397 ; CHECK-NEXT: vcmpt.f32 ge, q0, r1
398 ; CHECK-NEXT: vmrs r0, p0
399 ; CHECK-NEXT: bx lr
400 entry:
401 %0 = zext i16 %p to i32
402 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
403 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
404 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
405 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.ge.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
406 %3 = and <4 x i1> %1, %2
407 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
408 %5 = trunc nuw i32 %4 to i16
409 ret i16 %5
410 }
411
412 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_f16(<8 x half> %a, <8 x half> %b) #0 {
413 ; CHECK-LABEL: test_vcmpgtq_f16:
414 ; CHECK: @ %bb.0: @ %entry
415 ; CHECK-NEXT: vcmp.f16 gt, q0, q1
416 ; CHECK-NEXT: vmrs r0, p0
417 ; CHECK-NEXT: bx lr
418 entry:
419 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.gt.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
420 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
421 %2 = trunc nuw i32 %1 to i16
422 ret i16 %2
423 }
424
425 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_f32(<4 x float> %a, <4 x float> %b) #0 {
426 ; CHECK-LABEL: test_vcmpgtq_f32:
427 ; CHECK: @ %bb.0: @ %entry
428 ; CHECK-NEXT: vcmp.f32 gt, q0, q1
429 ; CHECK-NEXT: vmrs r0, p0
430 ; CHECK-NEXT: bx lr
431 entry:
432 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.gt.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
433 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
434 %2 = trunc nuw i32 %1 to i16
435 ret i16 %2
436 }
437
438 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_n_f16(<8 x half> %a, half %b) #0 {
439 ; CHECK-LABEL: test_vcmpgtq_n_f16:
440 ; CHECK: @ %bb.0: @ %entry
441 ; CHECK-NEXT: vmov.f16 r0, s4
442 ; CHECK-NEXT: vcmp.f16 gt, q0, r0
443 ; CHECK-NEXT: vmrs r0, p0
444 ; CHECK-NEXT: bx lr
445 entry:
446 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
447 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
448 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.gt.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
449 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
450 %2 = trunc nuw i32 %1 to i16
451 ret i16 %2
452 }
453
454 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_n_f32(<4 x float> %a, float %b) #0 {
455 ; CHECK-LABEL: test_vcmpgtq_n_f32:
456 ; CHECK: @ %bb.0: @ %entry
457 ; CHECK-NEXT: vmov r0, s4
458 ; CHECK-NEXT: vcmp.f32 gt, q0, r0
459 ; CHECK-NEXT: vmrs r0, p0
460 ; CHECK-NEXT: bx lr
461 entry:
462 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
463 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
464 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.gt.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
465 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
466 %2 = trunc nuw i32 %1 to i16
467 ret i16 %2
468 }
469
470 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
471 ; CHECK-LABEL: test_vcmpgtq_m_f16:
472 ; CHECK: @ %bb.0: @ %entry
473 ; CHECK-NEXT: vmsr p0, r0
474 ; CHECK-NEXT: vpst
475 ; CHECK-NEXT: vcmpt.f16 gt, q0, q1
476 ; CHECK-NEXT: vmrs r0, p0
477 ; CHECK-NEXT: bx lr
478 entry:
479 %0 = zext i16 %p to i32
480 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
481 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.gt.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
482 %3 = and <8 x i1> %1, %2
483 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
484 %5 = trunc nuw i32 %4 to i16
485 ret i16 %5
486 }
487
488 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
489 ; CHECK-LABEL: test_vcmpgtq_m_f32:
490 ; CHECK: @ %bb.0: @ %entry
491 ; CHECK-NEXT: vmsr p0, r0
492 ; CHECK-NEXT: vpst
493 ; CHECK-NEXT: vcmpt.f32 gt, q0, q1
494 ; CHECK-NEXT: vmrs r0, p0
495 ; CHECK-NEXT: bx lr
496 entry:
497 %0 = zext i16 %p to i32
498 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
499 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.gt.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
500 %3 = and <4 x i1> %1, %2
501 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
502 %5 = trunc nuw i32 %4 to i16
503 ret i16 %5
504 }
505
506 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
507 ; CHECK-LABEL: test_vcmpgtq_m_n_f16:
508 ; CHECK: @ %bb.0: @ %entry
509 ; CHECK-NEXT: vmov.f16 r1, s4
510 ; CHECK-NEXT: vmsr p0, r0
511 ; CHECK-NEXT: vpst
512 ; CHECK-NEXT: vcmpt.f16 gt, q0, r1
513 ; CHECK-NEXT: vmrs r0, p0
514 ; CHECK-NEXT: bx lr
515 entry:
516 %0 = zext i16 %p to i32
517 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
518 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
519 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
520 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.gt.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
521 %3 = and <8 x i1> %1, %2
522 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
523 %5 = trunc nuw i32 %4 to i16
524 ret i16 %5
525 }
526
527 define arm_aapcs_vfpcc zeroext i16 @test_vcmpgtq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
528 ; CHECK-LABEL: test_vcmpgtq_m_n_f32:
529 ; CHECK: @ %bb.0: @ %entry
530 ; CHECK-NEXT: vmov r1, s4
531 ; CHECK-NEXT: vmsr p0, r0
532 ; CHECK-NEXT: vpst
533 ; CHECK-NEXT: vcmpt.f32 gt, q0, r1
534 ; CHECK-NEXT: vmrs r0, p0
535 ; CHECK-NEXT: bx lr
536 entry:
537 %0 = zext i16 %p to i32
538 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
539 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
540 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
541 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.gt.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
542 %3 = and <4 x i1> %1, %2
543 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
544 %5 = trunc nuw i32 %4 to i16
545 ret i16 %5
546 }
547
548 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_f16(<8 x half> %a, <8 x half> %b) #0 {
549 ; CHECK-LABEL: test_vcmpleq_f16:
550 ; CHECK: @ %bb.0: @ %entry
551 ; CHECK-NEXT: vcmp.f16 le, q0, q1
552 ; CHECK-NEXT: vmrs r0, p0
553 ; CHECK-NEXT: bx lr
554 entry:
555 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.le.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
556 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
557 %2 = trunc nuw i32 %1 to i16
558 ret i16 %2
559 }
560
561 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_f32(<4 x float> %a, <4 x float> %b) #0 {
562 ; CHECK-LABEL: test_vcmpleq_f32:
563 ; CHECK: @ %bb.0: @ %entry
564 ; CHECK-NEXT: vcmp.f32 le, q0, q1
565 ; CHECK-NEXT: vmrs r0, p0
566 ; CHECK-NEXT: bx lr
567 entry:
568 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.le.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
569 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
570 %2 = trunc nuw i32 %1 to i16
571 ret i16 %2
572 }
573
574 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_n_f16(<8 x half> %a, half %b) #0 {
575 ; CHECK-LABEL: test_vcmpleq_n_f16:
576 ; CHECK: @ %bb.0: @ %entry
577 ; CHECK-NEXT: vmov.f16 r0, s4
578 ; CHECK-NEXT: vcmp.f16 le, q0, r0
579 ; CHECK-NEXT: vmrs r0, p0
580 ; CHECK-NEXT: bx lr
581 entry:
582 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
583 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
584 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.le.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
585 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
586 %2 = trunc nuw i32 %1 to i16
587 ret i16 %2
588 }
589
590 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_n_f32(<4 x float> %a, float %b) #0 {
591 ; CHECK-LABEL: test_vcmpleq_n_f32:
592 ; CHECK: @ %bb.0: @ %entry
593 ; CHECK-NEXT: vmov r0, s4
594 ; CHECK-NEXT: vcmp.f32 le, q0, r0
595 ; CHECK-NEXT: vmrs r0, p0
596 ; CHECK-NEXT: bx lr
597 entry:
598 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
599 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
600 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.le.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
601 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
602 %2 = trunc nuw i32 %1 to i16
603 ret i16 %2
604 }
605
606 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
607 ; CHECK-LABEL: test_vcmpleq_m_f16:
608 ; CHECK: @ %bb.0: @ %entry
609 ; CHECK-NEXT: vmsr p0, r0
610 ; CHECK-NEXT: vpst
611 ; CHECK-NEXT: vcmpt.f16 le, q0, q1
612 ; CHECK-NEXT: vmrs r0, p0
613 ; CHECK-NEXT: bx lr
614 entry:
615 %0 = zext i16 %p to i32
616 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
617 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.le.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
618 %3 = and <8 x i1> %1, %2
619 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
620 %5 = trunc nuw i32 %4 to i16
621 ret i16 %5
622 }
623
624 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
625 ; CHECK-LABEL: test_vcmpleq_m_f32:
626 ; CHECK: @ %bb.0: @ %entry
627 ; CHECK-NEXT: vmsr p0, r0
628 ; CHECK-NEXT: vpst
629 ; CHECK-NEXT: vcmpt.f32 le, q0, q1
630 ; CHECK-NEXT: vmrs r0, p0
631 ; CHECK-NEXT: bx lr
632 entry:
633 %0 = zext i16 %p to i32
634 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
635 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.le.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
636 %3 = and <4 x i1> %1, %2
637 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
638 %5 = trunc nuw i32 %4 to i16
639 ret i16 %5
640 }
641
642 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
643 ; CHECK-LABEL: test_vcmpleq_m_n_f16:
644 ; CHECK: @ %bb.0: @ %entry
645 ; CHECK-NEXT: vmov.f16 r1, s4
646 ; CHECK-NEXT: vmsr p0, r0
647 ; CHECK-NEXT: vpst
648 ; CHECK-NEXT: vcmpt.f16 le, q0, r1
649 ; CHECK-NEXT: vmrs r0, p0
650 ; CHECK-NEXT: bx lr
651 entry:
652 %0 = zext i16 %p to i32
653 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
654 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
655 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
656 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.le.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
657 %3 = and <8 x i1> %1, %2
658 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
659 %5 = trunc nuw i32 %4 to i16
660 ret i16 %5
661 }
662
663 define arm_aapcs_vfpcc zeroext i16 @test_vcmpleq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
664 ; CHECK-LABEL: test_vcmpleq_m_n_f32:
665 ; CHECK: @ %bb.0: @ %entry
666 ; CHECK-NEXT: vmov r1, s4
667 ; CHECK-NEXT: vmsr p0, r0
668 ; CHECK-NEXT: vpst
669 ; CHECK-NEXT: vcmpt.f32 le, q0, r1
670 ; CHECK-NEXT: vmrs r0, p0
671 ; CHECK-NEXT: bx lr
672 entry:
673 %0 = zext i16 %p to i32
674 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
675 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
676 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
677 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.le.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
678 %3 = and <4 x i1> %1, %2
679 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
680 %5 = trunc nuw i32 %4 to i16
681 ret i16 %5
682 }
683
684 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_f16(<8 x half> %a, <8 x half> %b) #0 {
685 ; CHECK-LABEL: test_vcmpltq_f16:
686 ; CHECK: @ %bb.0: @ %entry
687 ; CHECK-NEXT: vcmp.f16 lt, q0, q1
688 ; CHECK-NEXT: vmrs r0, p0
689 ; CHECK-NEXT: bx lr
690 entry:
691 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.lt.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
692 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
693 %2 = trunc nuw i32 %1 to i16
694 ret i16 %2
695 }
696
697 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_f32(<4 x float> %a, <4 x float> %b) #0 {
698 ; CHECK-LABEL: test_vcmpltq_f32:
699 ; CHECK: @ %bb.0: @ %entry
700 ; CHECK-NEXT: vcmp.f32 lt, q0, q1
701 ; CHECK-NEXT: vmrs r0, p0
702 ; CHECK-NEXT: bx lr
703 entry:
704 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.lt.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
705 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
706 %2 = trunc nuw i32 %1 to i16
707 ret i16 %2
708 }
709
710 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_n_f16(<8 x half> %a, half %b) #0 {
711 ; CHECK-LABEL: test_vcmpltq_n_f16:
712 ; CHECK: @ %bb.0: @ %entry
713 ; CHECK-NEXT: vmov.f16 r0, s4
714 ; CHECK-NEXT: vcmp.f16 lt, q0, r0
715 ; CHECK-NEXT: vmrs r0, p0
716 ; CHECK-NEXT: bx lr
717 entry:
718 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
719 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
720 %0 = tail call <8 x i1> @llvm.arm.mve.cmp.lt.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
721 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %0) #2
722 %2 = trunc nuw i32 %1 to i16
723 ret i16 %2
724 }
725
726 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_n_f32(<4 x float> %a, float %b) #0 {
727 ; CHECK-LABEL: test_vcmpltq_n_f32:
728 ; CHECK: @ %bb.0: @ %entry
729 ; CHECK-NEXT: vmov r0, s4
730 ; CHECK-NEXT: vcmp.f32 lt, q0, r0
731 ; CHECK-NEXT: vmrs r0, p0
732 ; CHECK-NEXT: bx lr
733 entry:
734 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
735 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
736 %0 = tail call <4 x i1> @llvm.arm.mve.cmp.lt.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
737 %1 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %0) #2
738 %2 = trunc nuw i32 %1 to i16
739 ret i16 %2
740 }
741
742 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_m_f16(<8 x half> %a, <8 x half> %b, i16 zeroext %p) #0 {
743 ; CHECK-LABEL: test_vcmpltq_m_f16:
744 ; CHECK: @ %bb.0: @ %entry
745 ; CHECK-NEXT: vmsr p0, r0
746 ; CHECK-NEXT: vpst
747 ; CHECK-NEXT: vcmpt.f16 lt, q0, q1
748 ; CHECK-NEXT: vmrs r0, p0
749 ; CHECK-NEXT: bx lr
750 entry:
751 %0 = zext i16 %p to i32
752 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
753 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.lt.v8i1.v8f16(<8 x half> %a, <8 x half> %b) #2
754 %3 = and <8 x i1> %1, %2
755 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
756 %5 = trunc nuw i32 %4 to i16
757 ret i16 %5
758 }
759
760 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_m_f32(<4 x float> %a, <4 x float> %b, i16 zeroext %p) #0 {
761 ; CHECK-LABEL: test_vcmpltq_m_f32:
762 ; CHECK: @ %bb.0: @ %entry
763 ; CHECK-NEXT: vmsr p0, r0
764 ; CHECK-NEXT: vpst
765 ; CHECK-NEXT: vcmpt.f32 lt, q0, q1
766 ; CHECK-NEXT: vmrs r0, p0
767 ; CHECK-NEXT: bx lr
768 entry:
769 %0 = zext i16 %p to i32
770 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
771 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.lt.v4i1.v4f32(<4 x float> %a, <4 x float> %b) #2
772 %3 = and <4 x i1> %1, %2
773 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
774 %5 = trunc nuw i32 %4 to i16
775 ret i16 %5
776 }
777
778 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_m_n_f16(<8 x half> %a, half %b, i16 zeroext %p) #0 {
779 ; CHECK-LABEL: test_vcmpltq_m_n_f16:
780 ; CHECK: @ %bb.0: @ %entry
781 ; CHECK-NEXT: vmov.f16 r1, s4
782 ; CHECK-NEXT: vmsr p0, r0
783 ; CHECK-NEXT: vpst
784 ; CHECK-NEXT: vcmpt.f16 lt, q0, r1
785 ; CHECK-NEXT: vmrs r0, p0
786 ; CHECK-NEXT: bx lr
787 entry:
788 %0 = zext i16 %p to i32
789 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0) #2
790 %.splatinsert = insertelement <8 x half> poison, half %b, i64 0
791 %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
792 %2 = tail call <8 x i1> @llvm.arm.mve.cmp.lt.v8i1.v8f16(<8 x half> %a, <8 x half> %.splat) #2
793 %3 = and <8 x i1> %1, %2
794 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> %3) #2
795 %5 = trunc nuw i32 %4 to i16
796 ret i16 %5
797 }
798
799 define arm_aapcs_vfpcc zeroext i16 @test_vcmpltq_m_n_f32(<4 x float> %a, float %b, i16 zeroext %p) #0 {
800 ; CHECK-LABEL: test_vcmpltq_m_n_f32:
801 ; CHECK: @ %bb.0: @ %entry
802 ; CHECK-NEXT: vmov r1, s4
803 ; CHECK-NEXT: vmsr p0, r0
804 ; CHECK-NEXT: vpst
805 ; CHECK-NEXT: vcmpt.f32 lt, q0, r1
806 ; CHECK-NEXT: vmrs r0, p0
807 ; CHECK-NEXT: bx lr
808 entry:
809 %0 = zext i16 %p to i32
810 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0) #2
811 %.splatinsert = insertelement <4 x float> poison, float %b, i64 0
812 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
813 %2 = tail call <4 x i1> @llvm.arm.mve.cmp.lt.v4i1.v4f32(<4 x float> %a, <4 x float> %.splat) #2
814 %3 = and <4 x i1> %1, %2
815 %4 = tail call range(i32 0, 65536) i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> %3) #2
816 %5 = trunc nuw i32 %4 to i16
817 ret i16 %5
818 }
819
820 attributes #0 = { strictfp }