1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming < %s | FileCheck %s
4 ; RUN: llc -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
6 target triple = "aarch64-unknown-linux-gnu"
8 define <4 x i8> @select_v4i8(<4 x i8> %op1, <4 x i8> %op2, i1 %mask) {
9 ; CHECK-LABEL: select_v4i8:
11 ; CHECK-NEXT: mov z2.h, w0
12 ; CHECK-NEXT: ptrue p0.h
13 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
14 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
15 ; CHECK-NEXT: and z2.h, z2.h, #0x1
16 ; CHECK-NEXT: cmpne p0.h, p0/z, z2.h, #0
17 ; CHECK-NEXT: sel z0.h, p0, z0.h, z1.h
18 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
21 ; NONEON-NOSVE-LABEL: select_v4i8:
22 ; NONEON-NOSVE: // %bb.0:
23 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
24 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
25 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
26 ; NONEON-NOSVE-NEXT: tst w0, #0x1
27 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #22]
28 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #14]
29 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
30 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #12]
31 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
32 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
33 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
34 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #10]
35 ; NONEON-NOSVE-NEXT: strh w8, [sp, #28]
36 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
37 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
38 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #8]
39 ; NONEON-NOSVE-NEXT: strh w8, [sp, #26]
40 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #16]
41 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
42 ; NONEON-NOSVE-NEXT: strh w8, [sp, #24]
43 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
44 ; NONEON-NOSVE-NEXT: add sp, sp, #32
45 ; NONEON-NOSVE-NEXT: ret
46 %sel = select i1 %mask, <4 x i8> %op1, <4 x i8> %op2
50 define <8 x i8> @select_v8i8(<8 x i8> %op1, <8 x i8> %op2, i1 %mask) {
51 ; CHECK-LABEL: select_v8i8:
53 ; CHECK-NEXT: mov z2.b, w0
54 ; CHECK-NEXT: ptrue p0.b
55 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
56 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
57 ; CHECK-NEXT: cmpne p0.b, p0/z, z2.b, #0
58 ; CHECK-NEXT: sel z0.b, p0, z0.b, z1.b
59 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
62 ; NONEON-NOSVE-LABEL: select_v8i8:
63 ; NONEON-NOSVE: // %bb.0:
64 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
65 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
66 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
67 ; NONEON-NOSVE-NEXT: tst w0, #0x1
68 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #23]
69 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #15]
70 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
71 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #14]
72 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
73 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #22]
74 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
75 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #13]
76 ; NONEON-NOSVE-NEXT: strb w8, [sp, #30]
77 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #21]
78 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
79 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #12]
80 ; NONEON-NOSVE-NEXT: strb w8, [sp, #29]
81 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #20]
82 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
83 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #11]
84 ; NONEON-NOSVE-NEXT: strb w8, [sp, #28]
85 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #19]
86 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
87 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #10]
88 ; NONEON-NOSVE-NEXT: strb w8, [sp, #27]
89 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #18]
90 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
91 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #9]
92 ; NONEON-NOSVE-NEXT: strb w8, [sp, #26]
93 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #17]
94 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
95 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #8]
96 ; NONEON-NOSVE-NEXT: strb w8, [sp, #25]
97 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #16]
98 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
99 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
100 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
101 ; NONEON-NOSVE-NEXT: add sp, sp, #32
102 ; NONEON-NOSVE-NEXT: ret
103 %sel = select i1 %mask, <8 x i8> %op1, <8 x i8> %op2
107 define <16 x i8> @select_v16i8(<16 x i8> %op1, <16 x i8> %op2, i1 %mask) {
108 ; CHECK-LABEL: select_v16i8:
110 ; CHECK-NEXT: mov z2.b, w0
111 ; CHECK-NEXT: ptrue p0.b
112 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
113 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
114 ; CHECK-NEXT: cmpne p0.b, p0/z, z2.b, #0
115 ; CHECK-NEXT: sel z0.b, p0, z0.b, z1.b
116 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
119 ; NONEON-NOSVE-LABEL: select_v16i8:
120 ; NONEON-NOSVE: // %bb.0:
121 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
122 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
123 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #31]
124 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #15]
125 ; NONEON-NOSVE-NEXT: tst w0, #0x1
126 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
127 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #14]
128 ; NONEON-NOSVE-NEXT: strb w8, [sp, #47]
129 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #30]
130 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
131 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #13]
132 ; NONEON-NOSVE-NEXT: strb w8, [sp, #46]
133 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #29]
134 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
135 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #12]
136 ; NONEON-NOSVE-NEXT: strb w8, [sp, #45]
137 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #28]
138 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
139 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #11]
140 ; NONEON-NOSVE-NEXT: strb w8, [sp, #44]
141 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #27]
142 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
143 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #10]
144 ; NONEON-NOSVE-NEXT: strb w8, [sp, #43]
145 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #26]
146 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
147 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #9]
148 ; NONEON-NOSVE-NEXT: strb w8, [sp, #42]
149 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #25]
150 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
151 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #8]
152 ; NONEON-NOSVE-NEXT: strb w8, [sp, #41]
153 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #24]
154 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
155 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #7]
156 ; NONEON-NOSVE-NEXT: strb w8, [sp, #40]
157 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #23]
158 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
159 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #6]
160 ; NONEON-NOSVE-NEXT: strb w8, [sp, #39]
161 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #22]
162 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
163 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #5]
164 ; NONEON-NOSVE-NEXT: strb w8, [sp, #38]
165 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #21]
166 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
167 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #4]
168 ; NONEON-NOSVE-NEXT: strb w8, [sp, #37]
169 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #20]
170 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
171 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #3]
172 ; NONEON-NOSVE-NEXT: strb w8, [sp, #36]
173 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #19]
174 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
175 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #2]
176 ; NONEON-NOSVE-NEXT: strb w8, [sp, #35]
177 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #18]
178 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
179 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #1]
180 ; NONEON-NOSVE-NEXT: strb w8, [sp, #34]
181 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #17]
182 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
183 ; NONEON-NOSVE-NEXT: ldrb w9, [sp]
184 ; NONEON-NOSVE-NEXT: strb w8, [sp, #33]
185 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #16]
186 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
187 ; NONEON-NOSVE-NEXT: strb w8, [sp, #32]
188 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
189 ; NONEON-NOSVE-NEXT: add sp, sp, #48
190 ; NONEON-NOSVE-NEXT: ret
191 %sel = select i1 %mask, <16 x i8> %op1, <16 x i8> %op2
195 define void @select_v32i8(ptr %a, ptr %b, i1 %mask) {
196 ; CHECK-LABEL: select_v32i8:
198 ; CHECK-NEXT: mov z0.b, w2
199 ; CHECK-NEXT: ptrue p0.b
200 ; CHECK-NEXT: cmpne p0.b, p0/z, z0.b, #0
201 ; CHECK-NEXT: ldr q0, [x0]
202 ; CHECK-NEXT: ldr q1, [x0, #16]
203 ; CHECK-NEXT: ldr q2, [x1]
204 ; CHECK-NEXT: ldr q3, [x1, #16]
205 ; CHECK-NEXT: sel z0.b, p0, z0.b, z2.b
206 ; CHECK-NEXT: sel z1.b, p0, z1.b, z3.b
207 ; CHECK-NEXT: stp q0, q1, [x0]
210 ; NONEON-NOSVE-LABEL: select_v32i8:
211 ; NONEON-NOSVE: // %bb.0:
212 ; NONEON-NOSVE-NEXT: sub sp, sp, #96
213 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 96
214 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
215 ; NONEON-NOSVE-NEXT: ldr q1, [x0, #16]
216 ; NONEON-NOSVE-NEXT: tst w2, #0x1
217 ; NONEON-NOSVE-NEXT: ldr q2, [x1]
218 ; NONEON-NOSVE-NEXT: ldr q3, [x1, #16]
219 ; NONEON-NOSVE-NEXT: str q0, [sp]
220 ; NONEON-NOSVE-NEXT: stp q1, q3, [sp, #16]
221 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #31]
222 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #47]
223 ; NONEON-NOSVE-NEXT: str q2, [sp, #48]
224 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
225 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #46]
226 ; NONEON-NOSVE-NEXT: strb w8, [sp, #79]
227 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #30]
228 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
229 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #45]
230 ; NONEON-NOSVE-NEXT: strb w8, [sp, #78]
231 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #29]
232 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
233 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #44]
234 ; NONEON-NOSVE-NEXT: strb w8, [sp, #77]
235 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #28]
236 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
237 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #43]
238 ; NONEON-NOSVE-NEXT: strb w8, [sp, #76]
239 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #27]
240 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
241 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #42]
242 ; NONEON-NOSVE-NEXT: strb w8, [sp, #75]
243 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #26]
244 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
245 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #41]
246 ; NONEON-NOSVE-NEXT: strb w8, [sp, #74]
247 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #25]
248 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
249 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #40]
250 ; NONEON-NOSVE-NEXT: strb w8, [sp, #73]
251 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #24]
252 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
253 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #39]
254 ; NONEON-NOSVE-NEXT: strb w8, [sp, #72]
255 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #23]
256 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
257 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #38]
258 ; NONEON-NOSVE-NEXT: strb w8, [sp, #71]
259 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #22]
260 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
261 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #37]
262 ; NONEON-NOSVE-NEXT: strb w8, [sp, #70]
263 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #21]
264 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
265 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #36]
266 ; NONEON-NOSVE-NEXT: strb w8, [sp, #69]
267 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #20]
268 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
269 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #35]
270 ; NONEON-NOSVE-NEXT: strb w8, [sp, #68]
271 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #19]
272 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
273 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #34]
274 ; NONEON-NOSVE-NEXT: strb w8, [sp, #67]
275 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #18]
276 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
277 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #33]
278 ; NONEON-NOSVE-NEXT: strb w8, [sp, #66]
279 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #17]
280 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
281 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #32]
282 ; NONEON-NOSVE-NEXT: strb w8, [sp, #65]
283 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #16]
284 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
285 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #63]
286 ; NONEON-NOSVE-NEXT: strb w8, [sp, #64]
287 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
288 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
289 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #62]
290 ; NONEON-NOSVE-NEXT: strb w8, [sp, #95]
291 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
292 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
293 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #61]
294 ; NONEON-NOSVE-NEXT: strb w8, [sp, #94]
295 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
296 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
297 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #60]
298 ; NONEON-NOSVE-NEXT: strb w8, [sp, #93]
299 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
300 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
301 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #59]
302 ; NONEON-NOSVE-NEXT: strb w8, [sp, #92]
303 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
304 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
305 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #58]
306 ; NONEON-NOSVE-NEXT: strb w8, [sp, #91]
307 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
308 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
309 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #57]
310 ; NONEON-NOSVE-NEXT: strb w8, [sp, #90]
311 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
312 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
313 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #56]
314 ; NONEON-NOSVE-NEXT: strb w8, [sp, #89]
315 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
316 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
317 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #55]
318 ; NONEON-NOSVE-NEXT: strb w8, [sp, #88]
319 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #7]
320 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
321 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #54]
322 ; NONEON-NOSVE-NEXT: strb w8, [sp, #87]
323 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
324 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
325 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #53]
326 ; NONEON-NOSVE-NEXT: strb w8, [sp, #86]
327 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #5]
328 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
329 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #52]
330 ; NONEON-NOSVE-NEXT: strb w8, [sp, #85]
331 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
332 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
333 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #51]
334 ; NONEON-NOSVE-NEXT: strb w8, [sp, #84]
335 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #3]
336 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
337 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #50]
338 ; NONEON-NOSVE-NEXT: strb w8, [sp, #83]
339 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
340 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
341 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #49]
342 ; NONEON-NOSVE-NEXT: strb w8, [sp, #82]
343 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #1]
344 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
345 ; NONEON-NOSVE-NEXT: ldrb w9, [sp, #48]
346 ; NONEON-NOSVE-NEXT: strb w8, [sp, #81]
347 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
348 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
349 ; NONEON-NOSVE-NEXT: strb w8, [sp, #80]
350 ; NONEON-NOSVE-NEXT: ldp q1, q0, [sp, #64]
351 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
352 ; NONEON-NOSVE-NEXT: add sp, sp, #96
353 ; NONEON-NOSVE-NEXT: ret
354 %op1 = load volatile <32 x i8>, ptr %a
355 %op2 = load volatile <32 x i8>, ptr %b
356 %sel = select i1 %mask, <32 x i8> %op1, <32 x i8> %op2
357 store <32 x i8> %sel, ptr %a
361 define <2 x i16> @select_v2i16(<2 x i16> %op1, <2 x i16> %op2, i1 %mask) {
362 ; CHECK-LABEL: select_v2i16:
364 ; CHECK-NEXT: and w8, w0, #0x1
365 ; CHECK-NEXT: ptrue p0.s
366 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
367 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
368 ; CHECK-NEXT: mov z2.s, w8
369 ; CHECK-NEXT: cmpne p0.s, p0/z, z2.s, #0
370 ; CHECK-NEXT: sel z0.s, p0, z0.s, z1.s
371 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
374 ; NONEON-NOSVE-LABEL: select_v2i16:
375 ; NONEON-NOSVE: // %bb.0:
376 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
377 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
378 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
379 ; NONEON-NOSVE-NEXT: tst w0, #0x1
380 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #8]
381 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
382 ; NONEON-NOSVE-NEXT: csel w11, w10, w8, ne
383 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
384 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
385 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #24]
386 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
387 ; NONEON-NOSVE-NEXT: add sp, sp, #32
388 ; NONEON-NOSVE-NEXT: ret
389 %sel = select i1 %mask, <2 x i16> %op1, <2 x i16> %op2
393 define <4 x i16> @select_v4i16(<4 x i16> %op1, <4 x i16> %op2, i1 %mask) {
394 ; CHECK-LABEL: select_v4i16:
396 ; CHECK-NEXT: mov z2.h, w0
397 ; CHECK-NEXT: ptrue p0.h
398 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
399 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
400 ; CHECK-NEXT: and z2.h, z2.h, #0x1
401 ; CHECK-NEXT: cmpne p0.h, p0/z, z2.h, #0
402 ; CHECK-NEXT: sel z0.h, p0, z0.h, z1.h
403 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
406 ; NONEON-NOSVE-LABEL: select_v4i16:
407 ; NONEON-NOSVE: // %bb.0:
408 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
409 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
410 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
411 ; NONEON-NOSVE-NEXT: tst w0, #0x1
412 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #22]
413 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #14]
414 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
415 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #12]
416 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
417 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
418 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
419 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #10]
420 ; NONEON-NOSVE-NEXT: strh w8, [sp, #28]
421 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
422 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
423 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #8]
424 ; NONEON-NOSVE-NEXT: strh w8, [sp, #26]
425 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #16]
426 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
427 ; NONEON-NOSVE-NEXT: strh w8, [sp, #24]
428 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
429 ; NONEON-NOSVE-NEXT: add sp, sp, #32
430 ; NONEON-NOSVE-NEXT: ret
431 %sel = select i1 %mask, <4 x i16> %op1, <4 x i16> %op2
435 define <8 x i16> @select_v8i16(<8 x i16> %op1, <8 x i16> %op2, i1 %mask) {
436 ; CHECK-LABEL: select_v8i16:
438 ; CHECK-NEXT: mov z2.h, w0
439 ; CHECK-NEXT: ptrue p0.h
440 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
441 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
442 ; CHECK-NEXT: and z2.h, z2.h, #0x1
443 ; CHECK-NEXT: cmpne p0.h, p0/z, z2.h, #0
444 ; CHECK-NEXT: sel z0.h, p0, z0.h, z1.h
445 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
448 ; NONEON-NOSVE-LABEL: select_v8i16:
449 ; NONEON-NOSVE: // %bb.0:
450 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
451 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
452 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #30]
453 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #14]
454 ; NONEON-NOSVE-NEXT: tst w0, #0x1
455 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
456 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #12]
457 ; NONEON-NOSVE-NEXT: strh w8, [sp, #46]
458 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #28]
459 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
460 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #10]
461 ; NONEON-NOSVE-NEXT: strh w8, [sp, #44]
462 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #26]
463 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
464 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #8]
465 ; NONEON-NOSVE-NEXT: strh w8, [sp, #42]
466 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #24]
467 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
468 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #6]
469 ; NONEON-NOSVE-NEXT: strh w8, [sp, #40]
470 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #22]
471 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
472 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #4]
473 ; NONEON-NOSVE-NEXT: strh w8, [sp, #38]
474 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
475 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
476 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #2]
477 ; NONEON-NOSVE-NEXT: strh w8, [sp, #36]
478 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
479 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
480 ; NONEON-NOSVE-NEXT: ldrh w9, [sp]
481 ; NONEON-NOSVE-NEXT: strh w8, [sp, #34]
482 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #16]
483 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
484 ; NONEON-NOSVE-NEXT: strh w8, [sp, #32]
485 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
486 ; NONEON-NOSVE-NEXT: add sp, sp, #48
487 ; NONEON-NOSVE-NEXT: ret
488 %sel = select i1 %mask, <8 x i16> %op1, <8 x i16> %op2
492 define void @select_v16i16(ptr %a, ptr %b, i1 %mask) {
493 ; CHECK-LABEL: select_v16i16:
495 ; CHECK-NEXT: mov z0.h, w2
496 ; CHECK-NEXT: ptrue p0.h
497 ; CHECK-NEXT: and z0.h, z0.h, #0x1
498 ; CHECK-NEXT: cmpne p0.h, p0/z, z0.h, #0
499 ; CHECK-NEXT: ldr q0, [x0]
500 ; CHECK-NEXT: ldr q1, [x0, #16]
501 ; CHECK-NEXT: ldr q2, [x1]
502 ; CHECK-NEXT: ldr q3, [x1, #16]
503 ; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h
504 ; CHECK-NEXT: sel z1.h, p0, z1.h, z3.h
505 ; CHECK-NEXT: stp q0, q1, [x0]
508 ; NONEON-NOSVE-LABEL: select_v16i16:
509 ; NONEON-NOSVE: // %bb.0:
510 ; NONEON-NOSVE-NEXT: sub sp, sp, #96
511 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 96
512 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
513 ; NONEON-NOSVE-NEXT: ldr q1, [x0, #16]
514 ; NONEON-NOSVE-NEXT: tst w2, #0x1
515 ; NONEON-NOSVE-NEXT: ldr q2, [x1]
516 ; NONEON-NOSVE-NEXT: ldr q3, [x1, #16]
517 ; NONEON-NOSVE-NEXT: str q0, [sp]
518 ; NONEON-NOSVE-NEXT: stp q1, q3, [sp, #16]
519 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #30]
520 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #46]
521 ; NONEON-NOSVE-NEXT: str q2, [sp, #48]
522 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
523 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #44]
524 ; NONEON-NOSVE-NEXT: strh w8, [sp, #78]
525 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #28]
526 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
527 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #42]
528 ; NONEON-NOSVE-NEXT: strh w8, [sp, #76]
529 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #26]
530 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
531 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #40]
532 ; NONEON-NOSVE-NEXT: strh w8, [sp, #74]
533 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #24]
534 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
535 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #38]
536 ; NONEON-NOSVE-NEXT: strh w8, [sp, #72]
537 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #22]
538 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
539 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #36]
540 ; NONEON-NOSVE-NEXT: strh w8, [sp, #70]
541 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
542 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
543 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #34]
544 ; NONEON-NOSVE-NEXT: strh w8, [sp, #68]
545 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #18]
546 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
547 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #32]
548 ; NONEON-NOSVE-NEXT: strh w8, [sp, #66]
549 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #16]
550 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
551 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #62]
552 ; NONEON-NOSVE-NEXT: strh w8, [sp, #64]
553 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #14]
554 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
555 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #60]
556 ; NONEON-NOSVE-NEXT: strh w8, [sp, #94]
557 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #12]
558 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
559 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #58]
560 ; NONEON-NOSVE-NEXT: strh w8, [sp, #92]
561 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #10]
562 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
563 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #56]
564 ; NONEON-NOSVE-NEXT: strh w8, [sp, #90]
565 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #8]
566 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
567 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #54]
568 ; NONEON-NOSVE-NEXT: strh w8, [sp, #88]
569 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
570 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
571 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #52]
572 ; NONEON-NOSVE-NEXT: strh w8, [sp, #86]
573 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #4]
574 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
575 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #50]
576 ; NONEON-NOSVE-NEXT: strh w8, [sp, #84]
577 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #2]
578 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
579 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #48]
580 ; NONEON-NOSVE-NEXT: strh w8, [sp, #82]
581 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
582 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
583 ; NONEON-NOSVE-NEXT: strh w8, [sp, #80]
584 ; NONEON-NOSVE-NEXT: ldp q1, q0, [sp, #64]
585 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
586 ; NONEON-NOSVE-NEXT: add sp, sp, #96
587 ; NONEON-NOSVE-NEXT: ret
588 %op1 = load volatile <16 x i16>, ptr %a
589 %op2 = load volatile <16 x i16>, ptr %b
590 %sel = select i1 %mask, <16 x i16> %op1, <16 x i16> %op2
591 store <16 x i16> %sel, ptr %a
595 define <2 x i32> @select_v2i32(<2 x i32> %op1, <2 x i32> %op2, i1 %mask) {
596 ; CHECK-LABEL: select_v2i32:
598 ; CHECK-NEXT: and w8, w0, #0x1
599 ; CHECK-NEXT: ptrue p0.s
600 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
601 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
602 ; CHECK-NEXT: mov z2.s, w8
603 ; CHECK-NEXT: cmpne p0.s, p0/z, z2.s, #0
604 ; CHECK-NEXT: sel z0.s, p0, z0.s, z1.s
605 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
608 ; NONEON-NOSVE-LABEL: select_v2i32:
609 ; NONEON-NOSVE: // %bb.0:
610 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
611 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
612 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
613 ; NONEON-NOSVE-NEXT: tst w0, #0x1
614 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #8]
615 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
616 ; NONEON-NOSVE-NEXT: csel w11, w10, w8, ne
617 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
618 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
619 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #24]
620 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
621 ; NONEON-NOSVE-NEXT: add sp, sp, #32
622 ; NONEON-NOSVE-NEXT: ret
623 %sel = select i1 %mask, <2 x i32> %op1, <2 x i32> %op2
627 define <4 x i32> @select_v4i32(<4 x i32> %op1, <4 x i32> %op2, i1 %mask) {
628 ; CHECK-LABEL: select_v4i32:
630 ; CHECK-NEXT: and w8, w0, #0x1
631 ; CHECK-NEXT: ptrue p0.s
632 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
633 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
634 ; CHECK-NEXT: mov z2.s, w8
635 ; CHECK-NEXT: cmpne p0.s, p0/z, z2.s, #0
636 ; CHECK-NEXT: sel z0.s, p0, z0.s, z1.s
637 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
640 ; NONEON-NOSVE-LABEL: select_v4i32:
641 ; NONEON-NOSVE: // %bb.0:
642 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
643 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
644 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #8]
645 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #28]
646 ; NONEON-NOSVE-NEXT: tst w0, #0x1
647 ; NONEON-NOSVE-NEXT: csel w11, w10, w8, ne
648 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
649 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
650 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp]
651 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #40]
652 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
653 ; NONEON-NOSVE-NEXT: csel w11, w10, w8, ne
654 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
655 ; NONEON-NOSVE-NEXT: csel w8, w9, w8, ne
656 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #32]
657 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
658 ; NONEON-NOSVE-NEXT: add sp, sp, #48
659 ; NONEON-NOSVE-NEXT: ret
660 %sel = select i1 %mask, <4 x i32> %op1, <4 x i32> %op2
664 define void @select_v8i32(ptr %a, ptr %b, i1 %mask) {
665 ; CHECK-LABEL: select_v8i32:
667 ; CHECK-NEXT: and w8, w2, #0x1
668 ; CHECK-NEXT: ptrue p0.s
669 ; CHECK-NEXT: mov z0.s, w8
670 ; CHECK-NEXT: cmpne p0.s, p0/z, z0.s, #0
671 ; CHECK-NEXT: ldr q0, [x0]
672 ; CHECK-NEXT: ldr q1, [x0, #16]
673 ; CHECK-NEXT: ldr q2, [x1]
674 ; CHECK-NEXT: ldr q3, [x1, #16]
675 ; CHECK-NEXT: sel z0.s, p0, z0.s, z2.s
676 ; CHECK-NEXT: sel z1.s, p0, z1.s, z3.s
677 ; CHECK-NEXT: stp q0, q1, [x0]
680 ; NONEON-NOSVE-LABEL: select_v8i32:
681 ; NONEON-NOSVE: // %bb.0:
682 ; NONEON-NOSVE-NEXT: sub sp, sp, #96
683 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 96
684 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
685 ; NONEON-NOSVE-NEXT: ldr q1, [x0, #16]
686 ; NONEON-NOSVE-NEXT: tst w2, #0x1
687 ; NONEON-NOSVE-NEXT: ldr q2, [x1]
688 ; NONEON-NOSVE-NEXT: ldr q3, [x1, #16]
689 ; NONEON-NOSVE-NEXT: str q0, [sp]
690 ; NONEON-NOSVE-NEXT: stp q1, q3, [sp, #16]
691 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #40]
692 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #28]
693 ; NONEON-NOSVE-NEXT: str q2, [sp, #48]
694 ; NONEON-NOSVE-NEXT: csel w11, w8, w10, ne
695 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
696 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
697 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #32]
698 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #72]
699 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #20]
700 ; NONEON-NOSVE-NEXT: csel w11, w8, w10, ne
701 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
702 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
703 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #56]
704 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #64]
705 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
706 ; NONEON-NOSVE-NEXT: csel w11, w8, w10, ne
707 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
708 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
709 ; NONEON-NOSVE-NEXT: ldp w9, w10, [sp, #48]
710 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #88]
711 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #4]
712 ; NONEON-NOSVE-NEXT: csel w11, w8, w10, ne
713 ; NONEON-NOSVE-NEXT: ldr w8, [sp]
714 ; NONEON-NOSVE-NEXT: csel w8, w8, w9, ne
715 ; NONEON-NOSVE-NEXT: stp w8, w11, [sp, #80]
716 ; NONEON-NOSVE-NEXT: ldp q1, q0, [sp, #64]
717 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
718 ; NONEON-NOSVE-NEXT: add sp, sp, #96
719 ; NONEON-NOSVE-NEXT: ret
720 %op1 = load volatile <8 x i32>, ptr %a
721 %op2 = load volatile <8 x i32>, ptr %b
722 %sel = select i1 %mask, <8 x i32> %op1, <8 x i32> %op2
723 store <8 x i32> %sel, ptr %a
727 define <1 x i64> @select_v1i64(<1 x i64> %op1, <1 x i64> %op2, i1 %mask) {
728 ; CHECK-LABEL: select_v1i64:
730 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
731 ; CHECK-NEXT: and x8, x0, #0x1
732 ; CHECK-NEXT: ptrue p0.d
733 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
734 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
735 ; CHECK-NEXT: mov z2.d, x8
736 ; CHECK-NEXT: cmpne p0.d, p0/z, z2.d, #0
737 ; CHECK-NEXT: sel z0.d, p0, z0.d, z1.d
738 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
741 ; NONEON-NOSVE-LABEL: select_v1i64:
742 ; NONEON-NOSVE: // %bb.0:
743 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
744 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
745 ; NONEON-NOSVE-NEXT: fmov x8, d1
746 ; NONEON-NOSVE-NEXT: fmov x9, d0
747 ; NONEON-NOSVE-NEXT: tst w0, #0x1
748 ; NONEON-NOSVE-NEXT: csel x8, x9, x8, ne
749 ; NONEON-NOSVE-NEXT: str x8, [sp, #8]
750 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
751 ; NONEON-NOSVE-NEXT: add sp, sp, #16
752 ; NONEON-NOSVE-NEXT: ret
753 %sel = select i1 %mask, <1 x i64> %op1, <1 x i64> %op2
757 define <2 x i64> @select_v2i64(<2 x i64> %op1, <2 x i64> %op2, i1 %mask) {
758 ; CHECK-LABEL: select_v2i64:
760 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
761 ; CHECK-NEXT: and x8, x0, #0x1
762 ; CHECK-NEXT: ptrue p0.d
763 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
764 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
765 ; CHECK-NEXT: mov z2.d, x8
766 ; CHECK-NEXT: cmpne p0.d, p0/z, z2.d, #0
767 ; CHECK-NEXT: sel z0.d, p0, z0.d, z1.d
768 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
771 ; NONEON-NOSVE-LABEL: select_v2i64:
772 ; NONEON-NOSVE: // %bb.0:
773 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
774 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
775 ; NONEON-NOSVE-NEXT: ldp x9, x10, [sp]
776 ; NONEON-NOSVE-NEXT: tst w0, #0x1
777 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #24]
778 ; NONEON-NOSVE-NEXT: csel x11, x10, x8, ne
779 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
780 ; NONEON-NOSVE-NEXT: csel x8, x9, x8, ne
781 ; NONEON-NOSVE-NEXT: stp x8, x11, [sp, #32]
782 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
783 ; NONEON-NOSVE-NEXT: add sp, sp, #48
784 ; NONEON-NOSVE-NEXT: ret
785 %sel = select i1 %mask, <2 x i64> %op1, <2 x i64> %op2
789 define void @select_v4i64(ptr %a, ptr %b, i1 %mask) {
790 ; CHECK-LABEL: select_v4i64:
792 ; CHECK-NEXT: // kill: def $w2 killed $w2 def $x2
793 ; CHECK-NEXT: and x8, x2, #0x1
794 ; CHECK-NEXT: ptrue p0.d
795 ; CHECK-NEXT: mov z0.d, x8
796 ; CHECK-NEXT: cmpne p0.d, p0/z, z0.d, #0
797 ; CHECK-NEXT: ldr q0, [x0]
798 ; CHECK-NEXT: ldr q1, [x0, #16]
799 ; CHECK-NEXT: ldr q2, [x1]
800 ; CHECK-NEXT: ldr q3, [x1, #16]
801 ; CHECK-NEXT: sel z0.d, p0, z0.d, z2.d
802 ; CHECK-NEXT: sel z1.d, p0, z1.d, z3.d
803 ; CHECK-NEXT: stp q0, q1, [x0]
806 ; NONEON-NOSVE-LABEL: select_v4i64:
807 ; NONEON-NOSVE: // %bb.0:
808 ; NONEON-NOSVE-NEXT: sub sp, sp, #96
809 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 96
810 ; NONEON-NOSVE-NEXT: ldr q0, [x0]
811 ; NONEON-NOSVE-NEXT: ldr q1, [x0, #16]
812 ; NONEON-NOSVE-NEXT: tst w2, #0x1
813 ; NONEON-NOSVE-NEXT: ldr q2, [x1]
814 ; NONEON-NOSVE-NEXT: ldr q3, [x1, #16]
815 ; NONEON-NOSVE-NEXT: str q0, [sp]
816 ; NONEON-NOSVE-NEXT: stp q1, q3, [sp, #16]
817 ; NONEON-NOSVE-NEXT: ldp x9, x10, [sp, #32]
818 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #24]
819 ; NONEON-NOSVE-NEXT: str q2, [sp, #48]
820 ; NONEON-NOSVE-NEXT: csel x11, x8, x10, ne
821 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
822 ; NONEON-NOSVE-NEXT: csel x8, x8, x9, ne
823 ; NONEON-NOSVE-NEXT: ldp x9, x10, [sp, #48]
824 ; NONEON-NOSVE-NEXT: stp x8, x11, [sp, #64]
825 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #8]
826 ; NONEON-NOSVE-NEXT: csel x11, x8, x10, ne
827 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
828 ; NONEON-NOSVE-NEXT: csel x8, x8, x9, ne
829 ; NONEON-NOSVE-NEXT: stp x8, x11, [sp, #80]
830 ; NONEON-NOSVE-NEXT: ldp q1, q0, [sp, #64]
831 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
832 ; NONEON-NOSVE-NEXT: add sp, sp, #96
833 ; NONEON-NOSVE-NEXT: ret
834 %op1 = load volatile <4 x i64>, ptr %a
835 %op2 = load volatile <4 x i64>, ptr %b
836 %sel = select i1 %mask, <4 x i64> %op1, <4 x i64> %op2
837 store <4 x i64> %sel, ptr %a