1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,CHECK-RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,CHECK-RV64
4 ; RUN: llc -mtriple=riscv32 -mattr=+v,+zvkb -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK-ZVKB,CHECK-ZVKB32
5 ; RUN: llc -mtriple=riscv64 -mattr=+v,+zvkb -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK-ZVKB,CHECK-ZVKB64
7 define <vscale x 1 x i8> @vandn_vv_nxv1i8(<vscale x 1 x i8> %x, <vscale x 1 x i8> %y) {
8 ; CHECK-LABEL: vandn_vv_nxv1i8:
10 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
11 ; CHECK-NEXT: vnot.v v8, v8
12 ; CHECK-NEXT: vand.vv v8, v8, v9
15 ; CHECK-ZVKB-LABEL: vandn_vv_nxv1i8:
16 ; CHECK-ZVKB: # %bb.0:
17 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
18 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
19 ; CHECK-ZVKB-NEXT: ret
20 %a = xor <vscale x 1 x i8> %x, splat (i8 -1)
21 %b = and <vscale x 1 x i8> %a, %y
22 ret <vscale x 1 x i8> %b
25 define <vscale x 1 x i8> @vandn_vv_swapped_nxv1i8(<vscale x 1 x i8> %x, <vscale x 1 x i8> %y) {
26 ; CHECK-LABEL: vandn_vv_swapped_nxv1i8:
28 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
29 ; CHECK-NEXT: vnot.v v8, v8
30 ; CHECK-NEXT: vand.vv v8, v9, v8
33 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv1i8:
34 ; CHECK-ZVKB: # %bb.0:
35 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
36 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
37 ; CHECK-ZVKB-NEXT: ret
38 %a = xor <vscale x 1 x i8> %x, splat (i8 -1)
39 %b = and <vscale x 1 x i8> %y, %a
40 ret <vscale x 1 x i8> %b
43 define <vscale x 1 x i8> @vandn_vx_nxv1i8(i8 %x, <vscale x 1 x i8> %y) {
44 ; CHECK-LABEL: vandn_vx_nxv1i8:
46 ; CHECK-NEXT: not a0, a0
47 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
48 ; CHECK-NEXT: vand.vx v8, v8, a0
51 ; CHECK-ZVKB-LABEL: vandn_vx_nxv1i8:
52 ; CHECK-ZVKB: # %bb.0:
53 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
54 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
55 ; CHECK-ZVKB-NEXT: ret
57 %head = insertelement <vscale x 1 x i8> poison, i8 %a, i32 0
58 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
59 %b = and <vscale x 1 x i8> %splat, %y
60 ret <vscale x 1 x i8> %b
63 define <vscale x 1 x i8> @vandn_vx_swapped_nxv1i8(i8 %x, <vscale x 1 x i8> %y) {
64 ; CHECK-LABEL: vandn_vx_swapped_nxv1i8:
66 ; CHECK-NEXT: not a0, a0
67 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
68 ; CHECK-NEXT: vand.vx v8, v8, a0
71 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv1i8:
72 ; CHECK-ZVKB: # %bb.0:
73 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
74 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
75 ; CHECK-ZVKB-NEXT: ret
77 %head = insertelement <vscale x 1 x i8> poison, i8 %a, i32 0
78 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
79 %b = and <vscale x 1 x i8> %splat, %y
80 ret <vscale x 1 x i8> %b
83 define <vscale x 2 x i8> @vandn_vv_nxv2i8(<vscale x 2 x i8> %x, <vscale x 2 x i8> %y) {
84 ; CHECK-LABEL: vandn_vv_nxv2i8:
86 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
87 ; CHECK-NEXT: vnot.v v8, v8
88 ; CHECK-NEXT: vand.vv v8, v8, v9
91 ; CHECK-ZVKB-LABEL: vandn_vv_nxv2i8:
92 ; CHECK-ZVKB: # %bb.0:
93 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
94 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
95 ; CHECK-ZVKB-NEXT: ret
96 %a = xor <vscale x 2 x i8> %x, splat (i8 -1)
97 %b = and <vscale x 2 x i8> %a, %y
98 ret <vscale x 2 x i8> %b
101 define <vscale x 2 x i8> @vandn_vv_swapped_nxv2i8(<vscale x 2 x i8> %x, <vscale x 2 x i8> %y) {
102 ; CHECK-LABEL: vandn_vv_swapped_nxv2i8:
104 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
105 ; CHECK-NEXT: vnot.v v8, v8
106 ; CHECK-NEXT: vand.vv v8, v9, v8
109 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv2i8:
110 ; CHECK-ZVKB: # %bb.0:
111 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
112 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
113 ; CHECK-ZVKB-NEXT: ret
114 %a = xor <vscale x 2 x i8> %x, splat (i8 -1)
115 %b = and <vscale x 2 x i8> %y, %a
116 ret <vscale x 2 x i8> %b
119 define <vscale x 2 x i8> @vandn_vx_nxv2i8(i8 %x, <vscale x 2 x i8> %y) {
120 ; CHECK-LABEL: vandn_vx_nxv2i8:
122 ; CHECK-NEXT: not a0, a0
123 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
124 ; CHECK-NEXT: vand.vx v8, v8, a0
127 ; CHECK-ZVKB-LABEL: vandn_vx_nxv2i8:
128 ; CHECK-ZVKB: # %bb.0:
129 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
130 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
131 ; CHECK-ZVKB-NEXT: ret
133 %head = insertelement <vscale x 2 x i8> poison, i8 %a, i32 0
134 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
135 %b = and <vscale x 2 x i8> %splat, %y
136 ret <vscale x 2 x i8> %b
139 define <vscale x 2 x i8> @vandn_vx_swapped_nxv2i8(i8 %x, <vscale x 2 x i8> %y) {
140 ; CHECK-LABEL: vandn_vx_swapped_nxv2i8:
142 ; CHECK-NEXT: not a0, a0
143 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
144 ; CHECK-NEXT: vand.vx v8, v8, a0
147 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv2i8:
148 ; CHECK-ZVKB: # %bb.0:
149 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
150 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
151 ; CHECK-ZVKB-NEXT: ret
153 %head = insertelement <vscale x 2 x i8> poison, i8 %a, i32 0
154 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
155 %b = and <vscale x 2 x i8> %splat, %y
156 ret <vscale x 2 x i8> %b
159 define <vscale x 4 x i8> @vandn_vv_nxv4i8(<vscale x 4 x i8> %x, <vscale x 4 x i8> %y) {
160 ; CHECK-LABEL: vandn_vv_nxv4i8:
162 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
163 ; CHECK-NEXT: vnot.v v8, v8
164 ; CHECK-NEXT: vand.vv v8, v8, v9
167 ; CHECK-ZVKB-LABEL: vandn_vv_nxv4i8:
168 ; CHECK-ZVKB: # %bb.0:
169 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
170 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
171 ; CHECK-ZVKB-NEXT: ret
172 %a = xor <vscale x 4 x i8> %x, splat (i8 -1)
173 %b = and <vscale x 4 x i8> %a, %y
174 ret <vscale x 4 x i8> %b
177 define <vscale x 4 x i8> @vandn_vv_swapped_nxv4i8(<vscale x 4 x i8> %x, <vscale x 4 x i8> %y) {
178 ; CHECK-LABEL: vandn_vv_swapped_nxv4i8:
180 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
181 ; CHECK-NEXT: vnot.v v8, v8
182 ; CHECK-NEXT: vand.vv v8, v9, v8
185 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv4i8:
186 ; CHECK-ZVKB: # %bb.0:
187 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
188 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
189 ; CHECK-ZVKB-NEXT: ret
190 %a = xor <vscale x 4 x i8> %x, splat (i8 -1)
191 %b = and <vscale x 4 x i8> %y, %a
192 ret <vscale x 4 x i8> %b
195 define <vscale x 4 x i8> @vandn_vx_nxv4i8(i8 %x, <vscale x 4 x i8> %y) {
196 ; CHECK-LABEL: vandn_vx_nxv4i8:
198 ; CHECK-NEXT: not a0, a0
199 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
200 ; CHECK-NEXT: vand.vx v8, v8, a0
203 ; CHECK-ZVKB-LABEL: vandn_vx_nxv4i8:
204 ; CHECK-ZVKB: # %bb.0:
205 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
206 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
207 ; CHECK-ZVKB-NEXT: ret
209 %head = insertelement <vscale x 4 x i8> poison, i8 %a, i32 0
210 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
211 %b = and <vscale x 4 x i8> %splat, %y
212 ret <vscale x 4 x i8> %b
215 define <vscale x 4 x i8> @vandn_vx_swapped_nxv4i8(i8 %x, <vscale x 4 x i8> %y) {
216 ; CHECK-LABEL: vandn_vx_swapped_nxv4i8:
218 ; CHECK-NEXT: not a0, a0
219 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
220 ; CHECK-NEXT: vand.vx v8, v8, a0
223 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv4i8:
224 ; CHECK-ZVKB: # %bb.0:
225 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
226 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
227 ; CHECK-ZVKB-NEXT: ret
229 %head = insertelement <vscale x 4 x i8> poison, i8 %a, i32 0
230 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
231 %b = and <vscale x 4 x i8> %splat, %y
232 ret <vscale x 4 x i8> %b
235 define <vscale x 8 x i8> @vandn_vv_nxv8i8(<vscale x 8 x i8> %x, <vscale x 8 x i8> %y) {
236 ; CHECK-LABEL: vandn_vv_nxv8i8:
238 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
239 ; CHECK-NEXT: vnot.v v8, v8
240 ; CHECK-NEXT: vand.vv v8, v8, v9
243 ; CHECK-ZVKB-LABEL: vandn_vv_nxv8i8:
244 ; CHECK-ZVKB: # %bb.0:
245 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m1, ta, ma
246 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
247 ; CHECK-ZVKB-NEXT: ret
248 %a = xor <vscale x 8 x i8> %x, splat (i8 -1)
249 %b = and <vscale x 8 x i8> %a, %y
250 ret <vscale x 8 x i8> %b
253 define <vscale x 8 x i8> @vandn_vv_swapped_nxv8i8(<vscale x 8 x i8> %x, <vscale x 8 x i8> %y) {
254 ; CHECK-LABEL: vandn_vv_swapped_nxv8i8:
256 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
257 ; CHECK-NEXT: vnot.v v8, v8
258 ; CHECK-NEXT: vand.vv v8, v9, v8
261 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv8i8:
262 ; CHECK-ZVKB: # %bb.0:
263 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m1, ta, ma
264 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
265 ; CHECK-ZVKB-NEXT: ret
266 %a = xor <vscale x 8 x i8> %x, splat (i8 -1)
267 %b = and <vscale x 8 x i8> %y, %a
268 ret <vscale x 8 x i8> %b
271 define <vscale x 8 x i8> @vandn_vx_nxv8i8(i8 %x, <vscale x 8 x i8> %y) {
272 ; CHECK-LABEL: vandn_vx_nxv8i8:
274 ; CHECK-NEXT: not a0, a0
275 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
276 ; CHECK-NEXT: vand.vx v8, v8, a0
279 ; CHECK-ZVKB-LABEL: vandn_vx_nxv8i8:
280 ; CHECK-ZVKB: # %bb.0:
281 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m1, ta, ma
282 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
283 ; CHECK-ZVKB-NEXT: ret
285 %head = insertelement <vscale x 8 x i8> poison, i8 %a, i32 0
286 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
287 %b = and <vscale x 8 x i8> %splat, %y
288 ret <vscale x 8 x i8> %b
291 define <vscale x 8 x i8> @vandn_vx_swapped_nxv8i8(i8 %x, <vscale x 8 x i8> %y) {
292 ; CHECK-LABEL: vandn_vx_swapped_nxv8i8:
294 ; CHECK-NEXT: not a0, a0
295 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
296 ; CHECK-NEXT: vand.vx v8, v8, a0
299 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv8i8:
300 ; CHECK-ZVKB: # %bb.0:
301 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m1, ta, ma
302 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
303 ; CHECK-ZVKB-NEXT: ret
305 %head = insertelement <vscale x 8 x i8> poison, i8 %a, i32 0
306 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
307 %b = and <vscale x 8 x i8> %splat, %y
308 ret <vscale x 8 x i8> %b
311 define <vscale x 16 x i8> @vandn_vv_nxv16i8(<vscale x 16 x i8> %x, <vscale x 16 x i8> %y) {
312 ; CHECK-LABEL: vandn_vv_nxv16i8:
314 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
315 ; CHECK-NEXT: vnot.v v8, v8
316 ; CHECK-NEXT: vand.vv v8, v8, v10
319 ; CHECK-ZVKB-LABEL: vandn_vv_nxv16i8:
320 ; CHECK-ZVKB: # %bb.0:
321 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m2, ta, ma
322 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
323 ; CHECK-ZVKB-NEXT: ret
324 %a = xor <vscale x 16 x i8> %x, splat (i8 -1)
325 %b = and <vscale x 16 x i8> %a, %y
326 ret <vscale x 16 x i8> %b
329 define <vscale x 16 x i8> @vandn_vv_swapped_nxv16i8(<vscale x 16 x i8> %x, <vscale x 16 x i8> %y) {
330 ; CHECK-LABEL: vandn_vv_swapped_nxv16i8:
332 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
333 ; CHECK-NEXT: vnot.v v8, v8
334 ; CHECK-NEXT: vand.vv v8, v10, v8
337 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv16i8:
338 ; CHECK-ZVKB: # %bb.0:
339 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m2, ta, ma
340 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
341 ; CHECK-ZVKB-NEXT: ret
342 %a = xor <vscale x 16 x i8> %x, splat (i8 -1)
343 %b = and <vscale x 16 x i8> %y, %a
344 ret <vscale x 16 x i8> %b
347 define <vscale x 16 x i8> @vandn_vx_nxv16i8(i8 %x, <vscale x 16 x i8> %y) {
348 ; CHECK-LABEL: vandn_vx_nxv16i8:
350 ; CHECK-NEXT: not a0, a0
351 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
352 ; CHECK-NEXT: vand.vx v8, v8, a0
355 ; CHECK-ZVKB-LABEL: vandn_vx_nxv16i8:
356 ; CHECK-ZVKB: # %bb.0:
357 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m2, ta, ma
358 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
359 ; CHECK-ZVKB-NEXT: ret
361 %head = insertelement <vscale x 16 x i8> poison, i8 %a, i32 0
362 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
363 %b = and <vscale x 16 x i8> %splat, %y
364 ret <vscale x 16 x i8> %b
367 define <vscale x 16 x i8> @vandn_vx_swapped_nxv16i8(i8 %x, <vscale x 16 x i8> %y) {
368 ; CHECK-LABEL: vandn_vx_swapped_nxv16i8:
370 ; CHECK-NEXT: not a0, a0
371 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
372 ; CHECK-NEXT: vand.vx v8, v8, a0
375 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv16i8:
376 ; CHECK-ZVKB: # %bb.0:
377 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m2, ta, ma
378 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
379 ; CHECK-ZVKB-NEXT: ret
381 %head = insertelement <vscale x 16 x i8> poison, i8 %a, i32 0
382 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
383 %b = and <vscale x 16 x i8> %splat, %y
384 ret <vscale x 16 x i8> %b
387 define <vscale x 32 x i8> @vandn_vv_nxv32i8(<vscale x 32 x i8> %x, <vscale x 32 x i8> %y) {
388 ; CHECK-LABEL: vandn_vv_nxv32i8:
390 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
391 ; CHECK-NEXT: vnot.v v8, v8
392 ; CHECK-NEXT: vand.vv v8, v8, v12
395 ; CHECK-ZVKB-LABEL: vandn_vv_nxv32i8:
396 ; CHECK-ZVKB: # %bb.0:
397 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m4, ta, ma
398 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
399 ; CHECK-ZVKB-NEXT: ret
400 %a = xor <vscale x 32 x i8> %x, splat (i8 -1)
401 %b = and <vscale x 32 x i8> %a, %y
402 ret <vscale x 32 x i8> %b
405 define <vscale x 32 x i8> @vandn_vv_swapped_nxv32i8(<vscale x 32 x i8> %x, <vscale x 32 x i8> %y) {
406 ; CHECK-LABEL: vandn_vv_swapped_nxv32i8:
408 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
409 ; CHECK-NEXT: vnot.v v8, v8
410 ; CHECK-NEXT: vand.vv v8, v12, v8
413 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv32i8:
414 ; CHECK-ZVKB: # %bb.0:
415 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m4, ta, ma
416 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
417 ; CHECK-ZVKB-NEXT: ret
418 %a = xor <vscale x 32 x i8> %x, splat (i8 -1)
419 %b = and <vscale x 32 x i8> %y, %a
420 ret <vscale x 32 x i8> %b
423 define <vscale x 32 x i8> @vandn_vx_nxv32i8(i8 %x, <vscale x 32 x i8> %y) {
424 ; CHECK-LABEL: vandn_vx_nxv32i8:
426 ; CHECK-NEXT: not a0, a0
427 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
428 ; CHECK-NEXT: vand.vx v8, v8, a0
431 ; CHECK-ZVKB-LABEL: vandn_vx_nxv32i8:
432 ; CHECK-ZVKB: # %bb.0:
433 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m4, ta, ma
434 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
435 ; CHECK-ZVKB-NEXT: ret
437 %head = insertelement <vscale x 32 x i8> poison, i8 %a, i32 0
438 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
439 %b = and <vscale x 32 x i8> %splat, %y
440 ret <vscale x 32 x i8> %b
443 define <vscale x 32 x i8> @vandn_vx_swapped_nxv32i8(i8 %x, <vscale x 32 x i8> %y) {
444 ; CHECK-LABEL: vandn_vx_swapped_nxv32i8:
446 ; CHECK-NEXT: not a0, a0
447 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
448 ; CHECK-NEXT: vand.vx v8, v8, a0
451 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv32i8:
452 ; CHECK-ZVKB: # %bb.0:
453 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m4, ta, ma
454 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
455 ; CHECK-ZVKB-NEXT: ret
457 %head = insertelement <vscale x 32 x i8> poison, i8 %a, i32 0
458 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
459 %b = and <vscale x 32 x i8> %splat, %y
460 ret <vscale x 32 x i8> %b
463 define <vscale x 64 x i8> @vandn_vv_nxv64i8(<vscale x 64 x i8> %x, <vscale x 64 x i8> %y) {
464 ; CHECK-LABEL: vandn_vv_nxv64i8:
466 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
467 ; CHECK-NEXT: vnot.v v8, v8
468 ; CHECK-NEXT: vand.vv v8, v8, v16
471 ; CHECK-ZVKB-LABEL: vandn_vv_nxv64i8:
472 ; CHECK-ZVKB: # %bb.0:
473 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m8, ta, ma
474 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
475 ; CHECK-ZVKB-NEXT: ret
476 %a = xor <vscale x 64 x i8> %x, splat (i8 -1)
477 %b = and <vscale x 64 x i8> %a, %y
478 ret <vscale x 64 x i8> %b
481 define <vscale x 64 x i8> @vandn_vv_swapped_nxv64i8(<vscale x 64 x i8> %x, <vscale x 64 x i8> %y) {
482 ; CHECK-LABEL: vandn_vv_swapped_nxv64i8:
484 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
485 ; CHECK-NEXT: vnot.v v8, v8
486 ; CHECK-NEXT: vand.vv v8, v16, v8
489 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv64i8:
490 ; CHECK-ZVKB: # %bb.0:
491 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m8, ta, ma
492 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
493 ; CHECK-ZVKB-NEXT: ret
494 %a = xor <vscale x 64 x i8> %x, splat (i8 -1)
495 %b = and <vscale x 64 x i8> %y, %a
496 ret <vscale x 64 x i8> %b
499 define <vscale x 64 x i8> @vandn_vx_nxv64i8(i8 %x, <vscale x 64 x i8> %y) {
500 ; CHECK-LABEL: vandn_vx_nxv64i8:
502 ; CHECK-NEXT: not a0, a0
503 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
504 ; CHECK-NEXT: vand.vx v8, v8, a0
507 ; CHECK-ZVKB-LABEL: vandn_vx_nxv64i8:
508 ; CHECK-ZVKB: # %bb.0:
509 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m8, ta, ma
510 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
511 ; CHECK-ZVKB-NEXT: ret
513 %head = insertelement <vscale x 64 x i8> poison, i8 %a, i32 0
514 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
515 %b = and <vscale x 64 x i8> %splat, %y
516 ret <vscale x 64 x i8> %b
519 define <vscale x 64 x i8> @vandn_vx_swapped_nxv64i8(i8 %x, <vscale x 64 x i8> %y) {
520 ; CHECK-LABEL: vandn_vx_swapped_nxv64i8:
522 ; CHECK-NEXT: not a0, a0
523 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
524 ; CHECK-NEXT: vand.vx v8, v8, a0
527 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv64i8:
528 ; CHECK-ZVKB: # %bb.0:
529 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m8, ta, ma
530 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
531 ; CHECK-ZVKB-NEXT: ret
533 %head = insertelement <vscale x 64 x i8> poison, i8 %a, i32 0
534 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
535 %b = and <vscale x 64 x i8> %splat, %y
536 ret <vscale x 64 x i8> %b
539 define <vscale x 1 x i16> @vandn_vv_nxv1i16(<vscale x 1 x i16> %x, <vscale x 1 x i16> %y) {
540 ; CHECK-LABEL: vandn_vv_nxv1i16:
542 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
543 ; CHECK-NEXT: vnot.v v8, v8
544 ; CHECK-NEXT: vand.vv v8, v8, v9
547 ; CHECK-ZVKB-LABEL: vandn_vv_nxv1i16:
548 ; CHECK-ZVKB: # %bb.0:
549 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
550 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
551 ; CHECK-ZVKB-NEXT: ret
552 %a = xor <vscale x 1 x i16> %x, splat (i16 -1)
553 %b = and <vscale x 1 x i16> %a, %y
554 ret <vscale x 1 x i16> %b
557 define <vscale x 1 x i16> @vandn_vv_swapped_nxv1i16(<vscale x 1 x i16> %x, <vscale x 1 x i16> %y) {
558 ; CHECK-LABEL: vandn_vv_swapped_nxv1i16:
560 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
561 ; CHECK-NEXT: vnot.v v8, v8
562 ; CHECK-NEXT: vand.vv v8, v9, v8
565 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv1i16:
566 ; CHECK-ZVKB: # %bb.0:
567 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
568 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
569 ; CHECK-ZVKB-NEXT: ret
570 %a = xor <vscale x 1 x i16> %x, splat (i16 -1)
571 %b = and <vscale x 1 x i16> %y, %a
572 ret <vscale x 1 x i16> %b
575 define <vscale x 1 x i16> @vandn_vx_nxv1i16(i16 %x, <vscale x 1 x i16> %y) {
576 ; CHECK-LABEL: vandn_vx_nxv1i16:
578 ; CHECK-NEXT: not a0, a0
579 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
580 ; CHECK-NEXT: vand.vx v8, v8, a0
583 ; CHECK-ZVKB-LABEL: vandn_vx_nxv1i16:
584 ; CHECK-ZVKB: # %bb.0:
585 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
586 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
587 ; CHECK-ZVKB-NEXT: ret
589 %head = insertelement <vscale x 1 x i16> poison, i16 %a, i32 0
590 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
591 %b = and <vscale x 1 x i16> %splat, %y
592 ret <vscale x 1 x i16> %b
595 define <vscale x 1 x i16> @vandn_vx_swapped_nxv1i16(i16 %x, <vscale x 1 x i16> %y) {
596 ; CHECK-LABEL: vandn_vx_swapped_nxv1i16:
598 ; CHECK-NEXT: not a0, a0
599 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
600 ; CHECK-NEXT: vand.vx v8, v8, a0
603 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv1i16:
604 ; CHECK-ZVKB: # %bb.0:
605 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
606 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
607 ; CHECK-ZVKB-NEXT: ret
609 %head = insertelement <vscale x 1 x i16> poison, i16 %a, i32 0
610 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
611 %b = and <vscale x 1 x i16> %splat, %y
612 ret <vscale x 1 x i16> %b
615 define <vscale x 2 x i16> @vandn_vv_nxv2i16(<vscale x 2 x i16> %x, <vscale x 2 x i16> %y) {
616 ; CHECK-LABEL: vandn_vv_nxv2i16:
618 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
619 ; CHECK-NEXT: vnot.v v8, v8
620 ; CHECK-NEXT: vand.vv v8, v8, v9
623 ; CHECK-ZVKB-LABEL: vandn_vv_nxv2i16:
624 ; CHECK-ZVKB: # %bb.0:
625 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
626 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
627 ; CHECK-ZVKB-NEXT: ret
628 %a = xor <vscale x 2 x i16> %x, splat (i16 -1)
629 %b = and <vscale x 2 x i16> %a, %y
630 ret <vscale x 2 x i16> %b
633 define <vscale x 2 x i16> @vandn_vv_swapped_nxv2i16(<vscale x 2 x i16> %x, <vscale x 2 x i16> %y) {
634 ; CHECK-LABEL: vandn_vv_swapped_nxv2i16:
636 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
637 ; CHECK-NEXT: vnot.v v8, v8
638 ; CHECK-NEXT: vand.vv v8, v9, v8
641 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv2i16:
642 ; CHECK-ZVKB: # %bb.0:
643 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
644 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
645 ; CHECK-ZVKB-NEXT: ret
646 %a = xor <vscale x 2 x i16> %x, splat (i16 -1)
647 %b = and <vscale x 2 x i16> %y, %a
648 ret <vscale x 2 x i16> %b
651 define <vscale x 2 x i16> @vandn_vx_nxv2i16(i16 %x, <vscale x 2 x i16> %y) {
652 ; CHECK-LABEL: vandn_vx_nxv2i16:
654 ; CHECK-NEXT: not a0, a0
655 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
656 ; CHECK-NEXT: vand.vx v8, v8, a0
659 ; CHECK-ZVKB-LABEL: vandn_vx_nxv2i16:
660 ; CHECK-ZVKB: # %bb.0:
661 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
662 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
663 ; CHECK-ZVKB-NEXT: ret
665 %head = insertelement <vscale x 2 x i16> poison, i16 %a, i32 0
666 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
667 %b = and <vscale x 2 x i16> %splat, %y
668 ret <vscale x 2 x i16> %b
671 define <vscale x 2 x i16> @vandn_vx_swapped_nxv2i16(i16 %x, <vscale x 2 x i16> %y) {
672 ; CHECK-LABEL: vandn_vx_swapped_nxv2i16:
674 ; CHECK-NEXT: not a0, a0
675 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
676 ; CHECK-NEXT: vand.vx v8, v8, a0
679 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv2i16:
680 ; CHECK-ZVKB: # %bb.0:
681 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
682 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
683 ; CHECK-ZVKB-NEXT: ret
685 %head = insertelement <vscale x 2 x i16> poison, i16 %a, i32 0
686 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
687 %b = and <vscale x 2 x i16> %splat, %y
688 ret <vscale x 2 x i16> %b
691 define <vscale x 4 x i16> @vandn_vv_nxv4i16(<vscale x 4 x i16> %x, <vscale x 4 x i16> %y) {
692 ; CHECK-LABEL: vandn_vv_nxv4i16:
694 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
695 ; CHECK-NEXT: vnot.v v8, v8
696 ; CHECK-NEXT: vand.vv v8, v8, v9
699 ; CHECK-ZVKB-LABEL: vandn_vv_nxv4i16:
700 ; CHECK-ZVKB: # %bb.0:
701 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m1, ta, ma
702 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
703 ; CHECK-ZVKB-NEXT: ret
704 %a = xor <vscale x 4 x i16> %x, splat (i16 -1)
705 %b = and <vscale x 4 x i16> %a, %y
706 ret <vscale x 4 x i16> %b
709 define <vscale x 4 x i16> @vandn_vv_swapped_nxv4i16(<vscale x 4 x i16> %x, <vscale x 4 x i16> %y) {
710 ; CHECK-LABEL: vandn_vv_swapped_nxv4i16:
712 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
713 ; CHECK-NEXT: vnot.v v8, v8
714 ; CHECK-NEXT: vand.vv v8, v9, v8
717 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv4i16:
718 ; CHECK-ZVKB: # %bb.0:
719 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m1, ta, ma
720 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
721 ; CHECK-ZVKB-NEXT: ret
722 %a = xor <vscale x 4 x i16> %x, splat (i16 -1)
723 %b = and <vscale x 4 x i16> %y, %a
724 ret <vscale x 4 x i16> %b
727 define <vscale x 4 x i16> @vandn_vx_nxv4i16(i16 %x, <vscale x 4 x i16> %y) {
728 ; CHECK-LABEL: vandn_vx_nxv4i16:
730 ; CHECK-NEXT: not a0, a0
731 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
732 ; CHECK-NEXT: vand.vx v8, v8, a0
735 ; CHECK-ZVKB-LABEL: vandn_vx_nxv4i16:
736 ; CHECK-ZVKB: # %bb.0:
737 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m1, ta, ma
738 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
739 ; CHECK-ZVKB-NEXT: ret
741 %head = insertelement <vscale x 4 x i16> poison, i16 %a, i32 0
742 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
743 %b = and <vscale x 4 x i16> %splat, %y
744 ret <vscale x 4 x i16> %b
747 define <vscale x 4 x i16> @vandn_vx_swapped_nxv4i16(i16 %x, <vscale x 4 x i16> %y) {
748 ; CHECK-LABEL: vandn_vx_swapped_nxv4i16:
750 ; CHECK-NEXT: not a0, a0
751 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
752 ; CHECK-NEXT: vand.vx v8, v8, a0
755 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv4i16:
756 ; CHECK-ZVKB: # %bb.0:
757 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m1, ta, ma
758 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
759 ; CHECK-ZVKB-NEXT: ret
761 %head = insertelement <vscale x 4 x i16> poison, i16 %a, i32 0
762 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
763 %b = and <vscale x 4 x i16> %splat, %y
764 ret <vscale x 4 x i16> %b
767 define <vscale x 8 x i16> @vandn_vv_nxv8i16(<vscale x 8 x i16> %x, <vscale x 8 x i16> %y) {
768 ; CHECK-LABEL: vandn_vv_nxv8i16:
770 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
771 ; CHECK-NEXT: vnot.v v8, v8
772 ; CHECK-NEXT: vand.vv v8, v8, v10
775 ; CHECK-ZVKB-LABEL: vandn_vv_nxv8i16:
776 ; CHECK-ZVKB: # %bb.0:
777 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m2, ta, ma
778 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
779 ; CHECK-ZVKB-NEXT: ret
780 %a = xor <vscale x 8 x i16> %x, splat (i16 -1)
781 %b = and <vscale x 8 x i16> %a, %y
782 ret <vscale x 8 x i16> %b
785 define <vscale x 8 x i16> @vandn_vv_swapped_nxv8i16(<vscale x 8 x i16> %x, <vscale x 8 x i16> %y) {
786 ; CHECK-LABEL: vandn_vv_swapped_nxv8i16:
788 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
789 ; CHECK-NEXT: vnot.v v8, v8
790 ; CHECK-NEXT: vand.vv v8, v10, v8
793 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv8i16:
794 ; CHECK-ZVKB: # %bb.0:
795 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m2, ta, ma
796 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
797 ; CHECK-ZVKB-NEXT: ret
798 %a = xor <vscale x 8 x i16> %x, splat (i16 -1)
799 %b = and <vscale x 8 x i16> %y, %a
800 ret <vscale x 8 x i16> %b
803 define <vscale x 8 x i16> @vandn_vx_nxv8i16(i16 %x, <vscale x 8 x i16> %y) {
804 ; CHECK-LABEL: vandn_vx_nxv8i16:
806 ; CHECK-NEXT: not a0, a0
807 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
808 ; CHECK-NEXT: vand.vx v8, v8, a0
811 ; CHECK-ZVKB-LABEL: vandn_vx_nxv8i16:
812 ; CHECK-ZVKB: # %bb.0:
813 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m2, ta, ma
814 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
815 ; CHECK-ZVKB-NEXT: ret
817 %head = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
818 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
819 %b = and <vscale x 8 x i16> %splat, %y
820 ret <vscale x 8 x i16> %b
823 define <vscale x 8 x i16> @vandn_vx_swapped_nxv8i16(i16 %x, <vscale x 8 x i16> %y) {
824 ; CHECK-LABEL: vandn_vx_swapped_nxv8i16:
826 ; CHECK-NEXT: not a0, a0
827 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
828 ; CHECK-NEXT: vand.vx v8, v8, a0
831 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv8i16:
832 ; CHECK-ZVKB: # %bb.0:
833 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m2, ta, ma
834 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
835 ; CHECK-ZVKB-NEXT: ret
837 %head = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
838 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
839 %b = and <vscale x 8 x i16> %splat, %y
840 ret <vscale x 8 x i16> %b
843 define <vscale x 16 x i16> @vandn_vv_nxv16i16(<vscale x 16 x i16> %x, <vscale x 16 x i16> %y) {
844 ; CHECK-LABEL: vandn_vv_nxv16i16:
846 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
847 ; CHECK-NEXT: vnot.v v8, v8
848 ; CHECK-NEXT: vand.vv v8, v8, v12
851 ; CHECK-ZVKB-LABEL: vandn_vv_nxv16i16:
852 ; CHECK-ZVKB: # %bb.0:
853 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m4, ta, ma
854 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
855 ; CHECK-ZVKB-NEXT: ret
856 %a = xor <vscale x 16 x i16> %x, splat (i16 -1)
857 %b = and <vscale x 16 x i16> %a, %y
858 ret <vscale x 16 x i16> %b
861 define <vscale x 16 x i16> @vandn_vv_swapped_nxv16i16(<vscale x 16 x i16> %x, <vscale x 16 x i16> %y) {
862 ; CHECK-LABEL: vandn_vv_swapped_nxv16i16:
864 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
865 ; CHECK-NEXT: vnot.v v8, v8
866 ; CHECK-NEXT: vand.vv v8, v12, v8
869 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv16i16:
870 ; CHECK-ZVKB: # %bb.0:
871 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m4, ta, ma
872 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
873 ; CHECK-ZVKB-NEXT: ret
874 %a = xor <vscale x 16 x i16> %x, splat (i16 -1)
875 %b = and <vscale x 16 x i16> %y, %a
876 ret <vscale x 16 x i16> %b
879 define <vscale x 16 x i16> @vandn_vx_nxv16i16(i16 %x, <vscale x 16 x i16> %y) {
880 ; CHECK-LABEL: vandn_vx_nxv16i16:
882 ; CHECK-NEXT: not a0, a0
883 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
884 ; CHECK-NEXT: vand.vx v8, v8, a0
887 ; CHECK-ZVKB-LABEL: vandn_vx_nxv16i16:
888 ; CHECK-ZVKB: # %bb.0:
889 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m4, ta, ma
890 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
891 ; CHECK-ZVKB-NEXT: ret
893 %head = insertelement <vscale x 16 x i16> poison, i16 %a, i32 0
894 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
895 %b = and <vscale x 16 x i16> %splat, %y
896 ret <vscale x 16 x i16> %b
899 define <vscale x 16 x i16> @vandn_vx_swapped_nxv16i16(i16 %x, <vscale x 16 x i16> %y) {
900 ; CHECK-LABEL: vandn_vx_swapped_nxv16i16:
902 ; CHECK-NEXT: not a0, a0
903 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
904 ; CHECK-NEXT: vand.vx v8, v8, a0
907 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv16i16:
908 ; CHECK-ZVKB: # %bb.0:
909 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m4, ta, ma
910 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
911 ; CHECK-ZVKB-NEXT: ret
913 %head = insertelement <vscale x 16 x i16> poison, i16 %a, i32 0
914 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
915 %b = and <vscale x 16 x i16> %splat, %y
916 ret <vscale x 16 x i16> %b
919 define <vscale x 32 x i16> @vandn_vv_nxv32i16(<vscale x 32 x i16> %x, <vscale x 32 x i16> %y) {
920 ; CHECK-LABEL: vandn_vv_nxv32i16:
922 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
923 ; CHECK-NEXT: vnot.v v8, v8
924 ; CHECK-NEXT: vand.vv v8, v8, v16
927 ; CHECK-ZVKB-LABEL: vandn_vv_nxv32i16:
928 ; CHECK-ZVKB: # %bb.0:
929 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m8, ta, ma
930 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
931 ; CHECK-ZVKB-NEXT: ret
932 %a = xor <vscale x 32 x i16> %x, splat (i16 -1)
933 %b = and <vscale x 32 x i16> %a, %y
934 ret <vscale x 32 x i16> %b
937 define <vscale x 32 x i16> @vandn_vv_swapped_nxv32i16(<vscale x 32 x i16> %x, <vscale x 32 x i16> %y) {
938 ; CHECK-LABEL: vandn_vv_swapped_nxv32i16:
940 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
941 ; CHECK-NEXT: vnot.v v8, v8
942 ; CHECK-NEXT: vand.vv v8, v16, v8
945 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv32i16:
946 ; CHECK-ZVKB: # %bb.0:
947 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m8, ta, ma
948 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
949 ; CHECK-ZVKB-NEXT: ret
950 %a = xor <vscale x 32 x i16> %x, splat (i16 -1)
951 %b = and <vscale x 32 x i16> %y, %a
952 ret <vscale x 32 x i16> %b
955 define <vscale x 32 x i16> @vandn_vx_nxv32i16(i16 %x, <vscale x 32 x i16> %y) {
956 ; CHECK-LABEL: vandn_vx_nxv32i16:
958 ; CHECK-NEXT: not a0, a0
959 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
960 ; CHECK-NEXT: vand.vx v8, v8, a0
963 ; CHECK-ZVKB-LABEL: vandn_vx_nxv32i16:
964 ; CHECK-ZVKB: # %bb.0:
965 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m8, ta, ma
966 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
967 ; CHECK-ZVKB-NEXT: ret
969 %head = insertelement <vscale x 32 x i16> poison, i16 %a, i32 0
970 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
971 %b = and <vscale x 32 x i16> %splat, %y
972 ret <vscale x 32 x i16> %b
975 define <vscale x 32 x i16> @vandn_vx_swapped_nxv32i16(i16 %x, <vscale x 32 x i16> %y) {
976 ; CHECK-LABEL: vandn_vx_swapped_nxv32i16:
978 ; CHECK-NEXT: not a0, a0
979 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
980 ; CHECK-NEXT: vand.vx v8, v8, a0
983 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv32i16:
984 ; CHECK-ZVKB: # %bb.0:
985 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m8, ta, ma
986 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
987 ; CHECK-ZVKB-NEXT: ret
989 %head = insertelement <vscale x 32 x i16> poison, i16 %a, i32 0
990 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
991 %b = and <vscale x 32 x i16> %splat, %y
992 ret <vscale x 32 x i16> %b
995 define <vscale x 1 x i32> @vandn_vv_nxv1i32(<vscale x 1 x i32> %x, <vscale x 1 x i32> %y) {
996 ; CHECK-LABEL: vandn_vv_nxv1i32:
998 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
999 ; CHECK-NEXT: vnot.v v8, v8
1000 ; CHECK-NEXT: vand.vv v8, v8, v9
1003 ; CHECK-ZVKB-LABEL: vandn_vv_nxv1i32:
1004 ; CHECK-ZVKB: # %bb.0:
1005 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
1006 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1007 ; CHECK-ZVKB-NEXT: ret
1008 %a = xor <vscale x 1 x i32> %x, splat (i32 -1)
1009 %b = and <vscale x 1 x i32> %a, %y
1010 ret <vscale x 1 x i32> %b
1013 define <vscale x 1 x i32> @vandn_vv_swapped_nxv1i32(<vscale x 1 x i32> %x, <vscale x 1 x i32> %y) {
1014 ; CHECK-LABEL: vandn_vv_swapped_nxv1i32:
1016 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
1017 ; CHECK-NEXT: vnot.v v8, v8
1018 ; CHECK-NEXT: vand.vv v8, v9, v8
1021 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv1i32:
1022 ; CHECK-ZVKB: # %bb.0:
1023 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
1024 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1025 ; CHECK-ZVKB-NEXT: ret
1026 %a = xor <vscale x 1 x i32> %x, splat (i32 -1)
1027 %b = and <vscale x 1 x i32> %y, %a
1028 ret <vscale x 1 x i32> %b
1031 define <vscale x 1 x i32> @vandn_vx_nxv1i32(i32 %x, <vscale x 1 x i32> %y) {
1032 ; CHECK-LABEL: vandn_vx_nxv1i32:
1034 ; CHECK-NEXT: not a0, a0
1035 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1036 ; CHECK-NEXT: vand.vx v8, v8, a0
1039 ; CHECK-ZVKB-LABEL: vandn_vx_nxv1i32:
1040 ; CHECK-ZVKB: # %bb.0:
1041 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1042 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1043 ; CHECK-ZVKB-NEXT: ret
1045 %head = insertelement <vscale x 1 x i32> poison, i32 %a, i32 0
1046 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1047 %b = and <vscale x 1 x i32> %splat, %y
1048 ret <vscale x 1 x i32> %b
1051 define <vscale x 1 x i32> @vandn_vx_swapped_nxv1i32(i32 %x, <vscale x 1 x i32> %y) {
1052 ; CHECK-LABEL: vandn_vx_swapped_nxv1i32:
1054 ; CHECK-NEXT: not a0, a0
1055 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1056 ; CHECK-NEXT: vand.vx v8, v8, a0
1059 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv1i32:
1060 ; CHECK-ZVKB: # %bb.0:
1061 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1062 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1063 ; CHECK-ZVKB-NEXT: ret
1065 %head = insertelement <vscale x 1 x i32> poison, i32 %a, i32 0
1066 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1067 %b = and <vscale x 1 x i32> %splat, %y
1068 ret <vscale x 1 x i32> %b
1071 define <vscale x 2 x i32> @vandn_vv_nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) {
1072 ; CHECK-LABEL: vandn_vv_nxv2i32:
1074 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1075 ; CHECK-NEXT: vnot.v v8, v8
1076 ; CHECK-NEXT: vand.vv v8, v8, v9
1079 ; CHECK-ZVKB-LABEL: vandn_vv_nxv2i32:
1080 ; CHECK-ZVKB: # %bb.0:
1081 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1082 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1083 ; CHECK-ZVKB-NEXT: ret
1084 %a = xor <vscale x 2 x i32> %x, splat (i32 -1)
1085 %b = and <vscale x 2 x i32> %a, %y
1086 ret <vscale x 2 x i32> %b
1089 define <vscale x 2 x i32> @vandn_vv_swapped_nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) {
1090 ; CHECK-LABEL: vandn_vv_swapped_nxv2i32:
1092 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1093 ; CHECK-NEXT: vnot.v v8, v8
1094 ; CHECK-NEXT: vand.vv v8, v9, v8
1097 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv2i32:
1098 ; CHECK-ZVKB: # %bb.0:
1099 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1100 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1101 ; CHECK-ZVKB-NEXT: ret
1102 %a = xor <vscale x 2 x i32> %x, splat (i32 -1)
1103 %b = and <vscale x 2 x i32> %y, %a
1104 ret <vscale x 2 x i32> %b
1107 define <vscale x 2 x i32> @vandn_vx_nxv2i32(i32 %x, <vscale x 2 x i32> %y) {
1108 ; CHECK-LABEL: vandn_vx_nxv2i32:
1110 ; CHECK-NEXT: not a0, a0
1111 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1112 ; CHECK-NEXT: vand.vx v8, v8, a0
1115 ; CHECK-ZVKB-LABEL: vandn_vx_nxv2i32:
1116 ; CHECK-ZVKB: # %bb.0:
1117 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1118 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1119 ; CHECK-ZVKB-NEXT: ret
1121 %head = insertelement <vscale x 2 x i32> poison, i32 %a, i32 0
1122 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1123 %b = and <vscale x 2 x i32> %splat, %y
1124 ret <vscale x 2 x i32> %b
1127 define <vscale x 2 x i32> @vandn_vx_swapped_nxv2i32(i32 %x, <vscale x 2 x i32> %y) {
1128 ; CHECK-LABEL: vandn_vx_swapped_nxv2i32:
1130 ; CHECK-NEXT: not a0, a0
1131 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1132 ; CHECK-NEXT: vand.vx v8, v8, a0
1135 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv2i32:
1136 ; CHECK-ZVKB: # %bb.0:
1137 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1138 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1139 ; CHECK-ZVKB-NEXT: ret
1141 %head = insertelement <vscale x 2 x i32> poison, i32 %a, i32 0
1142 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1143 %b = and <vscale x 2 x i32> %splat, %y
1144 ret <vscale x 2 x i32> %b
1147 define <vscale x 4 x i32> @vandn_vv_nxv4i32(<vscale x 4 x i32> %x, <vscale x 4 x i32> %y) {
1148 ; CHECK-LABEL: vandn_vv_nxv4i32:
1150 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1151 ; CHECK-NEXT: vnot.v v8, v8
1152 ; CHECK-NEXT: vand.vv v8, v8, v10
1155 ; CHECK-ZVKB-LABEL: vandn_vv_nxv4i32:
1156 ; CHECK-ZVKB: # %bb.0:
1157 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1158 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
1159 ; CHECK-ZVKB-NEXT: ret
1160 %a = xor <vscale x 4 x i32> %x, splat (i32 -1)
1161 %b = and <vscale x 4 x i32> %a, %y
1162 ret <vscale x 4 x i32> %b
1165 define <vscale x 4 x i32> @vandn_vv_swapped_nxv4i32(<vscale x 4 x i32> %x, <vscale x 4 x i32> %y) {
1166 ; CHECK-LABEL: vandn_vv_swapped_nxv4i32:
1168 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1169 ; CHECK-NEXT: vnot.v v8, v8
1170 ; CHECK-NEXT: vand.vv v8, v10, v8
1173 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv4i32:
1174 ; CHECK-ZVKB: # %bb.0:
1175 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1176 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
1177 ; CHECK-ZVKB-NEXT: ret
1178 %a = xor <vscale x 4 x i32> %x, splat (i32 -1)
1179 %b = and <vscale x 4 x i32> %y, %a
1180 ret <vscale x 4 x i32> %b
1183 define <vscale x 4 x i32> @vandn_vx_nxv4i32(i32 %x, <vscale x 4 x i32> %y) {
1184 ; CHECK-LABEL: vandn_vx_nxv4i32:
1186 ; CHECK-NEXT: not a0, a0
1187 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1188 ; CHECK-NEXT: vand.vx v8, v8, a0
1191 ; CHECK-ZVKB-LABEL: vandn_vx_nxv4i32:
1192 ; CHECK-ZVKB: # %bb.0:
1193 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1194 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1195 ; CHECK-ZVKB-NEXT: ret
1197 %head = insertelement <vscale x 4 x i32> poison, i32 %a, i32 0
1198 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1199 %b = and <vscale x 4 x i32> %splat, %y
1200 ret <vscale x 4 x i32> %b
1203 define <vscale x 4 x i32> @vandn_vx_swapped_nxv4i32(i32 %x, <vscale x 4 x i32> %y) {
1204 ; CHECK-LABEL: vandn_vx_swapped_nxv4i32:
1206 ; CHECK-NEXT: not a0, a0
1207 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1208 ; CHECK-NEXT: vand.vx v8, v8, a0
1211 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv4i32:
1212 ; CHECK-ZVKB: # %bb.0:
1213 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1214 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1215 ; CHECK-ZVKB-NEXT: ret
1217 %head = insertelement <vscale x 4 x i32> poison, i32 %a, i32 0
1218 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1219 %b = and <vscale x 4 x i32> %splat, %y
1220 ret <vscale x 4 x i32> %b
1223 define <vscale x 8 x i32> @vandn_vv_nxv8i32(<vscale x 8 x i32> %x, <vscale x 8 x i32> %y) {
1224 ; CHECK-LABEL: vandn_vv_nxv8i32:
1226 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1227 ; CHECK-NEXT: vnot.v v8, v8
1228 ; CHECK-NEXT: vand.vv v8, v8, v12
1231 ; CHECK-ZVKB-LABEL: vandn_vv_nxv8i32:
1232 ; CHECK-ZVKB: # %bb.0:
1233 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1234 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
1235 ; CHECK-ZVKB-NEXT: ret
1236 %a = xor <vscale x 8 x i32> %x, splat (i32 -1)
1237 %b = and <vscale x 8 x i32> %a, %y
1238 ret <vscale x 8 x i32> %b
1241 define <vscale x 8 x i32> @vandn_vv_swapped_nxv8i32(<vscale x 8 x i32> %x, <vscale x 8 x i32> %y) {
1242 ; CHECK-LABEL: vandn_vv_swapped_nxv8i32:
1244 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1245 ; CHECK-NEXT: vnot.v v8, v8
1246 ; CHECK-NEXT: vand.vv v8, v12, v8
1249 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv8i32:
1250 ; CHECK-ZVKB: # %bb.0:
1251 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1252 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
1253 ; CHECK-ZVKB-NEXT: ret
1254 %a = xor <vscale x 8 x i32> %x, splat (i32 -1)
1255 %b = and <vscale x 8 x i32> %y, %a
1256 ret <vscale x 8 x i32> %b
1259 define <vscale x 8 x i32> @vandn_vx_nxv8i32(i32 %x, <vscale x 8 x i32> %y) {
1260 ; CHECK-LABEL: vandn_vx_nxv8i32:
1262 ; CHECK-NEXT: not a0, a0
1263 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1264 ; CHECK-NEXT: vand.vx v8, v8, a0
1267 ; CHECK-ZVKB-LABEL: vandn_vx_nxv8i32:
1268 ; CHECK-ZVKB: # %bb.0:
1269 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1270 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1271 ; CHECK-ZVKB-NEXT: ret
1273 %head = insertelement <vscale x 8 x i32> poison, i32 %a, i32 0
1274 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1275 %b = and <vscale x 8 x i32> %splat, %y
1276 ret <vscale x 8 x i32> %b
1279 define <vscale x 8 x i32> @vandn_vx_swapped_nxv8i32(i32 %x, <vscale x 8 x i32> %y) {
1280 ; CHECK-LABEL: vandn_vx_swapped_nxv8i32:
1282 ; CHECK-NEXT: not a0, a0
1283 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1284 ; CHECK-NEXT: vand.vx v8, v8, a0
1287 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv8i32:
1288 ; CHECK-ZVKB: # %bb.0:
1289 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1290 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1291 ; CHECK-ZVKB-NEXT: ret
1293 %head = insertelement <vscale x 8 x i32> poison, i32 %a, i32 0
1294 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1295 %b = and <vscale x 8 x i32> %splat, %y
1296 ret <vscale x 8 x i32> %b
1299 define <vscale x 16 x i32> @vandn_vv_nxv16i32(<vscale x 16 x i32> %x, <vscale x 16 x i32> %y) {
1300 ; CHECK-LABEL: vandn_vv_nxv16i32:
1302 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
1303 ; CHECK-NEXT: vnot.v v8, v8
1304 ; CHECK-NEXT: vand.vv v8, v8, v16
1307 ; CHECK-ZVKB-LABEL: vandn_vv_nxv16i32:
1308 ; CHECK-ZVKB: # %bb.0:
1309 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m8, ta, ma
1310 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
1311 ; CHECK-ZVKB-NEXT: ret
1312 %a = xor <vscale x 16 x i32> %x, splat (i32 -1)
1313 %b = and <vscale x 16 x i32> %a, %y
1314 ret <vscale x 16 x i32> %b
1317 define <vscale x 16 x i32> @vandn_vv_swapped_nxv16i32(<vscale x 16 x i32> %x, <vscale x 16 x i32> %y) {
1318 ; CHECK-LABEL: vandn_vv_swapped_nxv16i32:
1320 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
1321 ; CHECK-NEXT: vnot.v v8, v8
1322 ; CHECK-NEXT: vand.vv v8, v16, v8
1325 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv16i32:
1326 ; CHECK-ZVKB: # %bb.0:
1327 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m8, ta, ma
1328 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
1329 ; CHECK-ZVKB-NEXT: ret
1330 %a = xor <vscale x 16 x i32> %x, splat (i32 -1)
1331 %b = and <vscale x 16 x i32> %y, %a
1332 ret <vscale x 16 x i32> %b
1335 define <vscale x 16 x i32> @vandn_vx_nxv16i32(i32 %x, <vscale x 16 x i32> %y) {
1336 ; CHECK-LABEL: vandn_vx_nxv16i32:
1338 ; CHECK-NEXT: not a0, a0
1339 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1340 ; CHECK-NEXT: vand.vx v8, v8, a0
1343 ; CHECK-ZVKB-LABEL: vandn_vx_nxv16i32:
1344 ; CHECK-ZVKB: # %bb.0:
1345 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1346 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1347 ; CHECK-ZVKB-NEXT: ret
1349 %head = insertelement <vscale x 16 x i32> poison, i32 %a, i32 0
1350 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1351 %b = and <vscale x 16 x i32> %splat, %y
1352 ret <vscale x 16 x i32> %b
1355 define <vscale x 16 x i32> @vandn_vx_swapped_nxv16i32(i32 %x, <vscale x 16 x i32> %y) {
1356 ; CHECK-LABEL: vandn_vx_swapped_nxv16i32:
1358 ; CHECK-NEXT: not a0, a0
1359 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1360 ; CHECK-NEXT: vand.vx v8, v8, a0
1363 ; CHECK-ZVKB-LABEL: vandn_vx_swapped_nxv16i32:
1364 ; CHECK-ZVKB: # %bb.0:
1365 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1366 ; CHECK-ZVKB-NEXT: vandn.vx v8, v8, a0
1367 ; CHECK-ZVKB-NEXT: ret
1369 %head = insertelement <vscale x 16 x i32> poison, i32 %a, i32 0
1370 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1371 %b = and <vscale x 16 x i32> %splat, %y
1372 ret <vscale x 16 x i32> %b
1375 define <vscale x 1 x i64> @vandn_vv_nxv1i64(<vscale x 1 x i64> %x, <vscale x 1 x i64> %y) {
1376 ; CHECK-LABEL: vandn_vv_nxv1i64:
1378 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1379 ; CHECK-NEXT: vnot.v v8, v8
1380 ; CHECK-NEXT: vand.vv v8, v8, v9
1383 ; CHECK-ZVKB-LABEL: vandn_vv_nxv1i64:
1384 ; CHECK-ZVKB: # %bb.0:
1385 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1386 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1387 ; CHECK-ZVKB-NEXT: ret
1388 %a = xor <vscale x 1 x i64> %x, splat (i64 -1)
1389 %b = and <vscale x 1 x i64> %a, %y
1390 ret <vscale x 1 x i64> %b
1393 define <vscale x 1 x i64> @vandn_vv_swapped_nxv1i64(<vscale x 1 x i64> %x, <vscale x 1 x i64> %y) {
1394 ; CHECK-LABEL: vandn_vv_swapped_nxv1i64:
1396 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1397 ; CHECK-NEXT: vnot.v v8, v8
1398 ; CHECK-NEXT: vand.vv v8, v9, v8
1401 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv1i64:
1402 ; CHECK-ZVKB: # %bb.0:
1403 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1404 ; CHECK-ZVKB-NEXT: vandn.vv v8, v9, v8
1405 ; CHECK-ZVKB-NEXT: ret
1406 %a = xor <vscale x 1 x i64> %x, splat (i64 -1)
1407 %b = and <vscale x 1 x i64> %y, %a
1408 ret <vscale x 1 x i64> %b
1411 define <vscale x 1 x i64> @vandn_vx_nxv1i64(i64 %x, <vscale x 1 x i64> %y) {
1412 ; CHECK-RV32-LABEL: vandn_vx_nxv1i64:
1413 ; CHECK-RV32: # %bb.0:
1414 ; CHECK-RV32-NEXT: addi sp, sp, -16
1415 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1416 ; CHECK-RV32-NEXT: not a0, a0
1417 ; CHECK-RV32-NEXT: not a1, a1
1418 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1419 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1420 ; CHECK-RV32-NEXT: addi a0, sp, 8
1421 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1422 ; CHECK-RV32-NEXT: vlse64.v v9, (a0), zero
1423 ; CHECK-RV32-NEXT: vand.vv v8, v9, v8
1424 ; CHECK-RV32-NEXT: addi sp, sp, 16
1425 ; CHECK-RV32-NEXT: ret
1427 ; CHECK-RV64-LABEL: vandn_vx_nxv1i64:
1428 ; CHECK-RV64: # %bb.0:
1429 ; CHECK-RV64-NEXT: not a0, a0
1430 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1431 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1432 ; CHECK-RV64-NEXT: ret
1434 ; CHECK-ZVKB32-LABEL: vandn_vx_nxv1i64:
1435 ; CHECK-ZVKB32: # %bb.0:
1436 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1437 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1438 ; CHECK-ZVKB32-NEXT: not a0, a0
1439 ; CHECK-ZVKB32-NEXT: not a1, a1
1440 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1441 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1442 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1443 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1444 ; CHECK-ZVKB32-NEXT: vlse64.v v9, (a0), zero
1445 ; CHECK-ZVKB32-NEXT: vand.vv v8, v9, v8
1446 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1447 ; CHECK-ZVKB32-NEXT: ret
1449 ; CHECK-ZVKB64-LABEL: vandn_vx_nxv1i64:
1450 ; CHECK-ZVKB64: # %bb.0:
1451 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1452 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1453 ; CHECK-ZVKB64-NEXT: ret
1455 %head = insertelement <vscale x 1 x i64> poison, i64 %a, i32 0
1456 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1457 %b = and <vscale x 1 x i64> %splat, %y
1458 ret <vscale x 1 x i64> %b
1461 define <vscale x 1 x i64> @vandn_vx_swapped_nxv1i64(i64 %x, <vscale x 1 x i64> %y) {
1462 ; CHECK-RV32-LABEL: vandn_vx_swapped_nxv1i64:
1463 ; CHECK-RV32: # %bb.0:
1464 ; CHECK-RV32-NEXT: addi sp, sp, -16
1465 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1466 ; CHECK-RV32-NEXT: not a0, a0
1467 ; CHECK-RV32-NEXT: not a1, a1
1468 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1469 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1470 ; CHECK-RV32-NEXT: addi a0, sp, 8
1471 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1472 ; CHECK-RV32-NEXT: vlse64.v v9, (a0), zero
1473 ; CHECK-RV32-NEXT: vand.vv v8, v9, v8
1474 ; CHECK-RV32-NEXT: addi sp, sp, 16
1475 ; CHECK-RV32-NEXT: ret
1477 ; CHECK-RV64-LABEL: vandn_vx_swapped_nxv1i64:
1478 ; CHECK-RV64: # %bb.0:
1479 ; CHECK-RV64-NEXT: not a0, a0
1480 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1481 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1482 ; CHECK-RV64-NEXT: ret
1484 ; CHECK-ZVKB32-LABEL: vandn_vx_swapped_nxv1i64:
1485 ; CHECK-ZVKB32: # %bb.0:
1486 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1487 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1488 ; CHECK-ZVKB32-NEXT: not a0, a0
1489 ; CHECK-ZVKB32-NEXT: not a1, a1
1490 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1491 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1492 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1493 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1494 ; CHECK-ZVKB32-NEXT: vlse64.v v9, (a0), zero
1495 ; CHECK-ZVKB32-NEXT: vand.vv v8, v9, v8
1496 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1497 ; CHECK-ZVKB32-NEXT: ret
1499 ; CHECK-ZVKB64-LABEL: vandn_vx_swapped_nxv1i64:
1500 ; CHECK-ZVKB64: # %bb.0:
1501 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1502 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1503 ; CHECK-ZVKB64-NEXT: ret
1505 %head = insertelement <vscale x 1 x i64> poison, i64 %a, i32 0
1506 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1507 %b = and <vscale x 1 x i64> %splat, %y
1508 ret <vscale x 1 x i64> %b
1511 define <vscale x 2 x i64> @vandn_vv_nxv2i64(<vscale x 2 x i64> %x, <vscale x 2 x i64> %y) {
1512 ; CHECK-LABEL: vandn_vv_nxv2i64:
1514 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
1515 ; CHECK-NEXT: vnot.v v8, v8
1516 ; CHECK-NEXT: vand.vv v8, v8, v10
1519 ; CHECK-ZVKB-LABEL: vandn_vv_nxv2i64:
1520 ; CHECK-ZVKB: # %bb.0:
1521 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m2, ta, ma
1522 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
1523 ; CHECK-ZVKB-NEXT: ret
1524 %a = xor <vscale x 2 x i64> %x, splat (i64 -1)
1525 %b = and <vscale x 2 x i64> %a, %y
1526 ret <vscale x 2 x i64> %b
1529 define <vscale x 2 x i64> @vandn_vv_swapped_nxv2i64(<vscale x 2 x i64> %x, <vscale x 2 x i64> %y) {
1530 ; CHECK-LABEL: vandn_vv_swapped_nxv2i64:
1532 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
1533 ; CHECK-NEXT: vnot.v v8, v8
1534 ; CHECK-NEXT: vand.vv v8, v10, v8
1537 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv2i64:
1538 ; CHECK-ZVKB: # %bb.0:
1539 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m2, ta, ma
1540 ; CHECK-ZVKB-NEXT: vandn.vv v8, v10, v8
1541 ; CHECK-ZVKB-NEXT: ret
1542 %a = xor <vscale x 2 x i64> %x, splat (i64 -1)
1543 %b = and <vscale x 2 x i64> %y, %a
1544 ret <vscale x 2 x i64> %b
1547 define <vscale x 2 x i64> @vandn_vx_nxv2i64(i64 %x, <vscale x 2 x i64> %y) {
1548 ; CHECK-RV32-LABEL: vandn_vx_nxv2i64:
1549 ; CHECK-RV32: # %bb.0:
1550 ; CHECK-RV32-NEXT: addi sp, sp, -16
1551 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1552 ; CHECK-RV32-NEXT: not a0, a0
1553 ; CHECK-RV32-NEXT: not a1, a1
1554 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1555 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1556 ; CHECK-RV32-NEXT: addi a0, sp, 8
1557 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1558 ; CHECK-RV32-NEXT: vlse64.v v10, (a0), zero
1559 ; CHECK-RV32-NEXT: vand.vv v8, v10, v8
1560 ; CHECK-RV32-NEXT: addi sp, sp, 16
1561 ; CHECK-RV32-NEXT: ret
1563 ; CHECK-RV64-LABEL: vandn_vx_nxv2i64:
1564 ; CHECK-RV64: # %bb.0:
1565 ; CHECK-RV64-NEXT: not a0, a0
1566 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1567 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1568 ; CHECK-RV64-NEXT: ret
1570 ; CHECK-ZVKB32-LABEL: vandn_vx_nxv2i64:
1571 ; CHECK-ZVKB32: # %bb.0:
1572 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1573 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1574 ; CHECK-ZVKB32-NEXT: not a0, a0
1575 ; CHECK-ZVKB32-NEXT: not a1, a1
1576 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1577 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1578 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1579 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1580 ; CHECK-ZVKB32-NEXT: vlse64.v v10, (a0), zero
1581 ; CHECK-ZVKB32-NEXT: vand.vv v8, v10, v8
1582 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1583 ; CHECK-ZVKB32-NEXT: ret
1585 ; CHECK-ZVKB64-LABEL: vandn_vx_nxv2i64:
1586 ; CHECK-ZVKB64: # %bb.0:
1587 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1588 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1589 ; CHECK-ZVKB64-NEXT: ret
1591 %head = insertelement <vscale x 2 x i64> poison, i64 %a, i32 0
1592 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1593 %b = and <vscale x 2 x i64> %splat, %y
1594 ret <vscale x 2 x i64> %b
1597 define <vscale x 2 x i64> @vandn_vx_swapped_nxv2i64(i64 %x, <vscale x 2 x i64> %y) {
1598 ; CHECK-RV32-LABEL: vandn_vx_swapped_nxv2i64:
1599 ; CHECK-RV32: # %bb.0:
1600 ; CHECK-RV32-NEXT: addi sp, sp, -16
1601 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1602 ; CHECK-RV32-NEXT: not a0, a0
1603 ; CHECK-RV32-NEXT: not a1, a1
1604 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1605 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1606 ; CHECK-RV32-NEXT: addi a0, sp, 8
1607 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1608 ; CHECK-RV32-NEXT: vlse64.v v10, (a0), zero
1609 ; CHECK-RV32-NEXT: vand.vv v8, v10, v8
1610 ; CHECK-RV32-NEXT: addi sp, sp, 16
1611 ; CHECK-RV32-NEXT: ret
1613 ; CHECK-RV64-LABEL: vandn_vx_swapped_nxv2i64:
1614 ; CHECK-RV64: # %bb.0:
1615 ; CHECK-RV64-NEXT: not a0, a0
1616 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1617 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1618 ; CHECK-RV64-NEXT: ret
1620 ; CHECK-ZVKB32-LABEL: vandn_vx_swapped_nxv2i64:
1621 ; CHECK-ZVKB32: # %bb.0:
1622 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1623 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1624 ; CHECK-ZVKB32-NEXT: not a0, a0
1625 ; CHECK-ZVKB32-NEXT: not a1, a1
1626 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1627 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1628 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1629 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1630 ; CHECK-ZVKB32-NEXT: vlse64.v v10, (a0), zero
1631 ; CHECK-ZVKB32-NEXT: vand.vv v8, v10, v8
1632 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1633 ; CHECK-ZVKB32-NEXT: ret
1635 ; CHECK-ZVKB64-LABEL: vandn_vx_swapped_nxv2i64:
1636 ; CHECK-ZVKB64: # %bb.0:
1637 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1638 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1639 ; CHECK-ZVKB64-NEXT: ret
1641 %head = insertelement <vscale x 2 x i64> poison, i64 %a, i32 0
1642 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1643 %b = and <vscale x 2 x i64> %splat, %y
1644 ret <vscale x 2 x i64> %b
1647 define <vscale x 4 x i64> @vandn_vv_nxv4i64(<vscale x 4 x i64> %x, <vscale x 4 x i64> %y) {
1648 ; CHECK-LABEL: vandn_vv_nxv4i64:
1650 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1651 ; CHECK-NEXT: vnot.v v8, v8
1652 ; CHECK-NEXT: vand.vv v8, v8, v12
1655 ; CHECK-ZVKB-LABEL: vandn_vv_nxv4i64:
1656 ; CHECK-ZVKB: # %bb.0:
1657 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1658 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
1659 ; CHECK-ZVKB-NEXT: ret
1660 %a = xor <vscale x 4 x i64> %x, splat (i64 -1)
1661 %b = and <vscale x 4 x i64> %a, %y
1662 ret <vscale x 4 x i64> %b
1665 define <vscale x 4 x i64> @vandn_vv_swapped_nxv4i64(<vscale x 4 x i64> %x, <vscale x 4 x i64> %y) {
1666 ; CHECK-LABEL: vandn_vv_swapped_nxv4i64:
1668 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1669 ; CHECK-NEXT: vnot.v v8, v8
1670 ; CHECK-NEXT: vand.vv v8, v12, v8
1673 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv4i64:
1674 ; CHECK-ZVKB: # %bb.0:
1675 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1676 ; CHECK-ZVKB-NEXT: vandn.vv v8, v12, v8
1677 ; CHECK-ZVKB-NEXT: ret
1678 %a = xor <vscale x 4 x i64> %x, splat (i64 -1)
1679 %b = and <vscale x 4 x i64> %y, %a
1680 ret <vscale x 4 x i64> %b
1683 define <vscale x 4 x i64> @vandn_vx_nxv4i64(i64 %x, <vscale x 4 x i64> %y) {
1684 ; CHECK-RV32-LABEL: vandn_vx_nxv4i64:
1685 ; CHECK-RV32: # %bb.0:
1686 ; CHECK-RV32-NEXT: addi sp, sp, -16
1687 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1688 ; CHECK-RV32-NEXT: not a0, a0
1689 ; CHECK-RV32-NEXT: not a1, a1
1690 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1691 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1692 ; CHECK-RV32-NEXT: addi a0, sp, 8
1693 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1694 ; CHECK-RV32-NEXT: vlse64.v v12, (a0), zero
1695 ; CHECK-RV32-NEXT: vand.vv v8, v12, v8
1696 ; CHECK-RV32-NEXT: addi sp, sp, 16
1697 ; CHECK-RV32-NEXT: ret
1699 ; CHECK-RV64-LABEL: vandn_vx_nxv4i64:
1700 ; CHECK-RV64: # %bb.0:
1701 ; CHECK-RV64-NEXT: not a0, a0
1702 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1703 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1704 ; CHECK-RV64-NEXT: ret
1706 ; CHECK-ZVKB32-LABEL: vandn_vx_nxv4i64:
1707 ; CHECK-ZVKB32: # %bb.0:
1708 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1709 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1710 ; CHECK-ZVKB32-NEXT: not a0, a0
1711 ; CHECK-ZVKB32-NEXT: not a1, a1
1712 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1713 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1714 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1715 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1716 ; CHECK-ZVKB32-NEXT: vlse64.v v12, (a0), zero
1717 ; CHECK-ZVKB32-NEXT: vand.vv v8, v12, v8
1718 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1719 ; CHECK-ZVKB32-NEXT: ret
1721 ; CHECK-ZVKB64-LABEL: vandn_vx_nxv4i64:
1722 ; CHECK-ZVKB64: # %bb.0:
1723 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1724 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1725 ; CHECK-ZVKB64-NEXT: ret
1727 %head = insertelement <vscale x 4 x i64> poison, i64 %a, i32 0
1728 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1729 %b = and <vscale x 4 x i64> %splat, %y
1730 ret <vscale x 4 x i64> %b
1733 define <vscale x 4 x i64> @vandn_vx_swapped_nxv4i64(i64 %x, <vscale x 4 x i64> %y) {
1734 ; CHECK-RV32-LABEL: vandn_vx_swapped_nxv4i64:
1735 ; CHECK-RV32: # %bb.0:
1736 ; CHECK-RV32-NEXT: addi sp, sp, -16
1737 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1738 ; CHECK-RV32-NEXT: not a0, a0
1739 ; CHECK-RV32-NEXT: not a1, a1
1740 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1741 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1742 ; CHECK-RV32-NEXT: addi a0, sp, 8
1743 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1744 ; CHECK-RV32-NEXT: vlse64.v v12, (a0), zero
1745 ; CHECK-RV32-NEXT: vand.vv v8, v12, v8
1746 ; CHECK-RV32-NEXT: addi sp, sp, 16
1747 ; CHECK-RV32-NEXT: ret
1749 ; CHECK-RV64-LABEL: vandn_vx_swapped_nxv4i64:
1750 ; CHECK-RV64: # %bb.0:
1751 ; CHECK-RV64-NEXT: not a0, a0
1752 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1753 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1754 ; CHECK-RV64-NEXT: ret
1756 ; CHECK-ZVKB32-LABEL: vandn_vx_swapped_nxv4i64:
1757 ; CHECK-ZVKB32: # %bb.0:
1758 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1759 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1760 ; CHECK-ZVKB32-NEXT: not a0, a0
1761 ; CHECK-ZVKB32-NEXT: not a1, a1
1762 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1763 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1764 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1765 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1766 ; CHECK-ZVKB32-NEXT: vlse64.v v12, (a0), zero
1767 ; CHECK-ZVKB32-NEXT: vand.vv v8, v12, v8
1768 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1769 ; CHECK-ZVKB32-NEXT: ret
1771 ; CHECK-ZVKB64-LABEL: vandn_vx_swapped_nxv4i64:
1772 ; CHECK-ZVKB64: # %bb.0:
1773 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1774 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1775 ; CHECK-ZVKB64-NEXT: ret
1777 %head = insertelement <vscale x 4 x i64> poison, i64 %a, i32 0
1778 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1779 %b = and <vscale x 4 x i64> %splat, %y
1780 ret <vscale x 4 x i64> %b
1783 define <vscale x 8 x i64> @vandn_vv_nxv8i64(<vscale x 8 x i64> %x, <vscale x 8 x i64> %y) {
1784 ; CHECK-LABEL: vandn_vv_nxv8i64:
1786 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
1787 ; CHECK-NEXT: vnot.v v8, v8
1788 ; CHECK-NEXT: vand.vv v8, v8, v16
1791 ; CHECK-ZVKB-LABEL: vandn_vv_nxv8i64:
1792 ; CHECK-ZVKB: # %bb.0:
1793 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m8, ta, ma
1794 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
1795 ; CHECK-ZVKB-NEXT: ret
1796 %a = xor <vscale x 8 x i64> %x, splat (i64 -1)
1797 %b = and <vscale x 8 x i64> %a, %y
1798 ret <vscale x 8 x i64> %b
1801 define <vscale x 8 x i64> @vandn_vv_swapped_nxv8i64(<vscale x 8 x i64> %x, <vscale x 8 x i64> %y) {
1802 ; CHECK-LABEL: vandn_vv_swapped_nxv8i64:
1804 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
1805 ; CHECK-NEXT: vnot.v v8, v8
1806 ; CHECK-NEXT: vand.vv v8, v16, v8
1809 ; CHECK-ZVKB-LABEL: vandn_vv_swapped_nxv8i64:
1810 ; CHECK-ZVKB: # %bb.0:
1811 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m8, ta, ma
1812 ; CHECK-ZVKB-NEXT: vandn.vv v8, v16, v8
1813 ; CHECK-ZVKB-NEXT: ret
1814 %a = xor <vscale x 8 x i64> %x, splat (i64 -1)
1815 %b = and <vscale x 8 x i64> %y, %a
1816 ret <vscale x 8 x i64> %b
1819 define <vscale x 8 x i64> @vandn_vx_nxv8i64(i64 %x, <vscale x 8 x i64> %y) {
1820 ; CHECK-RV32-LABEL: vandn_vx_nxv8i64:
1821 ; CHECK-RV32: # %bb.0:
1822 ; CHECK-RV32-NEXT: addi sp, sp, -16
1823 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1824 ; CHECK-RV32-NEXT: not a0, a0
1825 ; CHECK-RV32-NEXT: not a1, a1
1826 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1827 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1828 ; CHECK-RV32-NEXT: addi a0, sp, 8
1829 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1830 ; CHECK-RV32-NEXT: vlse64.v v16, (a0), zero
1831 ; CHECK-RV32-NEXT: vand.vv v8, v16, v8
1832 ; CHECK-RV32-NEXT: addi sp, sp, 16
1833 ; CHECK-RV32-NEXT: ret
1835 ; CHECK-RV64-LABEL: vandn_vx_nxv8i64:
1836 ; CHECK-RV64: # %bb.0:
1837 ; CHECK-RV64-NEXT: not a0, a0
1838 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1839 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1840 ; CHECK-RV64-NEXT: ret
1842 ; CHECK-ZVKB32-LABEL: vandn_vx_nxv8i64:
1843 ; CHECK-ZVKB32: # %bb.0:
1844 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1845 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1846 ; CHECK-ZVKB32-NEXT: not a0, a0
1847 ; CHECK-ZVKB32-NEXT: not a1, a1
1848 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1849 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1850 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1851 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1852 ; CHECK-ZVKB32-NEXT: vlse64.v v16, (a0), zero
1853 ; CHECK-ZVKB32-NEXT: vand.vv v8, v16, v8
1854 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1855 ; CHECK-ZVKB32-NEXT: ret
1857 ; CHECK-ZVKB64-LABEL: vandn_vx_nxv8i64:
1858 ; CHECK-ZVKB64: # %bb.0:
1859 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1860 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1861 ; CHECK-ZVKB64-NEXT: ret
1863 %head = insertelement <vscale x 8 x i64> poison, i64 %a, i32 0
1864 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1865 %b = and <vscale x 8 x i64> %splat, %y
1866 ret <vscale x 8 x i64> %b
1869 define <vscale x 8 x i64> @vandn_vx_swapped_nxv8i64(i64 %x, <vscale x 8 x i64> %y) {
1870 ; CHECK-RV32-LABEL: vandn_vx_swapped_nxv8i64:
1871 ; CHECK-RV32: # %bb.0:
1872 ; CHECK-RV32-NEXT: addi sp, sp, -16
1873 ; CHECK-RV32-NEXT: .cfi_def_cfa_offset 16
1874 ; CHECK-RV32-NEXT: not a0, a0
1875 ; CHECK-RV32-NEXT: not a1, a1
1876 ; CHECK-RV32-NEXT: sw a1, 12(sp)
1877 ; CHECK-RV32-NEXT: sw a0, 8(sp)
1878 ; CHECK-RV32-NEXT: addi a0, sp, 8
1879 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1880 ; CHECK-RV32-NEXT: vlse64.v v16, (a0), zero
1881 ; CHECK-RV32-NEXT: vand.vv v8, v16, v8
1882 ; CHECK-RV32-NEXT: addi sp, sp, 16
1883 ; CHECK-RV32-NEXT: ret
1885 ; CHECK-RV64-LABEL: vandn_vx_swapped_nxv8i64:
1886 ; CHECK-RV64: # %bb.0:
1887 ; CHECK-RV64-NEXT: not a0, a0
1888 ; CHECK-RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1889 ; CHECK-RV64-NEXT: vand.vx v8, v8, a0
1890 ; CHECK-RV64-NEXT: ret
1892 ; CHECK-ZVKB32-LABEL: vandn_vx_swapped_nxv8i64:
1893 ; CHECK-ZVKB32: # %bb.0:
1894 ; CHECK-ZVKB32-NEXT: addi sp, sp, -16
1895 ; CHECK-ZVKB32-NEXT: .cfi_def_cfa_offset 16
1896 ; CHECK-ZVKB32-NEXT: not a0, a0
1897 ; CHECK-ZVKB32-NEXT: not a1, a1
1898 ; CHECK-ZVKB32-NEXT: sw a1, 12(sp)
1899 ; CHECK-ZVKB32-NEXT: sw a0, 8(sp)
1900 ; CHECK-ZVKB32-NEXT: addi a0, sp, 8
1901 ; CHECK-ZVKB32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1902 ; CHECK-ZVKB32-NEXT: vlse64.v v16, (a0), zero
1903 ; CHECK-ZVKB32-NEXT: vand.vv v8, v16, v8
1904 ; CHECK-ZVKB32-NEXT: addi sp, sp, 16
1905 ; CHECK-ZVKB32-NEXT: ret
1907 ; CHECK-ZVKB64-LABEL: vandn_vx_swapped_nxv8i64:
1908 ; CHECK-ZVKB64: # %bb.0:
1909 ; CHECK-ZVKB64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1910 ; CHECK-ZVKB64-NEXT: vandn.vx v8, v8, a0
1911 ; CHECK-ZVKB64-NEXT: ret
1913 %head = insertelement <vscale x 8 x i64> poison, i64 %a, i32 0
1914 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1915 %b = and <vscale x 8 x i64> %splat, %y
1916 ret <vscale x 8 x i64> %b