1 ; RUN: llc -aarch64-sve-vector-bits-min=128 < %s | FileCheck %s -D#VBYTES=16 -check-prefix=NO_SVE
2 ; RUN: llc -aarch64-sve-vector-bits-min=256 < %s | FileCheck %s -D#VBYTES=32 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512,VBITS_LE_256
3 ; RUN: llc -aarch64-sve-vector-bits-min=384 < %s | FileCheck %s -D#VBYTES=32 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512,VBITS_LE_256
4 ; RUN: llc -aarch64-sve-vector-bits-min=512 < %s | FileCheck %s -D#VBYTES=64 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512
5 ; RUN: llc -aarch64-sve-vector-bits-min=640 < %s | FileCheck %s -D#VBYTES=64 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512
6 ; RUN: llc -aarch64-sve-vector-bits-min=768 < %s | FileCheck %s -D#VBYTES=64 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512
7 ; RUN: llc -aarch64-sve-vector-bits-min=896 < %s | FileCheck %s -D#VBYTES=64 -check-prefixes=CHECK,VBITS_LE_1024,VBITS_LE_512
8 ; RUN: llc -aarch64-sve-vector-bits-min=1024 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
9 ; RUN: llc -aarch64-sve-vector-bits-min=1152 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
10 ; RUN: llc -aarch64-sve-vector-bits-min=1280 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
11 ; RUN: llc -aarch64-sve-vector-bits-min=1408 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
12 ; RUN: llc -aarch64-sve-vector-bits-min=1536 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
13 ; RUN: llc -aarch64-sve-vector-bits-min=1664 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
14 ; RUN: llc -aarch64-sve-vector-bits-min=1792 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
15 ; RUN: llc -aarch64-sve-vector-bits-min=1920 < %s | FileCheck %s -D#VBYTES=128 -check-prefixes=CHECK,VBITS_LE_1024
16 ; RUN: llc -aarch64-sve-vector-bits-min=2048 < %s | FileCheck %s -D#VBYTES=256 -check-prefixes=CHECK
18 ; VBYTES represents the useful byte size of a vector register from the code
19 ; generator's point of view. It is clamped to power-of-2 values because
20 ; only power-of-2 vector lengths are considered legal, regardless of the
21 ; user specified vector length.
23 target triple = "aarch64-unknown-linux-gnu"
25 ; Don't use SVE when its registers are no bigger than NEON.
32 ; Don't use SVE for 64-bit vectors.
33 define <8 x i8> @and_v8i8(<8 x i8> %op1, <8 x i8> %op2) #0 {
34 ; CHECK-LABEL: and_v8i8:
35 ; CHECK: and v0.8b, v0.8b, v1.8b
37 %res = and <8 x i8> %op1, %op2
41 ; Don't use SVE for 128-bit vectors.
42 define <16 x i8> @and_v16i8(<16 x i8> %op1, <16 x i8> %op2) #0 {
43 ; CHECK-LABEL: and_v16i8:
44 ; CHECK: and v0.16b, v0.16b, v1.16b
46 %res = and <16 x i8> %op1, %op2
50 define void @and_v32i8(<32 x i8>* %a, <32 x i8>* %b) #0 {
51 ; CHECK-LABEL: and_v32i8:
52 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,32)]]
53 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
54 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
55 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
56 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
58 %op1 = load <32 x i8>, <32 x i8>* %a
59 %op2 = load <32 x i8>, <32 x i8>* %b
60 %res = and <32 x i8> %op1, %op2
61 store <32 x i8> %res, <32 x i8>* %a
65 define void @and_v64i8(<64 x i8>* %a, <64 x i8>* %b) #0 {
66 ; CHECK-LABEL: and_v64i8:
67 ; CHECK-DAG: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,64)]]
68 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
69 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
70 ; CHECK-DAG: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
71 ; CHECK-DAG: st1b { [[RES]].b }, [[PG]], [x0]
72 ; VBITS_LE_256-DAG: mov w[[OFF_1:[0-9]+]], #[[#VBYTES]]
73 ; VBITS_LE_256-DAG: ld1b { [[OP1_1:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_1]]]
74 ; VBITS_LE_256-DAG: ld1b { [[OP2_1:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_1]]]
75 ; VBITS_LE_256-DAG: and [[RES_1:z[0-9]+]].d, [[OP1_1]].d, [[OP2_1]].d
76 ; VBITS_LE_256-DAG: st1b { [[RES_1]].b }, [[PG]], [x0, x[[OFF_1]]]
78 %op1 = load <64 x i8>, <64 x i8>* %a
79 %op2 = load <64 x i8>, <64 x i8>* %b
80 %res = and <64 x i8> %op1, %op2
81 store <64 x i8> %res, <64 x i8>* %a
85 define void @and_v128i8(<128 x i8>* %a, <128 x i8>* %b) #0 {
86 ; CHECK-LABEL: and_v128i8:
87 ; CHECK-DAG: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,128)]]
88 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
89 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
90 ; CHECK-DAG: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
91 ; CHECK-DAG: st1b { [[RES]].b }, [[PG]], [x0]
92 ; VBITS_LE_512-DAG: mov w[[OFF_1:[0-9]+]], #[[#VBYTES]]
93 ; VBITS_LE_512-DAG: ld1b { [[OP1_1:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_1]]]
94 ; VBITS_LE_512-DAG: ld1b { [[OP2_1:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_1]]]
95 ; VBITS_LE_512-DAG: and [[RES_1:z[0-9]+]].d, [[OP1_1]].d, [[OP2_1]].d
96 ; VBITS_LE_512-DAG: st1b { [[RES_1]].b }, [[PG]], [x0, x[[OFF_1]]]
97 ; VBITS_LE_256-DAG: mov w[[OFF_2:[0-9]+]], #[[#mul(VBYTES,2)]]
98 ; VBITS_LE_256-DAG: ld1b { [[OP1_2:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_2]]]
99 ; VBITS_LE_256-DAG: ld1b { [[OP2_2:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_2]]]
100 ; VBITS_LE_256-DAG: and [[RES_2:z[0-9]+]].d, [[OP1_2]].d, [[OP2_2]].d
101 ; VBITS_LE_256-DAG: st1b { [[RES_2]].b }, [[PG]], [x0, x[[OFF_2]]]
102 ; VBITS_LE_256-DAG: mov w[[OFF_3:[0-9]+]], #[[#mul(VBYTES,3)]]
103 ; VBITS_LE_256-DAG: ld1b { [[OP1_3:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_3]]]
104 ; VBITS_LE_256-DAG: ld1b { [[OP2_3:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_3]]]
105 ; VBITS_LE_256-DAG: and [[RES_3:z[0-9]+]].d, [[OP1_3]].d, [[OP2_3]].d
106 ; VBITS_LE_256-DAG: st1b { [[RES_3]].b }, [[PG]], [x0, x[[OFF_3]]]
108 %op1 = load <128 x i8>, <128 x i8>* %a
109 %op2 = load <128 x i8>, <128 x i8>* %b
110 %res = and <128 x i8> %op1, %op2
111 store <128 x i8> %res, <128 x i8>* %a
115 define void @and_v256i8(<256 x i8>* %a, <256 x i8>* %b) #0 {
116 ; CHECK-LABEL: and_v256i8:
117 ; CHECK-DAG: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,256)]]
118 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
119 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
120 ; CHECK-DAG: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
121 ; CHECK-DAG: st1b { [[RES]].b }, [[PG]], [x0]
122 ; VBITS_LE_1024-DAG: mov w[[OFF_1:[0-9]+]], #[[#VBYTES]]
123 ; VBITS_LE_1024-DAG: ld1b { [[OP1_1:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_1]]]
124 ; VBITS_LE_1024-DAG: ld1b { [[OP2_1:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_1]]]
125 ; VBITS_LE_1024-DAG: and [[RES_1:z[0-9]+]].d, [[OP1_1]].d, [[OP2_1]].d
126 ; VBITS_LE_1024-DAG: st1b { [[RES_1]].b }, [[PG]], [x0, x[[OFF_1]]]
127 ; VBITS_LE_512-DAG: mov w[[OFF_2:[0-9]+]], #[[#mul(VBYTES,2)]]
128 ; VBITS_LE_512-DAG: ld1b { [[OP1_2:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_2]]]
129 ; VBITS_LE_512-DAG: ld1b { [[OP2_2:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_2]]]
130 ; VBITS_LE_512-DAG: and [[RES_2:z[0-9]+]].d, [[OP1_2]].d, [[OP2_2]].d
131 ; VBITS_LE_512-DAG: st1b { [[RES_2]].b }, [[PG]], [x0, x[[OFF_2]]]
132 ; VBITS_LE_512-DAG: mov w[[OFF_3:[0-9]+]], #[[#mul(VBYTES,3)]]
133 ; VBITS_LE_512-DAG: ld1b { [[OP1_3:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_3]]]
134 ; VBITS_LE_512-DAG: ld1b { [[OP2_3:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_3]]]
135 ; VBITS_LE_512-DAG: and [[RES_3:z[0-9]+]].d, [[OP1_3]].d, [[OP2_3]].d
136 ; VBITS_LE_512-DAG: st1b { [[RES_3]].b }, [[PG]], [x0, x[[OFF_3]]]
137 ; VBITS_LE_256-DAG: mov w[[OFF_4:[0-9]+]], #[[#mul(VBYTES,4)]]
138 ; VBITS_LE_256-DAG: ld1b { [[OP1_4:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_4]]]
139 ; VBITS_LE_256-DAG: ld1b { [[OP2_4:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_4]]]
140 ; VBITS_LE_256-DAG: and [[RES_4:z[0-9]+]].d, [[OP1_4]].d, [[OP2_4]].d
141 ; VBITS_LE_256-DAG: st1b { [[RES_4]].b }, [[PG]], [x0, x[[OFF_4]]]
142 ; VBITS_LE_256-DAG: mov w[[OFF_5:[0-9]+]], #[[#mul(VBYTES,5)]]
143 ; VBITS_LE_256-DAG: ld1b { [[OP1_5:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_5]]]
144 ; VBITS_LE_256-DAG: ld1b { [[OP2_5:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_5]]]
145 ; VBITS_LE_256-DAG: and [[RES_5:z[0-9]+]].d, [[OP1_5]].d, [[OP2_5]].d
146 ; VBITS_LE_256-DAG: st1b { [[RES_5]].b }, [[PG]], [x0, x[[OFF_5]]]
147 ; VBITS_LE_256-DAG: mov w[[OFF_6:[0-9]+]], #[[#mul(VBYTES,6)]]
148 ; VBITS_LE_256-DAG: ld1b { [[OP1_6:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_6]]]
149 ; VBITS_LE_256-DAG: ld1b { [[OP2_6:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_6]]]
150 ; VBITS_LE_256-DAG: and [[RES_6:z[0-9]+]].d, [[OP1_6]].d, [[OP2_6]].d
151 ; VBITS_LE_256-DAG: st1b { [[RES_6]].b }, [[PG]], [x0, x[[OFF_6]]]
152 ; VBITS_LE_256-DAG: mov w[[OFF_7:[0-9]+]], #[[#mul(VBYTES,7)]]
153 ; VBITS_LE_256-DAG: ld1b { [[OP1_7:z[0-9]+]].b }, [[PG]]/z, [x0, x[[OFF_7]]]
154 ; VBITS_LE_256-DAG: ld1b { [[OP2_7:z[0-9]+]].b }, [[PG]]/z, [x1, x[[OFF_7]]]
155 ; VBITS_LE_256-DAG: and [[RES_7:z[0-9]+]].d, [[OP1_7]].d, [[OP2_7]].d
156 ; VBITS_LE_256-DAG: st1b { [[RES_7]].b }, [[PG]], [x0, x[[OFF_7]]]
158 %op1 = load <256 x i8>, <256 x i8>* %a
159 %op2 = load <256 x i8>, <256 x i8>* %b
160 %res = and <256 x i8> %op1, %op2
161 store <256 x i8> %res, <256 x i8>* %a
165 ; Don't use SVE for 64-bit vectors.
166 define <4 x i16> @and_v4i16(<4 x i16> %op1, <4 x i16> %op2) #0 {
167 ; CHECK-LABEL: and_v4i16:
168 ; CHECK: and v0.8b, v0.8b, v1.8b
170 %res = and <4 x i16> %op1, %op2
174 ; Don't use SVE for 128-bit vectors.
175 define <8 x i16> @and_v8i16(<8 x i16> %op1, <8 x i16> %op2) #0 {
176 ; CHECK-LABEL: and_v8i16:
177 ; CHECK: and v0.16b, v0.16b, v1.16b
179 %res = and <8 x i16> %op1, %op2
183 define void @and_v16i16(<16 x i16>* %a, <16 x i16>* %b) #0 {
184 ; CHECK-LABEL: and_v16i16:
185 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),16)]]
186 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
187 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
188 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
189 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
191 %op1 = load <16 x i16>, <16 x i16>* %a
192 %op2 = load <16 x i16>, <16 x i16>* %b
193 %res = and <16 x i16> %op1, %op2
194 store <16 x i16> %res, <16 x i16>* %a
198 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
199 ; already cover the general legalisation cases.
200 define void @and_v32i16(<32 x i16>* %a, <32 x i16>* %b) #0 {
201 ; CHECK-LABEL: and_v32i16:
202 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),32)]]
203 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
204 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
205 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
206 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
208 %op1 = load <32 x i16>, <32 x i16>* %a
209 %op2 = load <32 x i16>, <32 x i16>* %b
210 %res = and <32 x i16> %op1, %op2
211 store <32 x i16> %res, <32 x i16>* %a
215 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
216 ; already cover the general legalisation cases.
217 define void @and_v64i16(<64 x i16>* %a, <64 x i16>* %b) #0 {
218 ; CHECK-LABEL: and_v64i16:
219 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),64)]]
220 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
221 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
222 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
223 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
225 %op1 = load <64 x i16>, <64 x i16>* %a
226 %op2 = load <64 x i16>, <64 x i16>* %b
227 %res = and <64 x i16> %op1, %op2
228 store <64 x i16> %res, <64 x i16>* %a
232 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
233 ; already cover the general legalisation cases.
234 define void @and_v128i16(<128 x i16>* %a, <128 x i16>* %b) #0 {
235 ; CHECK-LABEL: and_v128i16:
236 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),128)]]
237 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
238 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
239 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
240 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
242 %op1 = load <128 x i16>, <128 x i16>* %a
243 %op2 = load <128 x i16>, <128 x i16>* %b
244 %res = and <128 x i16> %op1, %op2
245 store <128 x i16> %res, <128 x i16>* %a
249 ; Don't use SVE for 64-bit vectors.
250 define <2 x i32> @and_v2i32(<2 x i32> %op1, <2 x i32> %op2) #0 {
251 ; CHECK-LABEL: and_v2i32:
252 ; CHECK: and v0.8b, v0.8b, v1.8b
254 %res = and <2 x i32> %op1, %op2
258 ; Don't use SVE for 128-bit vectors.
259 define <4 x i32> @and_v4i32(<4 x i32> %op1, <4 x i32> %op2) #0 {
260 ; CHECK-LABEL: and_v4i32:
261 ; CHECK: and v0.16b, v0.16b, v1.16b
263 %res = and <4 x i32> %op1, %op2
267 define void @and_v8i32(<8 x i32>* %a, <8 x i32>* %b) #0 {
268 ; CHECK-LABEL: and_v8i32:
269 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),8)]]
270 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
271 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
272 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
273 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
275 %op1 = load <8 x i32>, <8 x i32>* %a
276 %op2 = load <8 x i32>, <8 x i32>* %b
277 %res = and <8 x i32> %op1, %op2
278 store <8 x i32> %res, <8 x i32>* %a
282 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
283 ; already cover the general legalisation cases.
284 define void @and_v16i32(<16 x i32>* %a, <16 x i32>* %b) #0 {
285 ; CHECK-LABEL: and_v16i32:
286 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),16)]]
287 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
288 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
289 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
290 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
292 %op1 = load <16 x i32>, <16 x i32>* %a
293 %op2 = load <16 x i32>, <16 x i32>* %b
294 %res = and <16 x i32> %op1, %op2
295 store <16 x i32> %res, <16 x i32>* %a
299 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
300 ; already cover the general legalisation cases.
301 define void @and_v32i32(<32 x i32>* %a, <32 x i32>* %b) #0 {
302 ; CHECK-LABEL: and_v32i32:
303 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),32)]]
304 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
305 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
306 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
307 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
309 %op1 = load <32 x i32>, <32 x i32>* %a
310 %op2 = load <32 x i32>, <32 x i32>* %b
311 %res = and <32 x i32> %op1, %op2
312 store <32 x i32> %res, <32 x i32>* %a
316 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
317 ; already cover the general legalisation cases.
318 define void @and_v64i32(<64 x i32>* %a, <64 x i32>* %b) #0 {
319 ; CHECK-LABEL: and_v64i32:
320 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),64)]]
321 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
322 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
323 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
324 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
326 %op1 = load <64 x i32>, <64 x i32>* %a
327 %op2 = load <64 x i32>, <64 x i32>* %b
328 %res = and <64 x i32> %op1, %op2
329 store <64 x i32> %res, <64 x i32>* %a
333 ; Don't use SVE for 64-bit vectors.
334 define <1 x i64> @and_v1i64(<1 x i64> %op1, <1 x i64> %op2) #0 {
335 ; CHECK-LABEL: and_v1i64:
336 ; CHECK: and v0.8b, v0.8b, v1.8b
338 %res = and <1 x i64> %op1, %op2
342 ; Don't use SVE for 128-bit vectors.
343 define <2 x i64> @and_v2i64(<2 x i64> %op1, <2 x i64> %op2) #0 {
344 ; CHECK-LABEL: and_v2i64:
345 ; CHECK: and v0.16b, v0.16b, v1.16b
347 %res = and <2 x i64> %op1, %op2
351 define void @and_v4i64(<4 x i64>* %a, <4 x i64>* %b) #0 {
352 ; CHECK-LABEL: and_v4i64:
353 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),4)]]
354 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
355 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
356 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
357 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
359 %op1 = load <4 x i64>, <4 x i64>* %a
360 %op2 = load <4 x i64>, <4 x i64>* %b
361 %res = and <4 x i64> %op1, %op2
362 store <4 x i64> %res, <4 x i64>* %a
366 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
367 ; already cover the general legalisation cases.
368 define void @and_v8i64(<8 x i64>* %a, <8 x i64>* %b) #0 {
369 ; CHECK-LABEL: and_v8i64:
370 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),8)]]
371 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
372 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
373 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
374 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
376 %op1 = load <8 x i64>, <8 x i64>* %a
377 %op2 = load <8 x i64>, <8 x i64>* %b
378 %res = and <8 x i64> %op1, %op2
379 store <8 x i64> %res, <8 x i64>* %a
383 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
384 ; already cover the general legalisation cases.
385 define void @and_v16i64(<16 x i64>* %a, <16 x i64>* %b) #0 {
386 ; CHECK-LABEL: and_v16i64:
387 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),16)]]
388 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
389 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
390 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
391 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
393 %op1 = load <16 x i64>, <16 x i64>* %a
394 %op2 = load <16 x i64>, <16 x i64>* %b
395 %res = and <16 x i64> %op1, %op2
396 store <16 x i64> %res, <16 x i64>* %a
400 ; NOTE: Check lines only cover the first VBYTES because the and_v#i8 tests
401 ; already cover the general legalisation cases.
402 define void @and_v32i64(<32 x i64>* %a, <32 x i64>* %b) #0 {
403 ; CHECK-LABEL: and_v32i64:
404 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),32)]]
405 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
406 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
407 ; CHECK: and [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
408 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
410 %op1 = load <32 x i64>, <32 x i64>* %a
411 %op2 = load <32 x i64>, <32 x i64>* %b
412 %res = and <32 x i64> %op1, %op2
413 store <32 x i64> %res, <32 x i64>* %a
418 ; NOTE: Tests beyond this point only have CHECK lines to validate the first
419 ; VBYTES because the and tests already validate the legalisation code paths.
426 ; Don't use SVE for 64-bit vectors.
427 define <8 x i8> @or_v8i8(<8 x i8> %op1, <8 x i8> %op2) #0 {
428 ; CHECK-LABEL: or_v8i8:
429 ; CHECK: orr v0.8b, v0.8b, v1.8b
431 %res = or <8 x i8> %op1, %op2
435 ; Don't use SVE for 128-bit vectors.
436 define <16 x i8> @or_v16i8(<16 x i8> %op1, <16 x i8> %op2) #0 {
437 ; CHECK-LABEL: or_v16i8:
438 ; CHECK: orr v0.16b, v0.16b, v1.16b
440 %res = or <16 x i8> %op1, %op2
444 define void @or_v32i8(<32 x i8>* %a, <32 x i8>* %b) #0 {
445 ; CHECK-LABEL: or_v32i8:
446 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,32)]]
447 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
448 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
449 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
450 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
452 %op1 = load <32 x i8>, <32 x i8>* %a
453 %op2 = load <32 x i8>, <32 x i8>* %b
454 %res = or <32 x i8> %op1, %op2
455 store <32 x i8> %res, <32 x i8>* %a
459 define void @or_v64i8(<64 x i8>* %a, <64 x i8>* %b) #0 {
460 ; CHECK-LABEL: or_v64i8:
461 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,64)]]
462 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
463 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
464 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
465 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
467 %op1 = load <64 x i8>, <64 x i8>* %a
468 %op2 = load <64 x i8>, <64 x i8>* %b
469 %res = or <64 x i8> %op1, %op2
470 store <64 x i8> %res, <64 x i8>* %a
474 define void @or_v128i8(<128 x i8>* %a, <128 x i8>* %b) #0 {
475 ; CHECK-LABEL: or_v128i8:
476 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,128)]]
477 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
478 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
479 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
480 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
482 %op1 = load <128 x i8>, <128 x i8>* %a
483 %op2 = load <128 x i8>, <128 x i8>* %b
484 %res = or <128 x i8> %op1, %op2
485 store <128 x i8> %res, <128 x i8>* %a
489 define void @or_v256i8(<256 x i8>* %a, <256 x i8>* %b) #0 {
490 ; CHECK-LABEL: or_v256i8:
491 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,256)]]
492 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
493 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
494 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
495 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
497 %op1 = load <256 x i8>, <256 x i8>* %a
498 %op2 = load <256 x i8>, <256 x i8>* %b
499 %res = or <256 x i8> %op1, %op2
500 store <256 x i8> %res, <256 x i8>* %a
504 ; Don't use SVE for 64-bit vectors.
505 define <4 x i16> @or_v4i16(<4 x i16> %op1, <4 x i16> %op2) #0 {
506 ; CHECK-LABEL: or_v4i16:
507 ; CHECK: orr v0.8b, v0.8b, v1.8b
509 %res = or <4 x i16> %op1, %op2
513 ; Don't use SVE for 128-bit vectors.
514 define <8 x i16> @or_v8i16(<8 x i16> %op1, <8 x i16> %op2) #0 {
515 ; CHECK-LABEL: or_v8i16:
516 ; CHECK: orr v0.16b, v0.16b, v1.16b
518 %res = or <8 x i16> %op1, %op2
522 define void @or_v16i16(<16 x i16>* %a, <16 x i16>* %b) #0 {
523 ; CHECK-LABEL: or_v16i16:
524 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),16)]]
525 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
526 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
527 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
528 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
530 %op1 = load <16 x i16>, <16 x i16>* %a
531 %op2 = load <16 x i16>, <16 x i16>* %b
532 %res = or <16 x i16> %op1, %op2
533 store <16 x i16> %res, <16 x i16>* %a
537 define void @or_v32i16(<32 x i16>* %a, <32 x i16>* %b) #0 {
538 ; CHECK-LABEL: or_v32i16:
539 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),32)]]
540 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
541 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
542 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
543 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
545 %op1 = load <32 x i16>, <32 x i16>* %a
546 %op2 = load <32 x i16>, <32 x i16>* %b
547 %res = or <32 x i16> %op1, %op2
548 store <32 x i16> %res, <32 x i16>* %a
552 define void @or_v64i16(<64 x i16>* %a, <64 x i16>* %b) #0 {
553 ; CHECK-LABEL: or_v64i16:
554 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),64)]]
555 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
556 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
557 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
558 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
560 %op1 = load <64 x i16>, <64 x i16>* %a
561 %op2 = load <64 x i16>, <64 x i16>* %b
562 %res = or <64 x i16> %op1, %op2
563 store <64 x i16> %res, <64 x i16>* %a
567 define void @or_v128i16(<128 x i16>* %a, <128 x i16>* %b) #0 {
568 ; CHECK-LABEL: or_v128i16:
569 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),128)]]
570 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
571 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
572 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
573 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
575 %op1 = load <128 x i16>, <128 x i16>* %a
576 %op2 = load <128 x i16>, <128 x i16>* %b
577 %res = or <128 x i16> %op1, %op2
578 store <128 x i16> %res, <128 x i16>* %a
582 ; Don't use SVE for 64-bit vectors.
583 define <2 x i32> @or_v2i32(<2 x i32> %op1, <2 x i32> %op2) #0 {
584 ; CHECK-LABEL: or_v2i32:
585 ; CHECK: orr v0.8b, v0.8b, v1.8b
587 %res = or <2 x i32> %op1, %op2
591 ; Don't use SVE for 128-bit vectors.
592 define <4 x i32> @or_v4i32(<4 x i32> %op1, <4 x i32> %op2) #0 {
593 ; CHECK-LABEL: or_v4i32:
594 ; CHECK: orr v0.16b, v0.16b, v1.16b
596 %res = or <4 x i32> %op1, %op2
600 define void @or_v8i32(<8 x i32>* %a, <8 x i32>* %b) #0 {
601 ; CHECK-LABEL: or_v8i32:
602 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),8)]]
603 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
604 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
605 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
606 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
608 %op1 = load <8 x i32>, <8 x i32>* %a
609 %op2 = load <8 x i32>, <8 x i32>* %b
610 %res = or <8 x i32> %op1, %op2
611 store <8 x i32> %res, <8 x i32>* %a
615 define void @or_v16i32(<16 x i32>* %a, <16 x i32>* %b) #0 {
616 ; CHECK-LABEL: or_v16i32:
617 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),16)]]
618 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
619 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
620 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
621 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
623 %op1 = load <16 x i32>, <16 x i32>* %a
624 %op2 = load <16 x i32>, <16 x i32>* %b
625 %res = or <16 x i32> %op1, %op2
626 store <16 x i32> %res, <16 x i32>* %a
630 define void @or_v32i32(<32 x i32>* %a, <32 x i32>* %b) #0 {
631 ; CHECK-LABEL: or_v32i32:
632 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),32)]]
633 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
634 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
635 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
636 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
638 %op1 = load <32 x i32>, <32 x i32>* %a
639 %op2 = load <32 x i32>, <32 x i32>* %b
640 %res = or <32 x i32> %op1, %op2
641 store <32 x i32> %res, <32 x i32>* %a
645 define void @or_v64i32(<64 x i32>* %a, <64 x i32>* %b) #0 {
646 ; CHECK-LABEL: or_v64i32:
647 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),64)]]
648 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
649 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
650 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
651 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
653 %op1 = load <64 x i32>, <64 x i32>* %a
654 %op2 = load <64 x i32>, <64 x i32>* %b
655 %res = or <64 x i32> %op1, %op2
656 store <64 x i32> %res, <64 x i32>* %a
660 ; Don't use SVE for 64-bit vectors.
661 define <1 x i64> @or_v1i64(<1 x i64> %op1, <1 x i64> %op2) #0 {
662 ; CHECK-LABEL: or_v1i64:
663 ; CHECK: orr v0.8b, v0.8b, v1.8b
665 %res = or <1 x i64> %op1, %op2
669 ; Don't use SVE for 128-bit vectors.
670 define <2 x i64> @or_v2i64(<2 x i64> %op1, <2 x i64> %op2) #0 {
671 ; CHECK-LABEL: or_v2i64:
672 ; CHECK: orr v0.16b, v0.16b, v1.16b
674 %res = or <2 x i64> %op1, %op2
678 define void @or_v4i64(<4 x i64>* %a, <4 x i64>* %b) #0 {
679 ; CHECK-LABEL: or_v4i64:
680 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),4)]]
681 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
682 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
683 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
684 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
686 %op1 = load <4 x i64>, <4 x i64>* %a
687 %op2 = load <4 x i64>, <4 x i64>* %b
688 %res = or <4 x i64> %op1, %op2
689 store <4 x i64> %res, <4 x i64>* %a
693 define void @or_v8i64(<8 x i64>* %a, <8 x i64>* %b) #0 {
694 ; CHECK-LABEL: or_v8i64:
695 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),8)]]
696 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
697 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
698 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
699 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
701 %op1 = load <8 x i64>, <8 x i64>* %a
702 %op2 = load <8 x i64>, <8 x i64>* %b
703 %res = or <8 x i64> %op1, %op2
704 store <8 x i64> %res, <8 x i64>* %a
708 define void @or_v16i64(<16 x i64>* %a, <16 x i64>* %b) #0 {
709 ; CHECK-LABEL: or_v16i64:
710 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),16)]]
711 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
712 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
713 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
714 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
716 %op1 = load <16 x i64>, <16 x i64>* %a
717 %op2 = load <16 x i64>, <16 x i64>* %b
718 %res = or <16 x i64> %op1, %op2
719 store <16 x i64> %res, <16 x i64>* %a
723 define void @or_v32i64(<32 x i64>* %a, <32 x i64>* %b) #0 {
724 ; CHECK-LABEL: or_v32i64:
725 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),32)]]
726 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
727 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
728 ; CHECK: orr [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
729 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
731 %op1 = load <32 x i64>, <32 x i64>* %a
732 %op2 = load <32 x i64>, <32 x i64>* %b
733 %res = or <32 x i64> %op1, %op2
734 store <32 x i64> %res, <32 x i64>* %a
742 ; Don't use SVE for 64-bit vectors.
743 define <8 x i8> @xor_v8i8(<8 x i8> %op1, <8 x i8> %op2) #0 {
744 ; CHECK-LABEL: xor_v8i8:
745 ; CHECK: eor v0.8b, v0.8b, v1.8b
747 %res = xor <8 x i8> %op1, %op2
751 ; Don't use SVE for 128-bit vectors.
752 define <16 x i8> @xor_v16i8(<16 x i8> %op1, <16 x i8> %op2) #0 {
753 ; CHECK-LABEL: xor_v16i8:
754 ; CHECK: eor v0.16b, v0.16b, v1.16b
756 %res = xor <16 x i8> %op1, %op2
760 define void @xor_v32i8(<32 x i8>* %a, <32 x i8>* %b) #0 {
761 ; CHECK-LABEL: xor_v32i8:
762 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,32)]]
763 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
764 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
765 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
766 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
768 %op1 = load <32 x i8>, <32 x i8>* %a
769 %op2 = load <32 x i8>, <32 x i8>* %b
770 %res = xor <32 x i8> %op1, %op2
771 store <32 x i8> %res, <32 x i8>* %a
775 define void @xor_v64i8(<64 x i8>* %a, <64 x i8>* %b) #0 {
776 ; CHECK-LABEL: xor_v64i8:
777 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,64)]]
778 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
779 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
780 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
781 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
783 %op1 = load <64 x i8>, <64 x i8>* %a
784 %op2 = load <64 x i8>, <64 x i8>* %b
785 %res = xor <64 x i8> %op1, %op2
786 store <64 x i8> %res, <64 x i8>* %a
790 define void @xor_v128i8(<128 x i8>* %a, <128 x i8>* %b) #0 {
791 ; CHECK-LABEL: xor_v128i8:
792 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,128)]]
793 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
794 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
795 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
796 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
798 %op1 = load <128 x i8>, <128 x i8>* %a
799 %op2 = load <128 x i8>, <128 x i8>* %b
800 %res = xor <128 x i8> %op1, %op2
801 store <128 x i8> %res, <128 x i8>* %a
805 define void @xor_v256i8(<256 x i8>* %a, <256 x i8>* %b) #0 {
806 ; CHECK-LABEL: xor_v256i8:
807 ; CHECK: ptrue [[PG:p[0-9]+]].b, vl[[#min(VBYTES,256)]]
808 ; CHECK-DAG: ld1b { [[OP1:z[0-9]+]].b }, [[PG]]/z, [x0]
809 ; CHECK-DAG: ld1b { [[OP2:z[0-9]+]].b }, [[PG]]/z, [x1]
810 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
811 ; CHECK: st1b { [[RES]].b }, [[PG]], [x0]
813 %op1 = load <256 x i8>, <256 x i8>* %a
814 %op2 = load <256 x i8>, <256 x i8>* %b
815 %res = xor <256 x i8> %op1, %op2
816 store <256 x i8> %res, <256 x i8>* %a
820 ; Don't use SVE for 64-bit vectors.
821 define <4 x i16> @xor_v4i16(<4 x i16> %op1, <4 x i16> %op2) #0 {
822 ; CHECK-LABEL: xor_v4i16:
823 ; CHECK: eor v0.8b, v0.8b, v1.8b
825 %res = xor <4 x i16> %op1, %op2
829 ; Don't use SVE for 128-bit vectors.
830 define <8 x i16> @xor_v8i16(<8 x i16> %op1, <8 x i16> %op2) #0 {
831 ; CHECK-LABEL: xor_v8i16:
832 ; CHECK: eor v0.16b, v0.16b, v1.16b
834 %res = xor <8 x i16> %op1, %op2
838 define void @xor_v16i16(<16 x i16>* %a, <16 x i16>* %b) #0 {
839 ; CHECK-LABEL: xor_v16i16:
840 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),16)]]
841 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
842 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
843 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
844 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
846 %op1 = load <16 x i16>, <16 x i16>* %a
847 %op2 = load <16 x i16>, <16 x i16>* %b
848 %res = xor <16 x i16> %op1, %op2
849 store <16 x i16> %res, <16 x i16>* %a
853 define void @xor_v32i16(<32 x i16>* %a, <32 x i16>* %b) #0 {
854 ; CHECK-LABEL: xor_v32i16:
855 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),32)]]
856 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
857 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
858 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
859 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
861 %op1 = load <32 x i16>, <32 x i16>* %a
862 %op2 = load <32 x i16>, <32 x i16>* %b
863 %res = xor <32 x i16> %op1, %op2
864 store <32 x i16> %res, <32 x i16>* %a
868 define void @xor_v64i16(<64 x i16>* %a, <64 x i16>* %b) #0 {
869 ; CHECK-LABEL: xor_v64i16:
870 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),64)]]
871 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
872 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
873 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
874 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
876 %op1 = load <64 x i16>, <64 x i16>* %a
877 %op2 = load <64 x i16>, <64 x i16>* %b
878 %res = xor <64 x i16> %op1, %op2
879 store <64 x i16> %res, <64 x i16>* %a
883 define void @xor_v128i16(<128 x i16>* %a, <128 x i16>* %b) #0 {
884 ; CHECK-LABEL: xor_v128i16:
885 ; CHECK: ptrue [[PG:p[0-9]+]].h, vl[[#min(div(VBYTES,2),128)]]
886 ; CHECK-DAG: ld1h { [[OP1:z[0-9]+]].h }, [[PG]]/z, [x0]
887 ; CHECK-DAG: ld1h { [[OP2:z[0-9]+]].h }, [[PG]]/z, [x1]
888 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
889 ; CHECK: st1h { [[RES]].h }, [[PG]], [x0]
891 %op1 = load <128 x i16>, <128 x i16>* %a
892 %op2 = load <128 x i16>, <128 x i16>* %b
893 %res = xor <128 x i16> %op1, %op2
894 store <128 x i16> %res, <128 x i16>* %a
898 ; Don't use SVE for 64-bit vectors.
899 define <2 x i32> @xor_v2i32(<2 x i32> %op1, <2 x i32> %op2) #0 {
900 ; CHECK-LABEL: xor_v2i32:
901 ; CHECK: eor v0.8b, v0.8b, v1.8b
903 %res = xor <2 x i32> %op1, %op2
907 ; Don't use SVE for 128-bit vectors.
908 define <4 x i32> @xor_v4i32(<4 x i32> %op1, <4 x i32> %op2) #0 {
909 ; CHECK-LABEL: xor_v4i32:
910 ; CHECK: eor v0.16b, v0.16b, v1.16b
912 %res = xor <4 x i32> %op1, %op2
916 define void @xor_v8i32(<8 x i32>* %a, <8 x i32>* %b) #0 {
917 ; CHECK-LABEL: xor_v8i32:
918 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),8)]]
919 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
920 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
921 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
922 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
924 %op1 = load <8 x i32>, <8 x i32>* %a
925 %op2 = load <8 x i32>, <8 x i32>* %b
926 %res = xor <8 x i32> %op1, %op2
927 store <8 x i32> %res, <8 x i32>* %a
931 define void @xor_v16i32(<16 x i32>* %a, <16 x i32>* %b) #0 {
932 ; CHECK-LABEL: xor_v16i32:
933 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),16)]]
934 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
935 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
936 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
937 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
939 %op1 = load <16 x i32>, <16 x i32>* %a
940 %op2 = load <16 x i32>, <16 x i32>* %b
941 %res = xor <16 x i32> %op1, %op2
942 store <16 x i32> %res, <16 x i32>* %a
946 define void @xor_v32i32(<32 x i32>* %a, <32 x i32>* %b) #0 {
947 ; CHECK-LABEL: xor_v32i32:
948 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),32)]]
949 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
950 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
951 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
952 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
954 %op1 = load <32 x i32>, <32 x i32>* %a
955 %op2 = load <32 x i32>, <32 x i32>* %b
956 %res = xor <32 x i32> %op1, %op2
957 store <32 x i32> %res, <32 x i32>* %a
961 define void @xor_v64i32(<64 x i32>* %a, <64 x i32>* %b) #0 {
962 ; CHECK-LABEL: xor_v64i32:
963 ; CHECK: ptrue [[PG:p[0-9]+]].s, vl[[#min(div(VBYTES,4),64)]]
964 ; CHECK-DAG: ld1w { [[OP1:z[0-9]+]].s }, [[PG]]/z, [x0]
965 ; CHECK-DAG: ld1w { [[OP2:z[0-9]+]].s }, [[PG]]/z, [x1]
966 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
967 ; CHECK: st1w { [[RES]].s }, [[PG]], [x0]
969 %op1 = load <64 x i32>, <64 x i32>* %a
970 %op2 = load <64 x i32>, <64 x i32>* %b
971 %res = xor <64 x i32> %op1, %op2
972 store <64 x i32> %res, <64 x i32>* %a
976 ; Don't use SVE for 64-bit vectors.
977 define <1 x i64> @xor_v1i64(<1 x i64> %op1, <1 x i64> %op2) #0 {
978 ; CHECK-LABEL: xor_v1i64:
979 ; CHECK: eor v0.8b, v0.8b, v1.8b
981 %res = xor <1 x i64> %op1, %op2
985 ; Don't use SVE for 128-bit vectors.
986 define <2 x i64> @xor_v2i64(<2 x i64> %op1, <2 x i64> %op2) #0 {
987 ; CHECK-LABEL: xor_v2i64:
988 ; CHECK: eor v0.16b, v0.16b, v1.16b
990 %res = xor <2 x i64> %op1, %op2
994 define void @xor_v4i64(<4 x i64>* %a, <4 x i64>* %b) #0 {
995 ; CHECK-LABEL: xor_v4i64:
996 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),4)]]
997 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
998 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
999 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
1000 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
1002 %op1 = load <4 x i64>, <4 x i64>* %a
1003 %op2 = load <4 x i64>, <4 x i64>* %b
1004 %res = xor <4 x i64> %op1, %op2
1005 store <4 x i64> %res, <4 x i64>* %a
1009 define void @xor_v8i64(<8 x i64>* %a, <8 x i64>* %b) #0 {
1010 ; CHECK-LABEL: xor_v8i64:
1011 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),8)]]
1012 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
1013 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
1014 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
1015 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
1017 %op1 = load <8 x i64>, <8 x i64>* %a
1018 %op2 = load <8 x i64>, <8 x i64>* %b
1019 %res = xor <8 x i64> %op1, %op2
1020 store <8 x i64> %res, <8 x i64>* %a
1024 define void @xor_v16i64(<16 x i64>* %a, <16 x i64>* %b) #0 {
1025 ; CHECK-LABEL: xor_v16i64:
1026 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),16)]]
1027 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
1028 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
1029 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
1030 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
1032 %op1 = load <16 x i64>, <16 x i64>* %a
1033 %op2 = load <16 x i64>, <16 x i64>* %b
1034 %res = xor <16 x i64> %op1, %op2
1035 store <16 x i64> %res, <16 x i64>* %a
1039 define void @xor_v32i64(<32 x i64>* %a, <32 x i64>* %b) #0 {
1040 ; CHECK-LABEL: xor_v32i64:
1041 ; CHECK: ptrue [[PG:p[0-9]+]].d, vl[[#min(div(VBYTES,8),32)]]
1042 ; CHECK-DAG: ld1d { [[OP1:z[0-9]+]].d }, [[PG]]/z, [x0]
1043 ; CHECK-DAG: ld1d { [[OP2:z[0-9]+]].d }, [[PG]]/z, [x1]
1044 ; CHECK: eor [[RES:z[0-9]+]].d, [[OP1]].d, [[OP2]].d
1045 ; CHECK: st1d { [[RES]].d }, [[PG]], [x0]
1047 %op1 = load <32 x i64>, <32 x i64>* %a
1048 %op2 = load <32 x i64>, <32 x i64>* %b
1049 %res = xor <32 x i64> %op1, %op2
1050 store <32 x i64> %res, <32 x i64>* %a
1054 attributes #0 = { "target-features"="+sve" }