1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon -mattr=+hvxv69,+hvx-length128b,+hvx-qfloat < %s | FileCheck %s
3 ; RUN: llc -march=hexagon -mattr=+hvxv69,+hvx-length128b,+hvx-ieee-fp < %s | FileCheck %s
7 define <64 x half> @test_00(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
8 ; CHECK-LABEL: test_00:
11 ; CHECK-NEXT: q0 = vcmp.eq(v0.h,v1.h)
14 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
15 ; CHECK-NEXT: jumpr r31
17 %t0 = fcmp oeq <64 x half> %v0, %v1
18 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
22 define <64 x half> @test_01(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
23 ; CHECK-LABEL: test_01:
26 ; CHECK-NEXT: q0 = vcmp.eq(v0.h,v1.h)
29 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
30 ; CHECK-NEXT: jumpr r31
32 %t0 = fcmp one <64 x half> %v0, %v1
33 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
37 define <64 x half> @test_02(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
38 ; CHECK-LABEL: test_02:
41 ; CHECK-NEXT: q0 = vcmp.gt(v1.hf,v0.hf)
44 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
45 ; CHECK-NEXT: jumpr r31
47 %t0 = fcmp olt <64 x half> %v0, %v1
48 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
52 define <64 x half> @test_03(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
53 ; CHECK-LABEL: test_03:
56 ; CHECK-NEXT: q0 = vcmp.gt(v0.hf,v1.hf)
59 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
60 ; CHECK-NEXT: jumpr r31
62 %t0 = fcmp ole <64 x half> %v0, %v1
63 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
67 define <64 x half> @test_04(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
68 ; CHECK-LABEL: test_04:
71 ; CHECK-NEXT: q0 = vcmp.gt(v0.hf,v1.hf)
74 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
75 ; CHECK-NEXT: jumpr r31
77 %t0 = fcmp ogt <64 x half> %v0, %v1
78 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
82 define <64 x half> @test_05(<64 x half> %v0, <64 x half> %v1, <64 x half> %v2) #0 {
83 ; CHECK-LABEL: test_05:
86 ; CHECK-NEXT: q0 = vcmp.gt(v1.hf,v0.hf)
89 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
90 ; CHECK-NEXT: jumpr r31
92 %t0 = fcmp oge <64 x half> %v0, %v1
93 %t1 = select <64 x i1> %t0, <64 x half> %v1, <64 x half> %v2
97 define <64 x half> @test_0a(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
98 ; CHECK-LABEL: test_0a:
101 ; CHECK-NEXT: r0 = ##16843009
104 ; CHECK-NEXT: q0 = vand(v2,r0)
107 ; CHECK-NEXT: q0 &= vcmp.eq(v0.h,v1.h)
110 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
111 ; CHECK-NEXT: jumpr r31
113 %q0 = fcmp oeq <64 x half> %v0, %v1
114 %q1 = trunc <64 x i16> %v2 to <64 x i1>
115 %q2 = and <64 x i1> %q0, %q1
116 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
120 define <64 x half> @test_0b(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
121 ; CHECK-LABEL: test_0b:
124 ; CHECK-NEXT: r0 = ##16843009
127 ; CHECK-NEXT: q0 = vand(v2,r0)
130 ; CHECK-NEXT: q0 |= vcmp.eq(v0.h,v1.h)
133 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
134 ; CHECK-NEXT: jumpr r31
136 %q0 = fcmp oeq <64 x half> %v0, %v1
137 %q1 = trunc <64 x i16> %v2 to <64 x i1>
138 %q2 = or <64 x i1> %q0, %q1
139 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
143 define <64 x half> @test_0c(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
144 ; CHECK-LABEL: test_0c:
147 ; CHECK-NEXT: r0 = ##16843009
150 ; CHECK-NEXT: q0 = vand(v2,r0)
153 ; CHECK-NEXT: q0 ^= vcmp.eq(v0.h,v1.h)
156 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
157 ; CHECK-NEXT: jumpr r31
159 %q0 = fcmp oeq <64 x half> %v0, %v1
160 %q1 = trunc <64 x i16> %v2 to <64 x i1>
161 %q2 = xor <64 x i1> %q0, %q1
162 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
166 define <64 x half> @test_0d(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
167 ; CHECK-LABEL: test_0d:
170 ; CHECK-NEXT: r0 = ##16843009
173 ; CHECK-NEXT: q0 = vand(v2,r0)
176 ; CHECK-NEXT: q0 &= vcmp.gt(v0.hf,v1.hf)
179 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
180 ; CHECK-NEXT: jumpr r31
182 %q0 = fcmp ogt <64 x half> %v0, %v1
183 %q1 = trunc <64 x i16> %v2 to <64 x i1>
184 %q2 = and <64 x i1> %q0, %q1
185 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
189 define <64 x half> @test_0e(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
190 ; CHECK-LABEL: test_0e:
193 ; CHECK-NEXT: r0 = ##16843009
196 ; CHECK-NEXT: q0 = vand(v2,r0)
199 ; CHECK-NEXT: q0 |= vcmp.gt(v0.hf,v1.hf)
202 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
203 ; CHECK-NEXT: jumpr r31
205 %q0 = fcmp ogt <64 x half> %v0, %v1
206 %q1 = trunc <64 x i16> %v2 to <64 x i1>
207 %q2 = or <64 x i1> %q0, %q1
208 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
212 define <64 x half> @test_0f(<64 x half> %v0, <64 x half> %v1, <64 x i16> %v2) #0 {
213 ; CHECK-LABEL: test_0f:
216 ; CHECK-NEXT: r0 = ##16843009
219 ; CHECK-NEXT: q0 = vand(v2,r0)
222 ; CHECK-NEXT: q0 ^= vcmp.gt(v0.hf,v1.hf)
225 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
226 ; CHECK-NEXT: jumpr r31
228 %q0 = fcmp ogt <64 x half> %v0, %v1
229 %q1 = trunc <64 x i16> %v2 to <64 x i1>
230 %q2 = xor <64 x i1> %q0, %q1
231 %t1 = select <64 x i1> %q2, <64 x half> %v0, <64 x half> %v1
238 define <32 x float> @test_10(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
239 ; CHECK-LABEL: test_10:
242 ; CHECK-NEXT: q0 = vcmp.eq(v0.w,v1.w)
245 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
246 ; CHECK-NEXT: jumpr r31
248 %t0 = fcmp oeq <32 x float> %v0, %v1
249 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
253 define <32 x float> @test_11(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
254 ; CHECK-LABEL: test_11:
257 ; CHECK-NEXT: q0 = vcmp.eq(v0.w,v1.w)
260 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
261 ; CHECK-NEXT: jumpr r31
263 %t0 = fcmp one <32 x float> %v0, %v1
264 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
268 define <32 x float> @test_12(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
269 ; CHECK-LABEL: test_12:
272 ; CHECK-NEXT: q0 = vcmp.gt(v1.sf,v0.sf)
275 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
276 ; CHECK-NEXT: jumpr r31
278 %t0 = fcmp olt <32 x float> %v0, %v1
279 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
283 define <32 x float> @test_13(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
284 ; CHECK-LABEL: test_13:
287 ; CHECK-NEXT: q0 = vcmp.gt(v0.sf,v1.sf)
290 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
291 ; CHECK-NEXT: jumpr r31
293 %t0 = fcmp ole <32 x float> %v0, %v1
294 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
298 define <32 x float> @test_14(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
299 ; CHECK-LABEL: test_14:
302 ; CHECK-NEXT: q0 = vcmp.gt(v0.sf,v1.sf)
305 ; CHECK-NEXT: v0 = vmux(q0,v1,v2)
306 ; CHECK-NEXT: jumpr r31
308 %t0 = fcmp ogt <32 x float> %v0, %v1
309 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
313 define <32 x float> @test_15(<32 x float> %v0, <32 x float> %v1, <32 x float> %v2) #0 {
314 ; CHECK-LABEL: test_15:
317 ; CHECK-NEXT: q0 = vcmp.gt(v1.sf,v0.sf)
320 ; CHECK-NEXT: v0 = vmux(q0,v2,v1)
321 ; CHECK-NEXT: jumpr r31
323 %t0 = fcmp oge <32 x float> %v0, %v1
324 %t1 = select <32 x i1> %t0, <32 x float> %v1, <32 x float> %v2
328 define <32 x float> @test_1a(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
329 ; CHECK-LABEL: test_1a:
332 ; CHECK-NEXT: r0 = ##16843009
335 ; CHECK-NEXT: q0 = vand(v2,r0)
338 ; CHECK-NEXT: q0 &= vcmp.eq(v0.w,v1.w)
341 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
342 ; CHECK-NEXT: jumpr r31
344 %q0 = fcmp oeq <32 x float> %v0, %v1
345 %q1 = trunc <32 x i32> %v2 to <32 x i1>
346 %q2 = and <32 x i1> %q0, %q1
347 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
351 define <32 x float> @test_1b(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
352 ; CHECK-LABEL: test_1b:
355 ; CHECK-NEXT: r0 = ##16843009
358 ; CHECK-NEXT: q0 = vand(v2,r0)
361 ; CHECK-NEXT: q0 |= vcmp.eq(v0.w,v1.w)
364 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
365 ; CHECK-NEXT: jumpr r31
367 %q0 = fcmp oeq <32 x float> %v0, %v1
368 %q1 = trunc <32 x i32> %v2 to <32 x i1>
369 %q2 = or <32 x i1> %q0, %q1
370 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
374 define <32 x float> @test_1c(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
375 ; CHECK-LABEL: test_1c:
378 ; CHECK-NEXT: r0 = ##16843009
381 ; CHECK-NEXT: q0 = vand(v2,r0)
384 ; CHECK-NEXT: q0 ^= vcmp.eq(v0.w,v1.w)
387 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
388 ; CHECK-NEXT: jumpr r31
390 %q0 = fcmp oeq <32 x float> %v0, %v1
391 %q1 = trunc <32 x i32> %v2 to <32 x i1>
392 %q2 = xor <32 x i1> %q0, %q1
393 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
397 define <32 x float> @test_1d(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
398 ; CHECK-LABEL: test_1d:
401 ; CHECK-NEXT: r0 = ##16843009
404 ; CHECK-NEXT: q0 = vand(v2,r0)
407 ; CHECK-NEXT: q0 &= vcmp.gt(v0.sf,v1.sf)
410 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
411 ; CHECK-NEXT: jumpr r31
413 %q0 = fcmp ogt <32 x float> %v0, %v1
414 %q1 = trunc <32 x i32> %v2 to <32 x i1>
415 %q2 = and <32 x i1> %q0, %q1
416 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
420 define <32 x float> @test_1e(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
421 ; CHECK-LABEL: test_1e:
424 ; CHECK-NEXT: r0 = ##16843009
427 ; CHECK-NEXT: q0 = vand(v2,r0)
430 ; CHECK-NEXT: q0 |= vcmp.gt(v0.sf,v1.sf)
433 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
434 ; CHECK-NEXT: jumpr r31
436 %q0 = fcmp ogt <32 x float> %v0, %v1
437 %q1 = trunc <32 x i32> %v2 to <32 x i1>
438 %q2 = or <32 x i1> %q0, %q1
439 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
443 define <32 x float> @test_1f(<32 x float> %v0, <32 x float> %v1, <32 x i32> %v2) #0 {
444 ; CHECK-LABEL: test_1f:
447 ; CHECK-NEXT: r0 = ##16843009
450 ; CHECK-NEXT: q0 = vand(v2,r0)
453 ; CHECK-NEXT: q0 ^= vcmp.gt(v0.sf,v1.sf)
456 ; CHECK-NEXT: v0 = vmux(q0,v0,v1)
457 ; CHECK-NEXT: jumpr r31
459 %q0 = fcmp ogt <32 x float> %v0, %v1
460 %q1 = trunc <32 x i32> %v2 to <32 x i1>
461 %q2 = xor <32 x i1> %q0, %q1
462 %t1 = select <32 x i1> %q2, <32 x float> %v0, <32 x float> %v1
466 attributes #0 = { nounwind readnone "target-cpu"="hexagonv69" }