1 ; RUN: llc -march=hexagon < %s | FileCheck %s
5 ; CHECK-LABEL: test_00:
6 ; CHECK: q[[Q000:[0-3]]] = vcmp.eq(v0.b,v1.b)
7 ; CHECK: v0 = vmux(q[[Q000]],v1,v2)
8 define <128 x i8> @test_00(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
9 %t0 = icmp eq <128 x i8> %v0, %v1
10 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
14 ; CHECK-LABEL: test_01:
15 ; CHECK: q[[Q010:[0-3]]] = vcmp.eq(v0.b,v1.b)
16 ; CHECK: v0 = vmux(q[[Q010]],v2,v1)
17 define <128 x i8> @test_01(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
18 %t0 = icmp ne <128 x i8> %v0, %v1
19 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
23 ; CHECK-LABEL: test_02:
24 ; CHECK: q[[Q020:[0-3]]] = vcmp.gt(v1.b,v0.b)
25 ; CHECK: v0 = vmux(q[[Q020]],v1,v2)
26 define <128 x i8> @test_02(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
27 %t0 = icmp slt <128 x i8> %v0, %v1
28 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
32 ; CHECK-LABEL: test_03:
33 ; CHECK: q[[Q030:[0-3]]] = vcmp.gt(v0.b,v1.b)
34 ; CHECK: v0 = vmux(q[[Q030]],v2,v1)
35 define <128 x i8> @test_03(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
36 %t0 = icmp sle <128 x i8> %v0, %v1
37 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
41 ; CHECK-LABEL: test_04:
42 ; CHECK: q[[Q040:[0-3]]] = vcmp.gt(v0.b,v1.b)
43 ; CHECK: v0 = vmux(q[[Q040]],v1,v2)
44 define <128 x i8> @test_04(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
45 %t0 = icmp sgt <128 x i8> %v0, %v1
46 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
50 ; CHECK-LABEL: test_05:
51 ; CHECK: q[[Q050:[0-3]]] = vcmp.gt(v1.b,v0.b)
52 ; CHECK: v0 = vmux(q[[Q050]],v2,v1)
53 define <128 x i8> @test_05(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
54 %t0 = icmp sge <128 x i8> %v0, %v1
55 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
59 ; CHECK-LABEL: test_06:
60 ; CHECK: q[[Q060:[0-3]]] = vcmp.gt(v1.ub,v0.ub)
61 ; CHECK: v0 = vmux(q[[Q060]],v1,v2)
62 define <128 x i8> @test_06(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
63 %t0 = icmp ult <128 x i8> %v0, %v1
64 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
68 ; CHECK-LABEL: test_07:
69 ; CHECK: q[[Q070:[0-3]]] = vcmp.gt(v0.ub,v1.ub)
70 ; CHECK: v0 = vmux(q[[Q070]],v2,v1)
71 define <128 x i8> @test_07(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
72 %t0 = icmp ule <128 x i8> %v0, %v1
73 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
77 ; CHECK-LABEL: test_08:
78 ; CHECK: q[[Q080:[0-3]]] = vcmp.gt(v0.ub,v1.ub)
79 ; CHECK: v0 = vmux(q[[Q080]],v1,v2)
80 define <128 x i8> @test_08(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
81 %t0 = icmp ugt <128 x i8> %v0, %v1
82 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
86 ; CHECK-LABEL: test_09:
87 ; CHECK: q[[Q090:[0-3]]] = vcmp.gt(v1.ub,v0.ub)
88 ; CHECK: v0 = vmux(q[[Q090]],v2,v1)
89 define <128 x i8> @test_09(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
90 %t0 = icmp uge <128 x i8> %v0, %v1
91 %t1 = select <128 x i1> %t0, <128 x i8> %v1, <128 x i8> %v2
95 ; CHECK-LABEL: test_0a:
96 ; CHECK: q[[Q0A0:[0-3]]] &= vcmp.eq(v0.b,v1.b)
97 ; CHECK: v0 = vmux(q[[Q0A0]],v0,v1)
98 define <128 x i8> @test_0a(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
99 %q0 = icmp eq <128 x i8> %v0, %v1
100 %q1 = trunc <128 x i8> %v2 to <128 x i1>
101 %q2 = and <128 x i1> %q0, %q1
102 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
106 ; CHECK-LABEL: test_0b:
107 ; CHECK: q[[Q0B0:[0-3]]] |= vcmp.eq(v0.b,v1.b)
108 ; CHECK: v0 = vmux(q[[Q0B0]],v0,v1)
109 define <128 x i8> @test_0b(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
110 %q0 = icmp eq <128 x i8> %v0, %v1
111 %q1 = trunc <128 x i8> %v2 to <128 x i1>
112 %q2 = or <128 x i1> %q0, %q1
113 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
117 ; CHECK-LABEL: test_0c:
118 ; CHECK: q[[Q0C0:[0-3]]] ^= vcmp.eq(v0.b,v1.b)
119 ; CHECK: v0 = vmux(q[[Q0C0]],v0,v1)
120 define <128 x i8> @test_0c(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
121 %q0 = icmp eq <128 x i8> %v0, %v1
122 %q1 = trunc <128 x i8> %v2 to <128 x i1>
123 %q2 = xor <128 x i1> %q0, %q1
124 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
128 ; CHECK-LABEL: test_0d:
129 ; CHECK: q[[Q0D0:[0-3]]] &= vcmp.gt(v0.b,v1.b)
130 ; CHECK: v0 = vmux(q[[Q0D0]],v0,v1)
131 define <128 x i8> @test_0d(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
132 %q0 = icmp sgt <128 x i8> %v0, %v1
133 %q1 = trunc <128 x i8> %v2 to <128 x i1>
134 %q2 = and <128 x i1> %q0, %q1
135 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
139 ; CHECK-LABEL: test_0e:
140 ; CHECK: q[[Q0E0:[0-3]]] |= vcmp.gt(v0.b,v1.b)
141 ; CHECK: v0 = vmux(q[[Q0E0]],v0,v1)
142 define <128 x i8> @test_0e(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
143 %q0 = icmp sgt <128 x i8> %v0, %v1
144 %q1 = trunc <128 x i8> %v2 to <128 x i1>
145 %q2 = or <128 x i1> %q0, %q1
146 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
150 ; CHECK-LABEL: test_0f:
151 ; CHECK: q[[Q0F0:[0-3]]] ^= vcmp.gt(v0.b,v1.b)
152 ; CHECK: v0 = vmux(q[[Q0F0]],v0,v1)
153 define <128 x i8> @test_0f(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
154 %q0 = icmp sgt <128 x i8> %v0, %v1
155 %q1 = trunc <128 x i8> %v2 to <128 x i1>
156 %q2 = xor <128 x i1> %q0, %q1
157 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
161 ; CHECK-LABEL: test_0g:
162 ; CHECK: q[[Q0G0:[0-3]]] &= vcmp.gt(v0.ub,v1.ub)
163 ; CHECK: v0 = vmux(q[[Q0G0]],v0,v1)
164 define <128 x i8> @test_0g(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
165 %q0 = icmp ugt <128 x i8> %v0, %v1
166 %q1 = trunc <128 x i8> %v2 to <128 x i1>
167 %q2 = and <128 x i1> %q0, %q1
168 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
172 ; CHECK-LABEL: test_0h:
173 ; CHECK: q[[Q0H0:[0-3]]] |= vcmp.gt(v0.ub,v1.ub)
174 ; CHECK: v0 = vmux(q[[Q0H0]],v0,v1)
175 define <128 x i8> @test_0h(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
176 %q0 = icmp ugt <128 x i8> %v0, %v1
177 %q1 = trunc <128 x i8> %v2 to <128 x i1>
178 %q2 = or <128 x i1> %q0, %q1
179 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
183 ; CHECK-LABEL: test_0i:
184 ; CHECK: q[[Q0I0:[0-3]]] ^= vcmp.gt(v0.ub,v1.ub)
185 ; CHECK: v0 = vmux(q[[Q0I0]],v0,v1)
186 define <128 x i8> @test_0i(<128 x i8> %v0, <128 x i8> %v1, <128 x i8> %v2) #0 {
187 %q0 = icmp ugt <128 x i8> %v0, %v1
188 %q1 = trunc <128 x i8> %v2 to <128 x i1>
189 %q2 = xor <128 x i1> %q0, %q1
190 %t1 = select <128 x i1> %q2, <128 x i8> %v0, <128 x i8> %v1
196 ; CHECK-LABEL: test_10:
197 ; CHECK: q[[Q100:[0-3]]] = vcmp.eq(v0.h,v1.h)
198 ; CHECK: v0 = vmux(q[[Q100]],v1,v2)
199 define <64 x i16> @test_10(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
200 %t0 = icmp eq <64 x i16> %v0, %v1
201 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
205 ; CHECK-LABEL: test_11:
206 ; CHECK: q[[Q110:[0-3]]] = vcmp.eq(v0.h,v1.h)
207 ; CHECK: v0 = vmux(q[[Q110]],v2,v1)
208 define <64 x i16> @test_11(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
209 %t0 = icmp ne <64 x i16> %v0, %v1
210 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
214 ; CHECK-LABEL: test_12:
215 ; CHECK: q[[Q120:[0-3]]] = vcmp.gt(v1.h,v0.h)
216 ; CHECK: v0 = vmux(q[[Q120]],v1,v2)
217 define <64 x i16> @test_12(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
218 %t0 = icmp slt <64 x i16> %v0, %v1
219 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
223 ; CHECK-LABEL: test_13:
224 ; CHECK: q[[Q130:[0-3]]] = vcmp.gt(v0.h,v1.h)
225 ; CHECK: v0 = vmux(q[[Q130]],v2,v1)
226 define <64 x i16> @test_13(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
227 %t0 = icmp sle <64 x i16> %v0, %v1
228 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
232 ; CHECK-LABEL: test_14:
233 ; CHECK: q[[Q140:[0-3]]] = vcmp.gt(v0.h,v1.h)
234 ; CHECK: v0 = vmux(q[[Q140]],v1,v2)
235 define <64 x i16> @test_14(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
236 %t0 = icmp sgt <64 x i16> %v0, %v1
237 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
241 ; CHECK-LABEL: test_15:
242 ; CHECK: q[[Q150:[0-3]]] = vcmp.gt(v1.h,v0.h)
243 ; CHECK: v0 = vmux(q[[Q150]],v2,v1)
244 define <64 x i16> @test_15(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
245 %t0 = icmp sge <64 x i16> %v0, %v1
246 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
250 ; CHECK-LABEL: test_16:
251 ; CHECK: q[[Q160:[0-3]]] = vcmp.gt(v1.uh,v0.uh)
252 ; CHECK: v0 = vmux(q[[Q160]],v1,v2)
253 define <64 x i16> @test_16(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
254 %t0 = icmp ult <64 x i16> %v0, %v1
255 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
259 ; CHECK-LABEL: test_17:
260 ; CHECK: q[[Q170:[0-3]]] = vcmp.gt(v0.uh,v1.uh)
261 ; CHECK: v0 = vmux(q[[Q170]],v2,v1)
262 define <64 x i16> @test_17(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
263 %t0 = icmp ule <64 x i16> %v0, %v1
264 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
268 ; CHECK-LABEL: test_18:
269 ; CHECK: q[[Q180:[0-3]]] = vcmp.gt(v0.uh,v1.uh)
270 ; CHECK: v0 = vmux(q[[Q180]],v1,v2)
271 define <64 x i16> @test_18(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
272 %t0 = icmp ugt <64 x i16> %v0, %v1
273 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
277 ; CHECK-LABEL: test_19:
278 ; CHECK: q[[Q190:[0-3]]] = vcmp.gt(v1.uh,v0.uh)
279 ; CHECK: v0 = vmux(q[[Q190]],v2,v1)
280 define <64 x i16> @test_19(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
281 %t0 = icmp uge <64 x i16> %v0, %v1
282 %t1 = select <64 x i1> %t0, <64 x i16> %v1, <64 x i16> %v2
286 ; CHECK-LABEL: test_1a:
287 ; CHECK: q[[Q1A0:[0-3]]] &= vcmp.eq(v0.h,v1.h)
288 ; CHECK: v0 = vmux(q[[Q1A0]],v0,v1)
289 define <64 x i16> @test_1a(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
290 %q0 = icmp eq <64 x i16> %v0, %v1
291 %q1 = trunc <64 x i16> %v2 to <64 x i1>
292 %q2 = and <64 x i1> %q0, %q1
293 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
297 ; CHECK-LABEL: test_1b:
298 ; CHECK: q[[Q1B0:[0-3]]] |= vcmp.eq(v0.h,v1.h)
299 ; CHECK: v0 = vmux(q[[Q1B0]],v0,v1)
300 define <64 x i16> @test_1b(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
301 %q0 = icmp eq <64 x i16> %v0, %v1
302 %q1 = trunc <64 x i16> %v2 to <64 x i1>
303 %q2 = or <64 x i1> %q0, %q1
304 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
308 ; CHECK-LABEL: test_1c:
309 ; CHECK: q[[Q1C0:[0-3]]] ^= vcmp.eq(v0.h,v1.h)
310 ; CHECK: v0 = vmux(q[[Q1C0]],v0,v1)
311 define <64 x i16> @test_1c(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
312 %q0 = icmp eq <64 x i16> %v0, %v1
313 %q1 = trunc <64 x i16> %v2 to <64 x i1>
314 %q2 = xor <64 x i1> %q0, %q1
315 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
319 ; CHECK-LABEL: test_1d:
320 ; CHECK: q[[Q1D0:[0-3]]] &= vcmp.gt(v0.h,v1.h)
321 ; CHECK: v0 = vmux(q[[Q1D0]],v0,v1)
322 define <64 x i16> @test_1d(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
323 %q0 = icmp sgt <64 x i16> %v0, %v1
324 %q1 = trunc <64 x i16> %v2 to <64 x i1>
325 %q2 = and <64 x i1> %q0, %q1
326 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
330 ; CHECK-LABEL: test_1e:
331 ; CHECK: q[[Q1E0:[0-3]]] |= vcmp.gt(v0.h,v1.h)
332 ; CHECK: v0 = vmux(q[[Q1E0]],v0,v1)
333 define <64 x i16> @test_1e(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
334 %q0 = icmp sgt <64 x i16> %v0, %v1
335 %q1 = trunc <64 x i16> %v2 to <64 x i1>
336 %q2 = or <64 x i1> %q0, %q1
337 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
341 ; CHECK-LABEL: test_1f:
342 ; CHECK: q[[Q1F0:[0-3]]] ^= vcmp.gt(v0.h,v1.h)
343 ; CHECK: v0 = vmux(q[[Q1F0]],v0,v1)
344 define <64 x i16> @test_1f(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
345 %q0 = icmp sgt <64 x i16> %v0, %v1
346 %q1 = trunc <64 x i16> %v2 to <64 x i1>
347 %q2 = xor <64 x i1> %q0, %q1
348 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
352 ; CHECK-LABEL: test_1g:
353 ; CHECK: q[[Q1G0:[0-3]]] &= vcmp.gt(v0.uh,v1.uh)
354 ; CHECK: v0 = vmux(q[[Q1G0]],v0,v1)
355 define <64 x i16> @test_1g(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
356 %q0 = icmp ugt <64 x i16> %v0, %v1
357 %q1 = trunc <64 x i16> %v2 to <64 x i1>
358 %q2 = and <64 x i1> %q0, %q1
359 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
363 ; CHECK-LABEL: test_1h:
364 ; CHECK: q[[Q1H0:[0-3]]] |= vcmp.gt(v0.uh,v1.uh)
365 ; CHECK: v0 = vmux(q[[Q1H0]],v0,v1)
366 define <64 x i16> @test_1h(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
367 %q0 = icmp ugt <64 x i16> %v0, %v1
368 %q1 = trunc <64 x i16> %v2 to <64 x i1>
369 %q2 = or <64 x i1> %q0, %q1
370 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
374 ; CHECK-LABEL: test_1i:
375 ; CHECK: q[[Q1I0:[0-3]]] ^= vcmp.gt(v0.uh,v1.uh)
376 ; CHECK: v0 = vmux(q[[Q1I0]],v0,v1)
377 define <64 x i16> @test_1i(<64 x i16> %v0, <64 x i16> %v1, <64 x i16> %v2) #0 {
378 %q0 = icmp ugt <64 x i16> %v0, %v1
379 %q1 = trunc <64 x i16> %v2 to <64 x i1>
380 %q2 = xor <64 x i1> %q0, %q1
381 %t1 = select <64 x i1> %q2, <64 x i16> %v0, <64 x i16> %v1
387 ; CHECK-LABEL: test_20:
388 ; CHECK: q[[Q200:[0-3]]] = vcmp.eq(v0.w,v1.w)
389 ; CHECK: v0 = vmux(q[[Q200]],v1,v2)
390 define <32 x i32> @test_20(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
391 %t0 = icmp eq <32 x i32> %v0, %v1
392 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
396 ; CHECK-LABEL: test_21:
397 ; CHECK: q[[Q210:[0-3]]] = vcmp.eq(v0.w,v1.w)
398 ; CHECK: v0 = vmux(q[[Q210]],v2,v1)
399 define <32 x i32> @test_21(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
400 %t0 = icmp ne <32 x i32> %v0, %v1
401 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
405 ; CHECK-LABEL: test_22:
406 ; CHECK: q[[Q220:[0-3]]] = vcmp.gt(v1.w,v0.w)
407 ; CHECK: v0 = vmux(q[[Q220]],v1,v2)
408 define <32 x i32> @test_22(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
409 %t0 = icmp slt <32 x i32> %v0, %v1
410 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
414 ; CHECK-LABEL: test_23:
415 ; CHECK: q[[Q230:[0-3]]] = vcmp.gt(v0.w,v1.w)
416 ; CHECK: v0 = vmux(q[[Q230]],v2,v1)
417 define <32 x i32> @test_23(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
418 %t0 = icmp sle <32 x i32> %v0, %v1
419 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
423 ; CHECK-LABEL: test_24:
424 ; CHECK: q[[Q240:[0-3]]] = vcmp.gt(v0.w,v1.w)
425 ; CHECK: v0 = vmux(q[[Q240]],v1,v2)
426 define <32 x i32> @test_24(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
427 %t0 = icmp sgt <32 x i32> %v0, %v1
428 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
432 ; CHECK-LABEL: test_25:
433 ; CHECK: q[[Q250:[0-3]]] = vcmp.gt(v1.w,v0.w)
434 ; CHECK: v0 = vmux(q[[Q250]],v2,v1)
435 define <32 x i32> @test_25(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
436 %t0 = icmp sge <32 x i32> %v0, %v1
437 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
441 ; CHECK-LABEL: test_26:
442 ; CHECK: q[[Q260:[0-3]]] = vcmp.gt(v1.uw,v0.uw)
443 ; CHECK: v0 = vmux(q[[Q260]],v1,v2)
444 define <32 x i32> @test_26(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
445 %t0 = icmp ult <32 x i32> %v0, %v1
446 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
450 ; CHECK-LABEL: test_27:
451 ; CHECK: q[[Q270:[0-3]]] = vcmp.gt(v0.uw,v1.uw)
452 ; CHECK: v0 = vmux(q[[Q270]],v2,v1)
453 define <32 x i32> @test_27(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
454 %t0 = icmp ule <32 x i32> %v0, %v1
455 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
459 ; CHECK-LABEL: test_28:
460 ; CHECK: q[[Q280:[0-3]]] = vcmp.gt(v0.uw,v1.uw)
461 ; CHECK: v0 = vmux(q[[Q280]],v1,v2)
462 define <32 x i32> @test_28(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
463 %t0 = icmp ugt <32 x i32> %v0, %v1
464 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
468 ; CHECK-LABEL: test_29:
469 ; CHECK: q[[Q290:[0-3]]] = vcmp.gt(v1.uw,v0.uw)
470 ; CHECK: v0 = vmux(q[[Q290]],v2,v1)
471 define <32 x i32> @test_29(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
472 %t0 = icmp uge <32 x i32> %v0, %v1
473 %t1 = select <32 x i1> %t0, <32 x i32> %v1, <32 x i32> %v2
477 ; CHECK-LABEL: test_2a:
478 ; CHECK: q[[Q2A0:[0-3]]] &= vcmp.eq(v0.w,v1.w)
479 ; CHECK: v0 = vmux(q[[Q2A0]],v0,v1)
480 define <32 x i32> @test_2a(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
481 %q0 = icmp eq <32 x i32> %v0, %v1
482 %q1 = trunc <32 x i32> %v2 to <32 x i1>
483 %q2 = and <32 x i1> %q0, %q1
484 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
488 ; CHECK-LABEL: test_2b:
489 ; CHECK: q[[Q2B0:[0-3]]] |= vcmp.eq(v0.w,v1.w)
490 ; CHECK: v0 = vmux(q[[Q2B0]],v0,v1)
491 define <32 x i32> @test_2b(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
492 %q0 = icmp eq <32 x i32> %v0, %v1
493 %q1 = trunc <32 x i32> %v2 to <32 x i1>
494 %q2 = or <32 x i1> %q0, %q1
495 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
499 ; CHECK-LABEL: test_2c:
500 ; CHECK: q[[Q2C0:[0-3]]] ^= vcmp.eq(v0.w,v1.w)
501 ; CHECK: v0 = vmux(q[[Q2C0]],v0,v1)
502 define <32 x i32> @test_2c(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
503 %q0 = icmp eq <32 x i32> %v0, %v1
504 %q1 = trunc <32 x i32> %v2 to <32 x i1>
505 %q2 = xor <32 x i1> %q0, %q1
506 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
510 ; CHECK-LABEL: test_2d:
511 ; CHECK: q[[Q2D0:[0-3]]] &= vcmp.gt(v0.w,v1.w)
512 ; CHECK: v0 = vmux(q[[Q2D0]],v0,v1)
513 define <32 x i32> @test_2d(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
514 %q0 = icmp sgt <32 x i32> %v0, %v1
515 %q1 = trunc <32 x i32> %v2 to <32 x i1>
516 %q2 = and <32 x i1> %q0, %q1
517 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
521 ; CHECK-LABEL: test_2e:
522 ; CHECK: q[[Q2E0:[0-3]]] |= vcmp.gt(v0.w,v1.w)
523 ; CHECK: v0 = vmux(q[[Q2E0]],v0,v1)
524 define <32 x i32> @test_2e(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
525 %q0 = icmp sgt <32 x i32> %v0, %v1
526 %q1 = trunc <32 x i32> %v2 to <32 x i1>
527 %q2 = or <32 x i1> %q0, %q1
528 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
532 ; CHECK-LABEL: test_2f:
533 ; CHECK: q[[Q2F0:[0-3]]] ^= vcmp.gt(v0.w,v1.w)
534 ; CHECK: v0 = vmux(q[[Q2F0]],v0,v1)
535 define <32 x i32> @test_2f(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
536 %q0 = icmp sgt <32 x i32> %v0, %v1
537 %q1 = trunc <32 x i32> %v2 to <32 x i1>
538 %q2 = xor <32 x i1> %q0, %q1
539 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
543 ; CHECK-LABEL: test_2g:
544 ; CHECK: q[[Q2G0:[0-3]]] &= vcmp.gt(v0.uw,v1.uw)
545 ; CHECK: v0 = vmux(q[[Q2G0]],v0,v1)
546 define <32 x i32> @test_2g(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
547 %q0 = icmp ugt <32 x i32> %v0, %v1
548 %q1 = trunc <32 x i32> %v2 to <32 x i1>
549 %q2 = and <32 x i1> %q0, %q1
550 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
554 ; CHECK-LABEL: test_2h:
555 ; CHECK: q[[Q2H0:[0-3]]] |= vcmp.gt(v0.uw,v1.uw)
556 ; CHECK: v0 = vmux(q[[Q2H0]],v0,v1)
557 define <32 x i32> @test_2h(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
558 %q0 = icmp ugt <32 x i32> %v0, %v1
559 %q1 = trunc <32 x i32> %v2 to <32 x i1>
560 %q2 = or <32 x i1> %q0, %q1
561 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
565 ; CHECK-LABEL: test_2i:
566 ; CHECK: q[[Q2I0:[0-3]]] ^= vcmp.gt(v0.uw,v1.uw)
567 ; CHECK: v0 = vmux(q[[Q2I0]],v0,v1)
568 define <32 x i32> @test_2i(<32 x i32> %v0, <32 x i32> %v1, <32 x i32> %v2) #0 {
569 %q0 = icmp ugt <32 x i32> %v0, %v1
570 %q1 = trunc <32 x i32> %v2 to <32 x i1>
571 %q2 = xor <32 x i1> %q0, %q1
572 %t1 = select <32 x i1> %q2, <32 x i32> %v0, <32 x i32> %v1
576 attributes #0 = { nounwind readnone "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length128b" }