1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -aarch64-sve-vector-bits-min=256 < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_256
3 ; RUN: llc -aarch64-sve-vector-bits-min=512 < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
4 ; RUN: llc -aarch64-sve-vector-bits-min=2048 < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
6 target triple = "aarch64-unknown-linux-gnu"
12 ; Don't use SVE for 64-bit vectors.
13 define <8 x i8> @and_v8i8(<8 x i8> %op1, <8 x i8> %op2) vscale_range(2,0) #0 {
14 ; CHECK-LABEL: and_v8i8:
16 ; CHECK-NEXT: and v0.8b, v0.8b, v1.8b
18 %res = and <8 x i8> %op1, %op2
22 ; Don't use SVE for 128-bit vectors.
23 define <16 x i8> @and_v16i8(<16 x i8> %op1, <16 x i8> %op2) vscale_range(2,0) #0 {
24 ; CHECK-LABEL: and_v16i8:
26 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
28 %res = and <16 x i8> %op1, %op2
32 define void @and_v32i8(ptr %a, ptr %b) vscale_range(2,0) #0 {
33 ; CHECK-LABEL: and_v32i8:
35 ; CHECK-NEXT: ptrue p0.b, vl32
36 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
37 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
38 ; CHECK-NEXT: and z0.d, z0.d, z1.d
39 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
41 %op1 = load <32 x i8>, ptr %a
42 %op2 = load <32 x i8>, ptr %b
43 %res = and <32 x i8> %op1, %op2
44 store <32 x i8> %res, ptr %a
48 define void @and_v64i8(ptr %a, ptr %b) #0 {
49 ; VBITS_GE_256-LABEL: and_v64i8:
50 ; VBITS_GE_256: // %bb.0:
51 ; VBITS_GE_256-NEXT: ptrue p0.b, vl32
52 ; VBITS_GE_256-NEXT: mov w8, #32 // =0x20
53 ; VBITS_GE_256-NEXT: ld1b { z0.b }, p0/z, [x0, x8]
54 ; VBITS_GE_256-NEXT: ld1b { z1.b }, p0/z, [x0]
55 ; VBITS_GE_256-NEXT: ld1b { z2.b }, p0/z, [x1, x8]
56 ; VBITS_GE_256-NEXT: ld1b { z3.b }, p0/z, [x1]
57 ; VBITS_GE_256-NEXT: and z0.d, z0.d, z2.d
58 ; VBITS_GE_256-NEXT: and z1.d, z1.d, z3.d
59 ; VBITS_GE_256-NEXT: st1b { z0.b }, p0, [x0, x8]
60 ; VBITS_GE_256-NEXT: st1b { z1.b }, p0, [x0]
61 ; VBITS_GE_256-NEXT: ret
63 ; VBITS_GE_512-LABEL: and_v64i8:
64 ; VBITS_GE_512: // %bb.0:
65 ; VBITS_GE_512-NEXT: ptrue p0.b, vl64
66 ; VBITS_GE_512-NEXT: ld1b { z0.b }, p0/z, [x0]
67 ; VBITS_GE_512-NEXT: ld1b { z1.b }, p0/z, [x1]
68 ; VBITS_GE_512-NEXT: and z0.d, z0.d, z1.d
69 ; VBITS_GE_512-NEXT: st1b { z0.b }, p0, [x0]
70 ; VBITS_GE_512-NEXT: ret
71 %op1 = load <64 x i8>, ptr %a
72 %op2 = load <64 x i8>, ptr %b
73 %res = and <64 x i8> %op1, %op2
74 store <64 x i8> %res, ptr %a
78 define void @and_v128i8(ptr %a, ptr %b) vscale_range(8,0) #0 {
79 ; CHECK-LABEL: and_v128i8:
81 ; CHECK-NEXT: ptrue p0.b, vl128
82 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
83 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
84 ; CHECK-NEXT: and z0.d, z0.d, z1.d
85 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
87 %op1 = load <128 x i8>, ptr %a
88 %op2 = load <128 x i8>, ptr %b
89 %res = and <128 x i8> %op1, %op2
90 store <128 x i8> %res, ptr %a
94 define void @and_v256i8(ptr %a, ptr %b) vscale_range(16,0) #0 {
95 ; CHECK-LABEL: and_v256i8:
97 ; CHECK-NEXT: ptrue p0.b, vl256
98 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
99 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
100 ; CHECK-NEXT: and z0.d, z0.d, z1.d
101 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
103 %op1 = load <256 x i8>, ptr %a
104 %op2 = load <256 x i8>, ptr %b
105 %res = and <256 x i8> %op1, %op2
106 store <256 x i8> %res, ptr %a
110 ; Don't use SVE for 64-bit vectors.
111 define <4 x i16> @and_v4i16(<4 x i16> %op1, <4 x i16> %op2) vscale_range(2,0) #0 {
112 ; CHECK-LABEL: and_v4i16:
114 ; CHECK-NEXT: and v0.8b, v0.8b, v1.8b
116 %res = and <4 x i16> %op1, %op2
120 ; Don't use SVE for 128-bit vectors.
121 define <8 x i16> @and_v8i16(<8 x i16> %op1, <8 x i16> %op2) vscale_range(2,0) #0 {
122 ; CHECK-LABEL: and_v8i16:
124 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
126 %res = and <8 x i16> %op1, %op2
130 define void @and_v16i16(ptr %a, ptr %b) vscale_range(2,0) #0 {
131 ; CHECK-LABEL: and_v16i16:
133 ; CHECK-NEXT: ptrue p0.h, vl16
134 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
135 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
136 ; CHECK-NEXT: and z0.d, z0.d, z1.d
137 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
139 %op1 = load <16 x i16>, ptr %a
140 %op2 = load <16 x i16>, ptr %b
141 %res = and <16 x i16> %op1, %op2
142 store <16 x i16> %res, ptr %a
146 define void @and_v32i16(ptr %a, ptr %b) #0 {
147 ; VBITS_GE_256-LABEL: and_v32i16:
148 ; VBITS_GE_256: // %bb.0:
149 ; VBITS_GE_256-NEXT: ptrue p0.h, vl16
150 ; VBITS_GE_256-NEXT: mov x8, #16 // =0x10
151 ; VBITS_GE_256-NEXT: ld1h { z0.h }, p0/z, [x0, x8, lsl #1]
152 ; VBITS_GE_256-NEXT: ld1h { z1.h }, p0/z, [x0]
153 ; VBITS_GE_256-NEXT: ld1h { z2.h }, p0/z, [x1, x8, lsl #1]
154 ; VBITS_GE_256-NEXT: ld1h { z3.h }, p0/z, [x1]
155 ; VBITS_GE_256-NEXT: and z0.d, z0.d, z2.d
156 ; VBITS_GE_256-NEXT: and z1.d, z1.d, z3.d
157 ; VBITS_GE_256-NEXT: st1h { z0.h }, p0, [x0, x8, lsl #1]
158 ; VBITS_GE_256-NEXT: st1h { z1.h }, p0, [x0]
159 ; VBITS_GE_256-NEXT: ret
161 ; VBITS_GE_512-LABEL: and_v32i16:
162 ; VBITS_GE_512: // %bb.0:
163 ; VBITS_GE_512-NEXT: ptrue p0.h, vl32
164 ; VBITS_GE_512-NEXT: ld1h { z0.h }, p0/z, [x0]
165 ; VBITS_GE_512-NEXT: ld1h { z1.h }, p0/z, [x1]
166 ; VBITS_GE_512-NEXT: and z0.d, z0.d, z1.d
167 ; VBITS_GE_512-NEXT: st1h { z0.h }, p0, [x0]
168 ; VBITS_GE_512-NEXT: ret
169 %op1 = load <32 x i16>, ptr %a
170 %op2 = load <32 x i16>, ptr %b
171 %res = and <32 x i16> %op1, %op2
172 store <32 x i16> %res, ptr %a
176 define void @and_v64i16(ptr %a, ptr %b) vscale_range(8,0) #0 {
177 ; CHECK-LABEL: and_v64i16:
179 ; CHECK-NEXT: ptrue p0.h, vl64
180 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
181 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
182 ; CHECK-NEXT: and z0.d, z0.d, z1.d
183 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
185 %op1 = load <64 x i16>, ptr %a
186 %op2 = load <64 x i16>, ptr %b
187 %res = and <64 x i16> %op1, %op2
188 store <64 x i16> %res, ptr %a
192 define void @and_v128i16(ptr %a, ptr %b) vscale_range(16,0) #0 {
193 ; CHECK-LABEL: and_v128i16:
195 ; CHECK-NEXT: ptrue p0.h, vl128
196 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
197 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
198 ; CHECK-NEXT: and z0.d, z0.d, z1.d
199 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
201 %op1 = load <128 x i16>, ptr %a
202 %op2 = load <128 x i16>, ptr %b
203 %res = and <128 x i16> %op1, %op2
204 store <128 x i16> %res, ptr %a
208 ; Don't use SVE for 64-bit vectors.
209 define <2 x i32> @and_v2i32(<2 x i32> %op1, <2 x i32> %op2) vscale_range(2,0) #0 {
210 ; CHECK-LABEL: and_v2i32:
212 ; CHECK-NEXT: and v0.8b, v0.8b, v1.8b
214 %res = and <2 x i32> %op1, %op2
218 ; Don't use SVE for 128-bit vectors.
219 define <4 x i32> @and_v4i32(<4 x i32> %op1, <4 x i32> %op2) vscale_range(2,0) #0 {
220 ; CHECK-LABEL: and_v4i32:
222 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
224 %res = and <4 x i32> %op1, %op2
228 define void @and_v8i32(ptr %a, ptr %b) vscale_range(2,0) #0 {
229 ; CHECK-LABEL: and_v8i32:
231 ; CHECK-NEXT: ptrue p0.s, vl8
232 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
233 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
234 ; CHECK-NEXT: and z0.d, z0.d, z1.d
235 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
237 %op1 = load <8 x i32>, ptr %a
238 %op2 = load <8 x i32>, ptr %b
239 %res = and <8 x i32> %op1, %op2
240 store <8 x i32> %res, ptr %a
244 define void @and_v16i32(ptr %a, ptr %b) #0 {
245 ; VBITS_GE_256-LABEL: and_v16i32:
246 ; VBITS_GE_256: // %bb.0:
247 ; VBITS_GE_256-NEXT: ptrue p0.s, vl8
248 ; VBITS_GE_256-NEXT: mov x8, #8 // =0x8
249 ; VBITS_GE_256-NEXT: ld1w { z0.s }, p0/z, [x0, x8, lsl #2]
250 ; VBITS_GE_256-NEXT: ld1w { z1.s }, p0/z, [x0]
251 ; VBITS_GE_256-NEXT: ld1w { z2.s }, p0/z, [x1, x8, lsl #2]
252 ; VBITS_GE_256-NEXT: ld1w { z3.s }, p0/z, [x1]
253 ; VBITS_GE_256-NEXT: and z0.d, z0.d, z2.d
254 ; VBITS_GE_256-NEXT: and z1.d, z1.d, z3.d
255 ; VBITS_GE_256-NEXT: st1w { z0.s }, p0, [x0, x8, lsl #2]
256 ; VBITS_GE_256-NEXT: st1w { z1.s }, p0, [x0]
257 ; VBITS_GE_256-NEXT: ret
259 ; VBITS_GE_512-LABEL: and_v16i32:
260 ; VBITS_GE_512: // %bb.0:
261 ; VBITS_GE_512-NEXT: ptrue p0.s, vl16
262 ; VBITS_GE_512-NEXT: ld1w { z0.s }, p0/z, [x0]
263 ; VBITS_GE_512-NEXT: ld1w { z1.s }, p0/z, [x1]
264 ; VBITS_GE_512-NEXT: and z0.d, z0.d, z1.d
265 ; VBITS_GE_512-NEXT: st1w { z0.s }, p0, [x0]
266 ; VBITS_GE_512-NEXT: ret
267 %op1 = load <16 x i32>, ptr %a
268 %op2 = load <16 x i32>, ptr %b
269 %res = and <16 x i32> %op1, %op2
270 store <16 x i32> %res, ptr %a
274 define void @and_v32i32(ptr %a, ptr %b) vscale_range(8,0) #0 {
275 ; CHECK-LABEL: and_v32i32:
277 ; CHECK-NEXT: ptrue p0.s, vl32
278 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
279 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
280 ; CHECK-NEXT: and z0.d, z0.d, z1.d
281 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
283 %op1 = load <32 x i32>, ptr %a
284 %op2 = load <32 x i32>, ptr %b
285 %res = and <32 x i32> %op1, %op2
286 store <32 x i32> %res, ptr %a
290 define void @and_v64i32(ptr %a, ptr %b) vscale_range(16,0) #0 {
291 ; CHECK-LABEL: and_v64i32:
293 ; CHECK-NEXT: ptrue p0.s, vl64
294 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
295 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
296 ; CHECK-NEXT: and z0.d, z0.d, z1.d
297 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
299 %op1 = load <64 x i32>, ptr %a
300 %op2 = load <64 x i32>, ptr %b
301 %res = and <64 x i32> %op1, %op2
302 store <64 x i32> %res, ptr %a
306 ; Don't use SVE for 64-bit vectors.
307 define <1 x i64> @and_v1i64(<1 x i64> %op1, <1 x i64> %op2) vscale_range(2,0) #0 {
308 ; CHECK-LABEL: and_v1i64:
310 ; CHECK-NEXT: and v0.8b, v0.8b, v1.8b
312 %res = and <1 x i64> %op1, %op2
316 ; Don't use SVE for 128-bit vectors.
317 define <2 x i64> @and_v2i64(<2 x i64> %op1, <2 x i64> %op2) vscale_range(2,0) #0 {
318 ; CHECK-LABEL: and_v2i64:
320 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
322 %res = and <2 x i64> %op1, %op2
326 define void @and_v4i64(ptr %a, ptr %b) vscale_range(2,0) #0 {
327 ; CHECK-LABEL: and_v4i64:
329 ; CHECK-NEXT: ptrue p0.d, vl4
330 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
331 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
332 ; CHECK-NEXT: and z0.d, z0.d, z1.d
333 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
335 %op1 = load <4 x i64>, ptr %a
336 %op2 = load <4 x i64>, ptr %b
337 %res = and <4 x i64> %op1, %op2
338 store <4 x i64> %res, ptr %a
342 define void @and_v8i64(ptr %a, ptr %b) #0 {
343 ; VBITS_GE_256-LABEL: and_v8i64:
344 ; VBITS_GE_256: // %bb.0:
345 ; VBITS_GE_256-NEXT: ptrue p0.d, vl4
346 ; VBITS_GE_256-NEXT: mov x8, #4 // =0x4
347 ; VBITS_GE_256-NEXT: ld1d { z0.d }, p0/z, [x0, x8, lsl #3]
348 ; VBITS_GE_256-NEXT: ld1d { z1.d }, p0/z, [x0]
349 ; VBITS_GE_256-NEXT: ld1d { z2.d }, p0/z, [x1, x8, lsl #3]
350 ; VBITS_GE_256-NEXT: ld1d { z3.d }, p0/z, [x1]
351 ; VBITS_GE_256-NEXT: and z0.d, z0.d, z2.d
352 ; VBITS_GE_256-NEXT: and z1.d, z1.d, z3.d
353 ; VBITS_GE_256-NEXT: st1d { z0.d }, p0, [x0, x8, lsl #3]
354 ; VBITS_GE_256-NEXT: st1d { z1.d }, p0, [x0]
355 ; VBITS_GE_256-NEXT: ret
357 ; VBITS_GE_512-LABEL: and_v8i64:
358 ; VBITS_GE_512: // %bb.0:
359 ; VBITS_GE_512-NEXT: ptrue p0.d, vl8
360 ; VBITS_GE_512-NEXT: ld1d { z0.d }, p0/z, [x0]
361 ; VBITS_GE_512-NEXT: ld1d { z1.d }, p0/z, [x1]
362 ; VBITS_GE_512-NEXT: and z0.d, z0.d, z1.d
363 ; VBITS_GE_512-NEXT: st1d { z0.d }, p0, [x0]
364 ; VBITS_GE_512-NEXT: ret
365 %op1 = load <8 x i64>, ptr %a
366 %op2 = load <8 x i64>, ptr %b
367 %res = and <8 x i64> %op1, %op2
368 store <8 x i64> %res, ptr %a
372 define void @and_v16i64(ptr %a, ptr %b) vscale_range(8,0) #0 {
373 ; CHECK-LABEL: and_v16i64:
375 ; CHECK-NEXT: ptrue p0.d, vl16
376 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
377 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
378 ; CHECK-NEXT: and z0.d, z0.d, z1.d
379 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
381 %op1 = load <16 x i64>, ptr %a
382 %op2 = load <16 x i64>, ptr %b
383 %res = and <16 x i64> %op1, %op2
384 store <16 x i64> %res, ptr %a
388 define void @and_v32i64(ptr %a, ptr %b) vscale_range(16,0) #0 {
389 ; CHECK-LABEL: and_v32i64:
391 ; CHECK-NEXT: ptrue p0.d, vl32
392 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
393 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
394 ; CHECK-NEXT: and z0.d, z0.d, z1.d
395 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
397 %op1 = load <32 x i64>, ptr %a
398 %op2 = load <32 x i64>, ptr %b
399 %res = and <32 x i64> %op1, %op2
400 store <32 x i64> %res, ptr %a
408 ; Don't use SVE for 64-bit vectors.
409 define <8 x i8> @or_v8i8(<8 x i8> %op1, <8 x i8> %op2) vscale_range(2,0) #0 {
410 ; CHECK-LABEL: or_v8i8:
412 ; CHECK-NEXT: orr v0.8b, v0.8b, v1.8b
414 %res = or <8 x i8> %op1, %op2
418 ; Don't use SVE for 128-bit vectors.
419 define <16 x i8> @or_v16i8(<16 x i8> %op1, <16 x i8> %op2) vscale_range(2,0) #0 {
420 ; CHECK-LABEL: or_v16i8:
422 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
424 %res = or <16 x i8> %op1, %op2
428 define void @or_v32i8(ptr %a, ptr %b) vscale_range(2,0) #0 {
429 ; CHECK-LABEL: or_v32i8:
431 ; CHECK-NEXT: ptrue p0.b, vl32
432 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
433 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
434 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
435 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
437 %op1 = load <32 x i8>, ptr %a
438 %op2 = load <32 x i8>, ptr %b
439 %res = or <32 x i8> %op1, %op2
440 store <32 x i8> %res, ptr %a
444 define void @or_v64i8(ptr %a, ptr %b) #0 {
445 ; VBITS_GE_256-LABEL: or_v64i8:
446 ; VBITS_GE_256: // %bb.0:
447 ; VBITS_GE_256-NEXT: ptrue p0.b, vl32
448 ; VBITS_GE_256-NEXT: mov w8, #32 // =0x20
449 ; VBITS_GE_256-NEXT: ld1b { z0.b }, p0/z, [x0, x8]
450 ; VBITS_GE_256-NEXT: ld1b { z1.b }, p0/z, [x0]
451 ; VBITS_GE_256-NEXT: ld1b { z2.b }, p0/z, [x1, x8]
452 ; VBITS_GE_256-NEXT: ld1b { z3.b }, p0/z, [x1]
453 ; VBITS_GE_256-NEXT: orr z0.d, z0.d, z2.d
454 ; VBITS_GE_256-NEXT: orr z1.d, z1.d, z3.d
455 ; VBITS_GE_256-NEXT: st1b { z0.b }, p0, [x0, x8]
456 ; VBITS_GE_256-NEXT: st1b { z1.b }, p0, [x0]
457 ; VBITS_GE_256-NEXT: ret
459 ; VBITS_GE_512-LABEL: or_v64i8:
460 ; VBITS_GE_512: // %bb.0:
461 ; VBITS_GE_512-NEXT: ptrue p0.b, vl64
462 ; VBITS_GE_512-NEXT: ld1b { z0.b }, p0/z, [x0]
463 ; VBITS_GE_512-NEXT: ld1b { z1.b }, p0/z, [x1]
464 ; VBITS_GE_512-NEXT: orr z0.d, z0.d, z1.d
465 ; VBITS_GE_512-NEXT: st1b { z0.b }, p0, [x0]
466 ; VBITS_GE_512-NEXT: ret
467 %op1 = load <64 x i8>, ptr %a
468 %op2 = load <64 x i8>, ptr %b
469 %res = or <64 x i8> %op1, %op2
470 store <64 x i8> %res, ptr %a
474 define void @or_v128i8(ptr %a, ptr %b) vscale_range(8,0) #0 {
475 ; CHECK-LABEL: or_v128i8:
477 ; CHECK-NEXT: ptrue p0.b, vl128
478 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
479 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
480 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
481 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
483 %op1 = load <128 x i8>, ptr %a
484 %op2 = load <128 x i8>, ptr %b
485 %res = or <128 x i8> %op1, %op2
486 store <128 x i8> %res, ptr %a
490 define void @or_v256i8(ptr %a, ptr %b) vscale_range(16,0) #0 {
491 ; CHECK-LABEL: or_v256i8:
493 ; CHECK-NEXT: ptrue p0.b, vl256
494 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
495 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
496 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
497 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
499 %op1 = load <256 x i8>, ptr %a
500 %op2 = load <256 x i8>, ptr %b
501 %res = or <256 x i8> %op1, %op2
502 store <256 x i8> %res, ptr %a
506 ; Don't use SVE for 64-bit vectors.
507 define <4 x i16> @or_v4i16(<4 x i16> %op1, <4 x i16> %op2) vscale_range(2,0) #0 {
508 ; CHECK-LABEL: or_v4i16:
510 ; CHECK-NEXT: orr v0.8b, v0.8b, v1.8b
512 %res = or <4 x i16> %op1, %op2
516 ; Don't use SVE for 128-bit vectors.
517 define <8 x i16> @or_v8i16(<8 x i16> %op1, <8 x i16> %op2) vscale_range(2,0) #0 {
518 ; CHECK-LABEL: or_v8i16:
520 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
522 %res = or <8 x i16> %op1, %op2
526 define void @or_v16i16(ptr %a, ptr %b) vscale_range(2,0) #0 {
527 ; CHECK-LABEL: or_v16i16:
529 ; CHECK-NEXT: ptrue p0.h, vl16
530 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
531 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
532 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
533 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
535 %op1 = load <16 x i16>, ptr %a
536 %op2 = load <16 x i16>, ptr %b
537 %res = or <16 x i16> %op1, %op2
538 store <16 x i16> %res, ptr %a
542 define void @or_v32i16(ptr %a, ptr %b) #0 {
543 ; VBITS_GE_256-LABEL: or_v32i16:
544 ; VBITS_GE_256: // %bb.0:
545 ; VBITS_GE_256-NEXT: ptrue p0.h, vl16
546 ; VBITS_GE_256-NEXT: mov x8, #16 // =0x10
547 ; VBITS_GE_256-NEXT: ld1h { z0.h }, p0/z, [x0, x8, lsl #1]
548 ; VBITS_GE_256-NEXT: ld1h { z1.h }, p0/z, [x0]
549 ; VBITS_GE_256-NEXT: ld1h { z2.h }, p0/z, [x1, x8, lsl #1]
550 ; VBITS_GE_256-NEXT: ld1h { z3.h }, p0/z, [x1]
551 ; VBITS_GE_256-NEXT: orr z0.d, z0.d, z2.d
552 ; VBITS_GE_256-NEXT: orr z1.d, z1.d, z3.d
553 ; VBITS_GE_256-NEXT: st1h { z0.h }, p0, [x0, x8, lsl #1]
554 ; VBITS_GE_256-NEXT: st1h { z1.h }, p0, [x0]
555 ; VBITS_GE_256-NEXT: ret
557 ; VBITS_GE_512-LABEL: or_v32i16:
558 ; VBITS_GE_512: // %bb.0:
559 ; VBITS_GE_512-NEXT: ptrue p0.h, vl32
560 ; VBITS_GE_512-NEXT: ld1h { z0.h }, p0/z, [x0]
561 ; VBITS_GE_512-NEXT: ld1h { z1.h }, p0/z, [x1]
562 ; VBITS_GE_512-NEXT: orr z0.d, z0.d, z1.d
563 ; VBITS_GE_512-NEXT: st1h { z0.h }, p0, [x0]
564 ; VBITS_GE_512-NEXT: ret
565 %op1 = load <32 x i16>, ptr %a
566 %op2 = load <32 x i16>, ptr %b
567 %res = or <32 x i16> %op1, %op2
568 store <32 x i16> %res, ptr %a
572 define void @or_v64i16(ptr %a, ptr %b) vscale_range(8,0) #0 {
573 ; CHECK-LABEL: or_v64i16:
575 ; CHECK-NEXT: ptrue p0.h, vl64
576 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
577 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
578 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
579 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
581 %op1 = load <64 x i16>, ptr %a
582 %op2 = load <64 x i16>, ptr %b
583 %res = or <64 x i16> %op1, %op2
584 store <64 x i16> %res, ptr %a
588 define void @or_v128i16(ptr %a, ptr %b) vscale_range(16,0) #0 {
589 ; CHECK-LABEL: or_v128i16:
591 ; CHECK-NEXT: ptrue p0.h, vl128
592 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
593 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
594 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
595 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
597 %op1 = load <128 x i16>, ptr %a
598 %op2 = load <128 x i16>, ptr %b
599 %res = or <128 x i16> %op1, %op2
600 store <128 x i16> %res, ptr %a
604 ; Don't use SVE for 64-bit vectors.
605 define <2 x i32> @or_v2i32(<2 x i32> %op1, <2 x i32> %op2) vscale_range(2,0) #0 {
606 ; CHECK-LABEL: or_v2i32:
608 ; CHECK-NEXT: orr v0.8b, v0.8b, v1.8b
610 %res = or <2 x i32> %op1, %op2
614 ; Don't use SVE for 128-bit vectors.
615 define <4 x i32> @or_v4i32(<4 x i32> %op1, <4 x i32> %op2) vscale_range(2,0) #0 {
616 ; CHECK-LABEL: or_v4i32:
618 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
620 %res = or <4 x i32> %op1, %op2
624 define void @or_v8i32(ptr %a, ptr %b) vscale_range(2,0) #0 {
625 ; CHECK-LABEL: or_v8i32:
627 ; CHECK-NEXT: ptrue p0.s, vl8
628 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
629 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
630 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
631 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
633 %op1 = load <8 x i32>, ptr %a
634 %op2 = load <8 x i32>, ptr %b
635 %res = or <8 x i32> %op1, %op2
636 store <8 x i32> %res, ptr %a
640 define void @or_v16i32(ptr %a, ptr %b) #0 {
641 ; VBITS_GE_256-LABEL: or_v16i32:
642 ; VBITS_GE_256: // %bb.0:
643 ; VBITS_GE_256-NEXT: ptrue p0.s, vl8
644 ; VBITS_GE_256-NEXT: mov x8, #8 // =0x8
645 ; VBITS_GE_256-NEXT: ld1w { z0.s }, p0/z, [x0, x8, lsl #2]
646 ; VBITS_GE_256-NEXT: ld1w { z1.s }, p0/z, [x0]
647 ; VBITS_GE_256-NEXT: ld1w { z2.s }, p0/z, [x1, x8, lsl #2]
648 ; VBITS_GE_256-NEXT: ld1w { z3.s }, p0/z, [x1]
649 ; VBITS_GE_256-NEXT: orr z0.d, z0.d, z2.d
650 ; VBITS_GE_256-NEXT: orr z1.d, z1.d, z3.d
651 ; VBITS_GE_256-NEXT: st1w { z0.s }, p0, [x0, x8, lsl #2]
652 ; VBITS_GE_256-NEXT: st1w { z1.s }, p0, [x0]
653 ; VBITS_GE_256-NEXT: ret
655 ; VBITS_GE_512-LABEL: or_v16i32:
656 ; VBITS_GE_512: // %bb.0:
657 ; VBITS_GE_512-NEXT: ptrue p0.s, vl16
658 ; VBITS_GE_512-NEXT: ld1w { z0.s }, p0/z, [x0]
659 ; VBITS_GE_512-NEXT: ld1w { z1.s }, p0/z, [x1]
660 ; VBITS_GE_512-NEXT: orr z0.d, z0.d, z1.d
661 ; VBITS_GE_512-NEXT: st1w { z0.s }, p0, [x0]
662 ; VBITS_GE_512-NEXT: ret
663 %op1 = load <16 x i32>, ptr %a
664 %op2 = load <16 x i32>, ptr %b
665 %res = or <16 x i32> %op1, %op2
666 store <16 x i32> %res, ptr %a
670 define void @or_v32i32(ptr %a, ptr %b) vscale_range(8,0) #0 {
671 ; CHECK-LABEL: or_v32i32:
673 ; CHECK-NEXT: ptrue p0.s, vl32
674 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
675 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
676 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
677 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
679 %op1 = load <32 x i32>, ptr %a
680 %op2 = load <32 x i32>, ptr %b
681 %res = or <32 x i32> %op1, %op2
682 store <32 x i32> %res, ptr %a
686 define void @or_v64i32(ptr %a, ptr %b) vscale_range(16,0) #0 {
687 ; CHECK-LABEL: or_v64i32:
689 ; CHECK-NEXT: ptrue p0.s, vl64
690 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
691 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
692 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
693 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
695 %op1 = load <64 x i32>, ptr %a
696 %op2 = load <64 x i32>, ptr %b
697 %res = or <64 x i32> %op1, %op2
698 store <64 x i32> %res, ptr %a
702 ; Don't use SVE for 64-bit vectors.
703 define <1 x i64> @or_v1i64(<1 x i64> %op1, <1 x i64> %op2) vscale_range(2,0) #0 {
704 ; CHECK-LABEL: or_v1i64:
706 ; CHECK-NEXT: orr v0.8b, v0.8b, v1.8b
708 %res = or <1 x i64> %op1, %op2
712 ; Don't use SVE for 128-bit vectors.
713 define <2 x i64> @or_v2i64(<2 x i64> %op1, <2 x i64> %op2) vscale_range(2,0) #0 {
714 ; CHECK-LABEL: or_v2i64:
716 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
718 %res = or <2 x i64> %op1, %op2
722 define void @or_v4i64(ptr %a, ptr %b) vscale_range(2,0) #0 {
723 ; CHECK-LABEL: or_v4i64:
725 ; CHECK-NEXT: ptrue p0.d, vl4
726 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
727 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
728 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
729 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
731 %op1 = load <4 x i64>, ptr %a
732 %op2 = load <4 x i64>, ptr %b
733 %res = or <4 x i64> %op1, %op2
734 store <4 x i64> %res, ptr %a
738 define void @or_v8i64(ptr %a, ptr %b) #0 {
739 ; VBITS_GE_256-LABEL: or_v8i64:
740 ; VBITS_GE_256: // %bb.0:
741 ; VBITS_GE_256-NEXT: ptrue p0.d, vl4
742 ; VBITS_GE_256-NEXT: mov x8, #4 // =0x4
743 ; VBITS_GE_256-NEXT: ld1d { z0.d }, p0/z, [x0, x8, lsl #3]
744 ; VBITS_GE_256-NEXT: ld1d { z1.d }, p0/z, [x0]
745 ; VBITS_GE_256-NEXT: ld1d { z2.d }, p0/z, [x1, x8, lsl #3]
746 ; VBITS_GE_256-NEXT: ld1d { z3.d }, p0/z, [x1]
747 ; VBITS_GE_256-NEXT: orr z0.d, z0.d, z2.d
748 ; VBITS_GE_256-NEXT: orr z1.d, z1.d, z3.d
749 ; VBITS_GE_256-NEXT: st1d { z0.d }, p0, [x0, x8, lsl #3]
750 ; VBITS_GE_256-NEXT: st1d { z1.d }, p0, [x0]
751 ; VBITS_GE_256-NEXT: ret
753 ; VBITS_GE_512-LABEL: or_v8i64:
754 ; VBITS_GE_512: // %bb.0:
755 ; VBITS_GE_512-NEXT: ptrue p0.d, vl8
756 ; VBITS_GE_512-NEXT: ld1d { z0.d }, p0/z, [x0]
757 ; VBITS_GE_512-NEXT: ld1d { z1.d }, p0/z, [x1]
758 ; VBITS_GE_512-NEXT: orr z0.d, z0.d, z1.d
759 ; VBITS_GE_512-NEXT: st1d { z0.d }, p0, [x0]
760 ; VBITS_GE_512-NEXT: ret
761 %op1 = load <8 x i64>, ptr %a
762 %op2 = load <8 x i64>, ptr %b
763 %res = or <8 x i64> %op1, %op2
764 store <8 x i64> %res, ptr %a
768 define void @or_v16i64(ptr %a, ptr %b) vscale_range(8,0) #0 {
769 ; CHECK-LABEL: or_v16i64:
771 ; CHECK-NEXT: ptrue p0.d, vl16
772 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
773 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
774 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
775 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
777 %op1 = load <16 x i64>, ptr %a
778 %op2 = load <16 x i64>, ptr %b
779 %res = or <16 x i64> %op1, %op2
780 store <16 x i64> %res, ptr %a
784 define void @or_v32i64(ptr %a, ptr %b) vscale_range(16,0) #0 {
785 ; CHECK-LABEL: or_v32i64:
787 ; CHECK-NEXT: ptrue p0.d, vl32
788 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
789 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
790 ; CHECK-NEXT: orr z0.d, z0.d, z1.d
791 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
793 %op1 = load <32 x i64>, ptr %a
794 %op2 = load <32 x i64>, ptr %b
795 %res = or <32 x i64> %op1, %op2
796 store <32 x i64> %res, ptr %a
804 ; Don't use SVE for 64-bit vectors.
805 define <8 x i8> @xor_v8i8(<8 x i8> %op1, <8 x i8> %op2) vscale_range(2,0) #0 {
806 ; CHECK-LABEL: xor_v8i8:
808 ; CHECK-NEXT: eor v0.8b, v0.8b, v1.8b
810 %res = xor <8 x i8> %op1, %op2
814 ; Don't use SVE for 128-bit vectors.
815 define <16 x i8> @xor_v16i8(<16 x i8> %op1, <16 x i8> %op2) vscale_range(2,0) #0 {
816 ; CHECK-LABEL: xor_v16i8:
818 ; CHECK-NEXT: eor v0.16b, v0.16b, v1.16b
820 %res = xor <16 x i8> %op1, %op2
824 define void @xor_v32i8(ptr %a, ptr %b) vscale_range(2,0) #0 {
825 ; CHECK-LABEL: xor_v32i8:
827 ; CHECK-NEXT: ptrue p0.b, vl32
828 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
829 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
830 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
831 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
833 %op1 = load <32 x i8>, ptr %a
834 %op2 = load <32 x i8>, ptr %b
835 %res = xor <32 x i8> %op1, %op2
836 store <32 x i8> %res, ptr %a
840 define void @xor_v64i8(ptr %a, ptr %b) #0 {
841 ; VBITS_GE_256-LABEL: xor_v64i8:
842 ; VBITS_GE_256: // %bb.0:
843 ; VBITS_GE_256-NEXT: ptrue p0.b, vl32
844 ; VBITS_GE_256-NEXT: mov w8, #32 // =0x20
845 ; VBITS_GE_256-NEXT: ld1b { z0.b }, p0/z, [x0, x8]
846 ; VBITS_GE_256-NEXT: ld1b { z1.b }, p0/z, [x0]
847 ; VBITS_GE_256-NEXT: ld1b { z2.b }, p0/z, [x1, x8]
848 ; VBITS_GE_256-NEXT: ld1b { z3.b }, p0/z, [x1]
849 ; VBITS_GE_256-NEXT: eor z0.d, z0.d, z2.d
850 ; VBITS_GE_256-NEXT: eor z1.d, z1.d, z3.d
851 ; VBITS_GE_256-NEXT: st1b { z0.b }, p0, [x0, x8]
852 ; VBITS_GE_256-NEXT: st1b { z1.b }, p0, [x0]
853 ; VBITS_GE_256-NEXT: ret
855 ; VBITS_GE_512-LABEL: xor_v64i8:
856 ; VBITS_GE_512: // %bb.0:
857 ; VBITS_GE_512-NEXT: ptrue p0.b, vl64
858 ; VBITS_GE_512-NEXT: ld1b { z0.b }, p0/z, [x0]
859 ; VBITS_GE_512-NEXT: ld1b { z1.b }, p0/z, [x1]
860 ; VBITS_GE_512-NEXT: eor z0.d, z0.d, z1.d
861 ; VBITS_GE_512-NEXT: st1b { z0.b }, p0, [x0]
862 ; VBITS_GE_512-NEXT: ret
863 %op1 = load <64 x i8>, ptr %a
864 %op2 = load <64 x i8>, ptr %b
865 %res = xor <64 x i8> %op1, %op2
866 store <64 x i8> %res, ptr %a
870 define void @xor_v128i8(ptr %a, ptr %b) vscale_range(8,0) #0 {
871 ; CHECK-LABEL: xor_v128i8:
873 ; CHECK-NEXT: ptrue p0.b, vl128
874 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
875 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
876 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
877 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
879 %op1 = load <128 x i8>, ptr %a
880 %op2 = load <128 x i8>, ptr %b
881 %res = xor <128 x i8> %op1, %op2
882 store <128 x i8> %res, ptr %a
886 define void @xor_v256i8(ptr %a, ptr %b) vscale_range(16,0) #0 {
887 ; CHECK-LABEL: xor_v256i8:
889 ; CHECK-NEXT: ptrue p0.b, vl256
890 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0]
891 ; CHECK-NEXT: ld1b { z1.b }, p0/z, [x1]
892 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
893 ; CHECK-NEXT: st1b { z0.b }, p0, [x0]
895 %op1 = load <256 x i8>, ptr %a
896 %op2 = load <256 x i8>, ptr %b
897 %res = xor <256 x i8> %op1, %op2
898 store <256 x i8> %res, ptr %a
902 ; Don't use SVE for 64-bit vectors.
903 define <4 x i16> @xor_v4i16(<4 x i16> %op1, <4 x i16> %op2) vscale_range(2,0) #0 {
904 ; CHECK-LABEL: xor_v4i16:
906 ; CHECK-NEXT: eor v0.8b, v0.8b, v1.8b
908 %res = xor <4 x i16> %op1, %op2
912 ; Don't use SVE for 128-bit vectors.
913 define <8 x i16> @xor_v8i16(<8 x i16> %op1, <8 x i16> %op2) vscale_range(2,0) #0 {
914 ; CHECK-LABEL: xor_v8i16:
916 ; CHECK-NEXT: eor v0.16b, v0.16b, v1.16b
918 %res = xor <8 x i16> %op1, %op2
922 define void @xor_v16i16(ptr %a, ptr %b) vscale_range(2,0) #0 {
923 ; CHECK-LABEL: xor_v16i16:
925 ; CHECK-NEXT: ptrue p0.h, vl16
926 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
927 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
928 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
929 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
931 %op1 = load <16 x i16>, ptr %a
932 %op2 = load <16 x i16>, ptr %b
933 %res = xor <16 x i16> %op1, %op2
934 store <16 x i16> %res, ptr %a
938 define void @xor_v32i16(ptr %a, ptr %b) #0 {
939 ; VBITS_GE_256-LABEL: xor_v32i16:
940 ; VBITS_GE_256: // %bb.0:
941 ; VBITS_GE_256-NEXT: ptrue p0.h, vl16
942 ; VBITS_GE_256-NEXT: mov x8, #16 // =0x10
943 ; VBITS_GE_256-NEXT: ld1h { z0.h }, p0/z, [x0, x8, lsl #1]
944 ; VBITS_GE_256-NEXT: ld1h { z1.h }, p0/z, [x0]
945 ; VBITS_GE_256-NEXT: ld1h { z2.h }, p0/z, [x1, x8, lsl #1]
946 ; VBITS_GE_256-NEXT: ld1h { z3.h }, p0/z, [x1]
947 ; VBITS_GE_256-NEXT: eor z0.d, z0.d, z2.d
948 ; VBITS_GE_256-NEXT: eor z1.d, z1.d, z3.d
949 ; VBITS_GE_256-NEXT: st1h { z0.h }, p0, [x0, x8, lsl #1]
950 ; VBITS_GE_256-NEXT: st1h { z1.h }, p0, [x0]
951 ; VBITS_GE_256-NEXT: ret
953 ; VBITS_GE_512-LABEL: xor_v32i16:
954 ; VBITS_GE_512: // %bb.0:
955 ; VBITS_GE_512-NEXT: ptrue p0.h, vl32
956 ; VBITS_GE_512-NEXT: ld1h { z0.h }, p0/z, [x0]
957 ; VBITS_GE_512-NEXT: ld1h { z1.h }, p0/z, [x1]
958 ; VBITS_GE_512-NEXT: eor z0.d, z0.d, z1.d
959 ; VBITS_GE_512-NEXT: st1h { z0.h }, p0, [x0]
960 ; VBITS_GE_512-NEXT: ret
961 %op1 = load <32 x i16>, ptr %a
962 %op2 = load <32 x i16>, ptr %b
963 %res = xor <32 x i16> %op1, %op2
964 store <32 x i16> %res, ptr %a
968 define void @xor_v64i16(ptr %a, ptr %b) vscale_range(8,0) #0 {
969 ; CHECK-LABEL: xor_v64i16:
971 ; CHECK-NEXT: ptrue p0.h, vl64
972 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
973 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
974 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
975 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
977 %op1 = load <64 x i16>, ptr %a
978 %op2 = load <64 x i16>, ptr %b
979 %res = xor <64 x i16> %op1, %op2
980 store <64 x i16> %res, ptr %a
984 define void @xor_v128i16(ptr %a, ptr %b) vscale_range(16,0) #0 {
985 ; CHECK-LABEL: xor_v128i16:
987 ; CHECK-NEXT: ptrue p0.h, vl128
988 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
989 ; CHECK-NEXT: ld1h { z1.h }, p0/z, [x1]
990 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
991 ; CHECK-NEXT: st1h { z0.h }, p0, [x0]
993 %op1 = load <128 x i16>, ptr %a
994 %op2 = load <128 x i16>, ptr %b
995 %res = xor <128 x i16> %op1, %op2
996 store <128 x i16> %res, ptr %a
1000 ; Don't use SVE for 64-bit vectors.
1001 define <2 x i32> @xor_v2i32(<2 x i32> %op1, <2 x i32> %op2) vscale_range(2,0) #0 {
1002 ; CHECK-LABEL: xor_v2i32:
1004 ; CHECK-NEXT: eor v0.8b, v0.8b, v1.8b
1006 %res = xor <2 x i32> %op1, %op2
1010 ; Don't use SVE for 128-bit vectors.
1011 define <4 x i32> @xor_v4i32(<4 x i32> %op1, <4 x i32> %op2) vscale_range(2,0) #0 {
1012 ; CHECK-LABEL: xor_v4i32:
1014 ; CHECK-NEXT: eor v0.16b, v0.16b, v1.16b
1016 %res = xor <4 x i32> %op1, %op2
1020 define void @xor_v8i32(ptr %a, ptr %b) vscale_range(2,0) #0 {
1021 ; CHECK-LABEL: xor_v8i32:
1023 ; CHECK-NEXT: ptrue p0.s, vl8
1024 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
1025 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
1026 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1027 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
1029 %op1 = load <8 x i32>, ptr %a
1030 %op2 = load <8 x i32>, ptr %b
1031 %res = xor <8 x i32> %op1, %op2
1032 store <8 x i32> %res, ptr %a
1036 define void @xor_v16i32(ptr %a, ptr %b) #0 {
1037 ; VBITS_GE_256-LABEL: xor_v16i32:
1038 ; VBITS_GE_256: // %bb.0:
1039 ; VBITS_GE_256-NEXT: ptrue p0.s, vl8
1040 ; VBITS_GE_256-NEXT: mov x8, #8 // =0x8
1041 ; VBITS_GE_256-NEXT: ld1w { z0.s }, p0/z, [x0, x8, lsl #2]
1042 ; VBITS_GE_256-NEXT: ld1w { z1.s }, p0/z, [x0]
1043 ; VBITS_GE_256-NEXT: ld1w { z2.s }, p0/z, [x1, x8, lsl #2]
1044 ; VBITS_GE_256-NEXT: ld1w { z3.s }, p0/z, [x1]
1045 ; VBITS_GE_256-NEXT: eor z0.d, z0.d, z2.d
1046 ; VBITS_GE_256-NEXT: eor z1.d, z1.d, z3.d
1047 ; VBITS_GE_256-NEXT: st1w { z0.s }, p0, [x0, x8, lsl #2]
1048 ; VBITS_GE_256-NEXT: st1w { z1.s }, p0, [x0]
1049 ; VBITS_GE_256-NEXT: ret
1051 ; VBITS_GE_512-LABEL: xor_v16i32:
1052 ; VBITS_GE_512: // %bb.0:
1053 ; VBITS_GE_512-NEXT: ptrue p0.s, vl16
1054 ; VBITS_GE_512-NEXT: ld1w { z0.s }, p0/z, [x0]
1055 ; VBITS_GE_512-NEXT: ld1w { z1.s }, p0/z, [x1]
1056 ; VBITS_GE_512-NEXT: eor z0.d, z0.d, z1.d
1057 ; VBITS_GE_512-NEXT: st1w { z0.s }, p0, [x0]
1058 ; VBITS_GE_512-NEXT: ret
1059 %op1 = load <16 x i32>, ptr %a
1060 %op2 = load <16 x i32>, ptr %b
1061 %res = xor <16 x i32> %op1, %op2
1062 store <16 x i32> %res, ptr %a
1066 define void @xor_v32i32(ptr %a, ptr %b) vscale_range(8,0) #0 {
1067 ; CHECK-LABEL: xor_v32i32:
1069 ; CHECK-NEXT: ptrue p0.s, vl32
1070 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
1071 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
1072 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1073 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
1075 %op1 = load <32 x i32>, ptr %a
1076 %op2 = load <32 x i32>, ptr %b
1077 %res = xor <32 x i32> %op1, %op2
1078 store <32 x i32> %res, ptr %a
1082 define void @xor_v64i32(ptr %a, ptr %b) vscale_range(16,0) #0 {
1083 ; CHECK-LABEL: xor_v64i32:
1085 ; CHECK-NEXT: ptrue p0.s, vl64
1086 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0]
1087 ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x1]
1088 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1089 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
1091 %op1 = load <64 x i32>, ptr %a
1092 %op2 = load <64 x i32>, ptr %b
1093 %res = xor <64 x i32> %op1, %op2
1094 store <64 x i32> %res, ptr %a
1098 ; Don't use SVE for 64-bit vectors.
1099 define <1 x i64> @xor_v1i64(<1 x i64> %op1, <1 x i64> %op2) vscale_range(2,0) #0 {
1100 ; CHECK-LABEL: xor_v1i64:
1102 ; CHECK-NEXT: eor v0.8b, v0.8b, v1.8b
1104 %res = xor <1 x i64> %op1, %op2
1108 ; Don't use SVE for 128-bit vectors.
1109 define <2 x i64> @xor_v2i64(<2 x i64> %op1, <2 x i64> %op2) vscale_range(2,0) #0 {
1110 ; CHECK-LABEL: xor_v2i64:
1112 ; CHECK-NEXT: eor v0.16b, v0.16b, v1.16b
1114 %res = xor <2 x i64> %op1, %op2
1118 define void @xor_v4i64(ptr %a, ptr %b) vscale_range(2,0) #0 {
1119 ; CHECK-LABEL: xor_v4i64:
1121 ; CHECK-NEXT: ptrue p0.d, vl4
1122 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
1123 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
1124 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1125 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
1127 %op1 = load <4 x i64>, ptr %a
1128 %op2 = load <4 x i64>, ptr %b
1129 %res = xor <4 x i64> %op1, %op2
1130 store <4 x i64> %res, ptr %a
1134 define void @xor_v8i64(ptr %a, ptr %b) #0 {
1135 ; VBITS_GE_256-LABEL: xor_v8i64:
1136 ; VBITS_GE_256: // %bb.0:
1137 ; VBITS_GE_256-NEXT: ptrue p0.d, vl4
1138 ; VBITS_GE_256-NEXT: mov x8, #4 // =0x4
1139 ; VBITS_GE_256-NEXT: ld1d { z0.d }, p0/z, [x0, x8, lsl #3]
1140 ; VBITS_GE_256-NEXT: ld1d { z1.d }, p0/z, [x0]
1141 ; VBITS_GE_256-NEXT: ld1d { z2.d }, p0/z, [x1, x8, lsl #3]
1142 ; VBITS_GE_256-NEXT: ld1d { z3.d }, p0/z, [x1]
1143 ; VBITS_GE_256-NEXT: eor z0.d, z0.d, z2.d
1144 ; VBITS_GE_256-NEXT: eor z1.d, z1.d, z3.d
1145 ; VBITS_GE_256-NEXT: st1d { z0.d }, p0, [x0, x8, lsl #3]
1146 ; VBITS_GE_256-NEXT: st1d { z1.d }, p0, [x0]
1147 ; VBITS_GE_256-NEXT: ret
1149 ; VBITS_GE_512-LABEL: xor_v8i64:
1150 ; VBITS_GE_512: // %bb.0:
1151 ; VBITS_GE_512-NEXT: ptrue p0.d, vl8
1152 ; VBITS_GE_512-NEXT: ld1d { z0.d }, p0/z, [x0]
1153 ; VBITS_GE_512-NEXT: ld1d { z1.d }, p0/z, [x1]
1154 ; VBITS_GE_512-NEXT: eor z0.d, z0.d, z1.d
1155 ; VBITS_GE_512-NEXT: st1d { z0.d }, p0, [x0]
1156 ; VBITS_GE_512-NEXT: ret
1157 %op1 = load <8 x i64>, ptr %a
1158 %op2 = load <8 x i64>, ptr %b
1159 %res = xor <8 x i64> %op1, %op2
1160 store <8 x i64> %res, ptr %a
1164 define void @xor_v16i64(ptr %a, ptr %b) vscale_range(8,0) #0 {
1165 ; CHECK-LABEL: xor_v16i64:
1167 ; CHECK-NEXT: ptrue p0.d, vl16
1168 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
1169 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
1170 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1171 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
1173 %op1 = load <16 x i64>, ptr %a
1174 %op2 = load <16 x i64>, ptr %b
1175 %res = xor <16 x i64> %op1, %op2
1176 store <16 x i64> %res, ptr %a
1180 define void @xor_v32i64(ptr %a, ptr %b) vscale_range(16,0) #0 {
1181 ; CHECK-LABEL: xor_v32i64:
1183 ; CHECK-NEXT: ptrue p0.d, vl32
1184 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0]
1185 ; CHECK-NEXT: ld1d { z1.d }, p0/z, [x1]
1186 ; CHECK-NEXT: eor z0.d, z0.d, z1.d
1187 ; CHECK-NEXT: st1d { z0.d }, p0, [x0]
1189 %op1 = load <32 x i64>, ptr %a
1190 %op2 = load <32 x i64>, ptr %b
1191 %res = xor <32 x i64> %op1, %op2
1192 store <32 x i64> %res, ptr %a
1196 attributes #0 = { "target-features"="+sve" }