1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mattr=+simd128 | FileCheck %s
4 ; Test SIMD loads and stores
6 target triple = "wasm32-unknown-unknown"
8 ; ==============================================================================
10 ; ==============================================================================
11 define <16 x i8> @load_v16i8(<16 x i8>* %p) {
12 ; CHECK-LABEL: load_v16i8:
13 ; CHECK: .functype load_v16i8 (i32) -> (v128)
14 ; CHECK-NEXT: # %bb.0:
15 ; CHECK-NEXT: local.get 0
16 ; CHECK-NEXT: v128.load 0
17 ; CHECK-NEXT: # fallthrough-return
18 %v = load <16 x i8>, <16 x i8>* %p
22 define <16 x i8> @load_splat_v16i8(i8* %p) {
23 ; CHECK-LABEL: load_splat_v16i8:
24 ; CHECK: .functype load_splat_v16i8 (i32) -> (v128)
25 ; CHECK-NEXT: # %bb.0:
26 ; CHECK-NEXT: local.get 0
27 ; CHECK-NEXT: v128.load8_splat 0
28 ; CHECK-NEXT: # fallthrough-return
30 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
31 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
35 define <16 x i8> @load_v16i8_with_folded_offset(<16 x i8>* %p) {
36 ; CHECK-LABEL: load_v16i8_with_folded_offset:
37 ; CHECK: .functype load_v16i8_with_folded_offset (i32) -> (v128)
38 ; CHECK-NEXT: # %bb.0:
39 ; CHECK-NEXT: local.get 0
40 ; CHECK-NEXT: v128.load 16
41 ; CHECK-NEXT: # fallthrough-return
42 %q = ptrtoint <16 x i8>* %p to i32
43 %r = add nuw i32 %q, 16
44 %s = inttoptr i32 %r to <16 x i8>*
45 %v = load <16 x i8>, <16 x i8>* %s
49 define <16 x i8> @load_splat_v16i8_with_folded_offset(i8* %p) {
50 ; CHECK-LABEL: load_splat_v16i8_with_folded_offset:
51 ; CHECK: .functype load_splat_v16i8_with_folded_offset (i32) -> (v128)
52 ; CHECK-NEXT: # %bb.0:
53 ; CHECK-NEXT: local.get 0
54 ; CHECK-NEXT: v128.load8_splat 16
55 ; CHECK-NEXT: # fallthrough-return
56 %q = ptrtoint i8* %p to i32
57 %r = add nuw i32 %q, 16
58 %s = inttoptr i32 %r to i8*
60 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
61 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
65 define <16 x i8> @load_v16i8_with_folded_gep_offset(<16 x i8>* %p) {
66 ; CHECK-LABEL: load_v16i8_with_folded_gep_offset:
67 ; CHECK: .functype load_v16i8_with_folded_gep_offset (i32) -> (v128)
68 ; CHECK-NEXT: # %bb.0:
69 ; CHECK-NEXT: local.get 0
70 ; CHECK-NEXT: v128.load 16
71 ; CHECK-NEXT: # fallthrough-return
72 %s = getelementptr inbounds <16 x i8>, <16 x i8>* %p, i32 1
73 %v = load <16 x i8>, <16 x i8>* %s
77 define <16 x i8> @load_splat_v16i8_with_folded_gep_offset(i8* %p) {
78 ; CHECK-LABEL: load_splat_v16i8_with_folded_gep_offset:
79 ; CHECK: .functype load_splat_v16i8_with_folded_gep_offset (i32) -> (v128)
80 ; CHECK-NEXT: # %bb.0:
81 ; CHECK-NEXT: local.get 0
82 ; CHECK-NEXT: v128.load8_splat 1
83 ; CHECK-NEXT: # fallthrough-return
84 %s = getelementptr inbounds i8, i8* %p, i32 1
86 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
87 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
91 define <16 x i8> @load_v16i8_with_unfolded_gep_negative_offset(<16 x i8>* %p) {
92 ; CHECK-LABEL: load_v16i8_with_unfolded_gep_negative_offset:
93 ; CHECK: .functype load_v16i8_with_unfolded_gep_negative_offset (i32) -> (v128)
94 ; CHECK-NEXT: # %bb.0:
95 ; CHECK-NEXT: local.get 0
96 ; CHECK-NEXT: i32.const -16
98 ; CHECK-NEXT: v128.load 0
99 ; CHECK-NEXT: # fallthrough-return
100 %s = getelementptr inbounds <16 x i8>, <16 x i8>* %p, i32 -1
101 %v = load <16 x i8>, <16 x i8>* %s
105 define <16 x i8> @load_splat_v16i8_with_unfolded_gep_negative_offset(i8* %p) {
106 ; CHECK-LABEL: load_splat_v16i8_with_unfolded_gep_negative_offset:
107 ; CHECK: .functype load_splat_v16i8_with_unfolded_gep_negative_offset (i32) -> (v128)
108 ; CHECK-NEXT: # %bb.0:
109 ; CHECK-NEXT: local.get 0
110 ; CHECK-NEXT: i32.const -1
111 ; CHECK-NEXT: i32.add
112 ; CHECK-NEXT: v128.load8_splat 0
113 ; CHECK-NEXT: # fallthrough-return
114 %s = getelementptr inbounds i8, i8* %p, i32 -1
116 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
117 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
121 define <16 x i8> @load_v16i8_with_unfolded_offset(<16 x i8>* %p) {
122 ; CHECK-LABEL: load_v16i8_with_unfolded_offset:
123 ; CHECK: .functype load_v16i8_with_unfolded_offset (i32) -> (v128)
124 ; CHECK-NEXT: # %bb.0:
125 ; CHECK-NEXT: local.get 0
126 ; CHECK-NEXT: i32.const 16
127 ; CHECK-NEXT: i32.add
128 ; CHECK-NEXT: v128.load 0
129 ; CHECK-NEXT: # fallthrough-return
130 %q = ptrtoint <16 x i8>* %p to i32
131 %r = add nsw i32 %q, 16
132 %s = inttoptr i32 %r to <16 x i8>*
133 %v = load <16 x i8>, <16 x i8>* %s
137 define <16 x i8> @load_splat_v16i8_with_unfolded_offset(i8* %p) {
138 ; CHECK-LABEL: load_splat_v16i8_with_unfolded_offset:
139 ; CHECK: .functype load_splat_v16i8_with_unfolded_offset (i32) -> (v128)
140 ; CHECK-NEXT: # %bb.0:
141 ; CHECK-NEXT: local.get 0
142 ; CHECK-NEXT: i32.const 16
143 ; CHECK-NEXT: i32.add
144 ; CHECK-NEXT: v128.load8_splat 0
145 ; CHECK-NEXT: # fallthrough-return
146 %q = ptrtoint i8* %p to i32
147 %r = add nsw i32 %q, 16
148 %s = inttoptr i32 %r to i8*
150 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
151 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
155 define <16 x i8> @load_v16i8_with_unfolded_gep_offset(<16 x i8>* %p) {
156 ; CHECK-LABEL: load_v16i8_with_unfolded_gep_offset:
157 ; CHECK: .functype load_v16i8_with_unfolded_gep_offset (i32) -> (v128)
158 ; CHECK-NEXT: # %bb.0:
159 ; CHECK-NEXT: local.get 0
160 ; CHECK-NEXT: i32.const 16
161 ; CHECK-NEXT: i32.add
162 ; CHECK-NEXT: v128.load 0
163 ; CHECK-NEXT: # fallthrough-return
164 %s = getelementptr <16 x i8>, <16 x i8>* %p, i32 1
165 %v = load <16 x i8>, <16 x i8>* %s
169 define <16 x i8> @load_splat_v16i8_with_unfolded_gep_offset(i8* %p) {
170 ; CHECK-LABEL: load_splat_v16i8_with_unfolded_gep_offset:
171 ; CHECK: .functype load_splat_v16i8_with_unfolded_gep_offset (i32) -> (v128)
172 ; CHECK-NEXT: # %bb.0:
173 ; CHECK-NEXT: local.get 0
174 ; CHECK-NEXT: i32.const 1
175 ; CHECK-NEXT: i32.add
176 ; CHECK-NEXT: v128.load8_splat 0
177 ; CHECK-NEXT: # fallthrough-return
178 %s = getelementptr i8, i8* %p, i32 1
180 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
181 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
185 define <16 x i8> @load_v16i8_from_numeric_address() {
186 ; CHECK-LABEL: load_v16i8_from_numeric_address:
187 ; CHECK: .functype load_v16i8_from_numeric_address () -> (v128)
188 ; CHECK-NEXT: # %bb.0:
189 ; CHECK-NEXT: i32.const 0
190 ; CHECK-NEXT: v128.load 32
191 ; CHECK-NEXT: # fallthrough-return
192 %s = inttoptr i32 32 to <16 x i8>*
193 %v = load <16 x i8>, <16 x i8>* %s
197 define <16 x i8> @load_splat_v16i8_from_numeric_address() {
198 ; CHECK-LABEL: load_splat_v16i8_from_numeric_address:
199 ; CHECK: .functype load_splat_v16i8_from_numeric_address () -> (v128)
200 ; CHECK-NEXT: # %bb.0:
201 ; CHECK-NEXT: i32.const 0
202 ; CHECK-NEXT: v128.load8_splat 32
203 ; CHECK-NEXT: # fallthrough-return
204 %s = inttoptr i32 32 to i8*
206 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
207 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
211 @gv_v16i8 = global <16 x i8> <i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42>
212 define <16 x i8> @load_v16i8_from_global_address() {
213 ; CHECK-LABEL: load_v16i8_from_global_address:
214 ; CHECK: .functype load_v16i8_from_global_address () -> (v128)
215 ; CHECK-NEXT: # %bb.0:
216 ; CHECK-NEXT: i32.const 0
217 ; CHECK-NEXT: v128.load gv_v16i8
218 ; CHECK-NEXT: # fallthrough-return
219 %v = load <16 x i8>, <16 x i8>* @gv_v16i8
223 @gv_i8 = global i8 42
224 define <16 x i8> @load_splat_v16i8_from_global_address() {
225 ; CHECK-LABEL: load_splat_v16i8_from_global_address:
226 ; CHECK: .functype load_splat_v16i8_from_global_address () -> (v128)
227 ; CHECK-NEXT: # %bb.0:
228 ; CHECK-NEXT: i32.const 0
229 ; CHECK-NEXT: v128.load8_splat gv_i8
230 ; CHECK-NEXT: # fallthrough-return
231 %e = load i8, i8* @gv_i8
232 %v1 = insertelement <16 x i8> undef, i8 %e, i32 0
233 %v2 = shufflevector <16 x i8> %v1, <16 x i8> undef, <16 x i32> zeroinitializer
237 define void @store_v16i8(<16 x i8> %v, <16 x i8>* %p) {
238 ; CHECK-LABEL: store_v16i8:
239 ; CHECK: .functype store_v16i8 (v128, i32) -> ()
240 ; CHECK-NEXT: # %bb.0:
241 ; CHECK-NEXT: local.get 1
242 ; CHECK-NEXT: local.get 0
243 ; CHECK-NEXT: v128.store 0
244 ; CHECK-NEXT: # fallthrough-return
245 store <16 x i8> %v , <16 x i8>* %p
249 define void @store_v16i8_with_folded_offset(<16 x i8> %v, <16 x i8>* %p) {
250 ; CHECK-LABEL: store_v16i8_with_folded_offset:
251 ; CHECK: .functype store_v16i8_with_folded_offset (v128, i32) -> ()
252 ; CHECK-NEXT: # %bb.0:
253 ; CHECK-NEXT: local.get 1
254 ; CHECK-NEXT: local.get 0
255 ; CHECK-NEXT: v128.store 16
256 ; CHECK-NEXT: # fallthrough-return
257 %q = ptrtoint <16 x i8>* %p to i32
258 %r = add nuw i32 %q, 16
259 %s = inttoptr i32 %r to <16 x i8>*
260 store <16 x i8> %v , <16 x i8>* %s
264 define void @store_v16i8_with_folded_gep_offset(<16 x i8> %v, <16 x i8>* %p) {
265 ; CHECK-LABEL: store_v16i8_with_folded_gep_offset:
266 ; CHECK: .functype store_v16i8_with_folded_gep_offset (v128, i32) -> ()
267 ; CHECK-NEXT: # %bb.0:
268 ; CHECK-NEXT: local.get 1
269 ; CHECK-NEXT: local.get 0
270 ; CHECK-NEXT: v128.store 16
271 ; CHECK-NEXT: # fallthrough-return
272 %s = getelementptr inbounds <16 x i8>, <16 x i8>* %p, i32 1
273 store <16 x i8> %v , <16 x i8>* %s
277 define void @store_v16i8_with_unfolded_gep_negative_offset(<16 x i8> %v, <16 x i8>* %p) {
278 ; CHECK-LABEL: store_v16i8_with_unfolded_gep_negative_offset:
279 ; CHECK: .functype store_v16i8_with_unfolded_gep_negative_offset (v128, i32) -> ()
280 ; CHECK-NEXT: # %bb.0:
281 ; CHECK-NEXT: local.get 1
282 ; CHECK-NEXT: i32.const -16
283 ; CHECK-NEXT: i32.add
284 ; CHECK-NEXT: local.get 0
285 ; CHECK-NEXT: v128.store 0
286 ; CHECK-NEXT: # fallthrough-return
287 %s = getelementptr inbounds <16 x i8>, <16 x i8>* %p, i32 -1
288 store <16 x i8> %v , <16 x i8>* %s
292 define void @store_v16i8_with_unfolded_offset(<16 x i8> %v, <16 x i8>* %p) {
293 ; CHECK-LABEL: store_v16i8_with_unfolded_offset:
294 ; CHECK: .functype store_v16i8_with_unfolded_offset (v128, i32) -> ()
295 ; CHECK-NEXT: # %bb.0:
296 ; CHECK-NEXT: local.get 1
297 ; CHECK-NEXT: i32.const 16
298 ; CHECK-NEXT: i32.add
299 ; CHECK-NEXT: local.get 0
300 ; CHECK-NEXT: v128.store 0
301 ; CHECK-NEXT: # fallthrough-return
302 %q = ptrtoint <16 x i8>* %p to i32
303 %r = add nsw i32 %q, 16
304 %s = inttoptr i32 %r to <16 x i8>*
305 store <16 x i8> %v , <16 x i8>* %s
309 define void @store_v16i8_with_unfolded_gep_offset(<16 x i8> %v, <16 x i8>* %p) {
310 ; CHECK-LABEL: store_v16i8_with_unfolded_gep_offset:
311 ; CHECK: .functype store_v16i8_with_unfolded_gep_offset (v128, i32) -> ()
312 ; CHECK-NEXT: # %bb.0:
313 ; CHECK-NEXT: local.get 1
314 ; CHECK-NEXT: i32.const 16
315 ; CHECK-NEXT: i32.add
316 ; CHECK-NEXT: local.get 0
317 ; CHECK-NEXT: v128.store 0
318 ; CHECK-NEXT: # fallthrough-return
319 %s = getelementptr <16 x i8>, <16 x i8>* %p, i32 1
320 store <16 x i8> %v , <16 x i8>* %s
324 define void @store_v16i8_to_numeric_address(<16 x i8> %v) {
325 ; CHECK-LABEL: store_v16i8_to_numeric_address:
326 ; CHECK: .functype store_v16i8_to_numeric_address (v128) -> ()
327 ; CHECK-NEXT: # %bb.0:
328 ; CHECK-NEXT: i32.const 0
329 ; CHECK-NEXT: local.get 0
330 ; CHECK-NEXT: v128.store 32
331 ; CHECK-NEXT: # fallthrough-return
332 %s = inttoptr i32 32 to <16 x i8>*
333 store <16 x i8> %v , <16 x i8>* %s
337 define void @store_v16i8_to_global_address(<16 x i8> %v) {
338 ; CHECK-LABEL: store_v16i8_to_global_address:
339 ; CHECK: .functype store_v16i8_to_global_address (v128) -> ()
340 ; CHECK-NEXT: # %bb.0:
341 ; CHECK-NEXT: i32.const 0
342 ; CHECK-NEXT: local.get 0
343 ; CHECK-NEXT: v128.store gv_v16i8
344 ; CHECK-NEXT: # fallthrough-return
345 store <16 x i8> %v , <16 x i8>* @gv_v16i8
349 ; ==============================================================================
351 ; ==============================================================================
352 define <8 x i16> @load_v8i16(<8 x i16>* %p) {
353 ; CHECK-LABEL: load_v8i16:
354 ; CHECK: .functype load_v8i16 (i32) -> (v128)
355 ; CHECK-NEXT: # %bb.0:
356 ; CHECK-NEXT: local.get 0
357 ; CHECK-NEXT: v128.load 0
358 ; CHECK-NEXT: # fallthrough-return
359 %v = load <8 x i16>, <8 x i16>* %p
363 define <8 x i16> @load_splat_v8i16(i16* %p) {
364 ; CHECK-LABEL: load_splat_v8i16:
365 ; CHECK: .functype load_splat_v8i16 (i32) -> (v128)
366 ; CHECK-NEXT: # %bb.0:
367 ; CHECK-NEXT: local.get 0
368 ; CHECK-NEXT: v128.load16_splat 0
369 ; CHECK-NEXT: # fallthrough-return
370 %e = load i16, i16* %p
371 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
372 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
376 define <8 x i16> @load_sext_v8i16(<8 x i8>* %p) {
377 ; CHECK-LABEL: load_sext_v8i16:
378 ; CHECK: .functype load_sext_v8i16 (i32) -> (v128)
379 ; CHECK-NEXT: # %bb.0:
380 ; CHECK-NEXT: local.get 0
381 ; CHECK-NEXT: i16x8.load8x8_s 0
382 ; CHECK-NEXT: # fallthrough-return
383 %v = load <8 x i8>, <8 x i8>* %p
384 %v2 = sext <8 x i8> %v to <8 x i16>
388 define <8 x i16> @load_zext_v8i16(<8 x i8>* %p) {
389 ; CHECK-LABEL: load_zext_v8i16:
390 ; CHECK: .functype load_zext_v8i16 (i32) -> (v128)
391 ; CHECK-NEXT: # %bb.0:
392 ; CHECK-NEXT: local.get 0
393 ; CHECK-NEXT: i16x8.load8x8_u 0
394 ; CHECK-NEXT: # fallthrough-return
395 %v = load <8 x i8>, <8 x i8>* %p
396 %v2 = zext <8 x i8> %v to <8 x i16>
400 define <8 x i8> @load_ext_v8i16(<8 x i8>* %p) {
401 ; CHECK-LABEL: load_ext_v8i16:
402 ; CHECK: .functype load_ext_v8i16 (i32) -> (v128)
403 ; CHECK-NEXT: # %bb.0:
404 ; CHECK-NEXT: local.get 0
405 ; CHECK-NEXT: v128.load64_zero 0
406 ; CHECK-NEXT: # fallthrough-return
407 %v = load <8 x i8>, <8 x i8>* %p
411 define <8 x i16> @load_v8i16_with_folded_offset(<8 x i16>* %p) {
412 ; CHECK-LABEL: load_v8i16_with_folded_offset:
413 ; CHECK: .functype load_v8i16_with_folded_offset (i32) -> (v128)
414 ; CHECK-NEXT: # %bb.0:
415 ; CHECK-NEXT: local.get 0
416 ; CHECK-NEXT: v128.load 16
417 ; CHECK-NEXT: # fallthrough-return
418 %q = ptrtoint <8 x i16>* %p to i32
419 %r = add nuw i32 %q, 16
420 %s = inttoptr i32 %r to <8 x i16>*
421 %v = load <8 x i16>, <8 x i16>* %s
425 define <8 x i16> @load_splat_v8i16_with_folded_offset(i16* %p) {
426 ; CHECK-LABEL: load_splat_v8i16_with_folded_offset:
427 ; CHECK: .functype load_splat_v8i16_with_folded_offset (i32) -> (v128)
428 ; CHECK-NEXT: # %bb.0:
429 ; CHECK-NEXT: local.get 0
430 ; CHECK-NEXT: v128.load16_splat 16
431 ; CHECK-NEXT: # fallthrough-return
432 %q = ptrtoint i16* %p to i32
433 %r = add nuw i32 %q, 16
434 %s = inttoptr i32 %r to i16*
435 %e = load i16, i16* %s
436 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
437 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
441 define <8 x i16> @load_sext_v8i16_with_folded_offset(<8 x i8>* %p) {
442 ; CHECK-LABEL: load_sext_v8i16_with_folded_offset:
443 ; CHECK: .functype load_sext_v8i16_with_folded_offset (i32) -> (v128)
444 ; CHECK-NEXT: # %bb.0:
445 ; CHECK-NEXT: local.get 0
446 ; CHECK-NEXT: i16x8.load8x8_s 16
447 ; CHECK-NEXT: # fallthrough-return
448 %q = ptrtoint <8 x i8>* %p to i32
449 %r = add nuw i32 %q, 16
450 %s = inttoptr i32 %r to <8 x i8>*
451 %v = load <8 x i8>, <8 x i8>* %s
452 %v2 = sext <8 x i8> %v to <8 x i16>
456 define <8 x i16> @load_zext_v8i16_with_folded_offset(<8 x i8>* %p) {
457 ; CHECK-LABEL: load_zext_v8i16_with_folded_offset:
458 ; CHECK: .functype load_zext_v8i16_with_folded_offset (i32) -> (v128)
459 ; CHECK-NEXT: # %bb.0:
460 ; CHECK-NEXT: local.get 0
461 ; CHECK-NEXT: i16x8.load8x8_u 16
462 ; CHECK-NEXT: # fallthrough-return
463 %q = ptrtoint <8 x i8>* %p to i32
464 %r = add nuw i32 %q, 16
465 %s = inttoptr i32 %r to <8 x i8>*
466 %v = load <8 x i8>, <8 x i8>* %s
467 %v2 = zext <8 x i8> %v to <8 x i16>
471 define <8 x i8> @load_ext_v8i16_with_folded_offset(<8 x i8>* %p) {
472 ; CHECK-LABEL: load_ext_v8i16_with_folded_offset:
473 ; CHECK: .functype load_ext_v8i16_with_folded_offset (i32) -> (v128)
474 ; CHECK-NEXT: # %bb.0:
475 ; CHECK-NEXT: local.get 0
476 ; CHECK-NEXT: v128.load64_zero 16
477 ; CHECK-NEXT: # fallthrough-return
478 %q = ptrtoint <8 x i8>* %p to i32
479 %r = add nuw i32 %q, 16
480 %s = inttoptr i32 %r to <8 x i8>*
481 %v = load <8 x i8>, <8 x i8>* %s
485 define <8 x i16> @load_v8i16_with_folded_gep_offset(<8 x i16>* %p) {
486 ; CHECK-LABEL: load_v8i16_with_folded_gep_offset:
487 ; CHECK: .functype load_v8i16_with_folded_gep_offset (i32) -> (v128)
488 ; CHECK-NEXT: # %bb.0:
489 ; CHECK-NEXT: local.get 0
490 ; CHECK-NEXT: v128.load 16
491 ; CHECK-NEXT: # fallthrough-return
492 %s = getelementptr inbounds <8 x i16>, <8 x i16>* %p, i32 1
493 %v = load <8 x i16>, <8 x i16>* %s
497 define <8 x i16> @load_splat_v8i16_with_folded_gep_offset(i16* %p) {
498 ; CHECK-LABEL: load_splat_v8i16_with_folded_gep_offset:
499 ; CHECK: .functype load_splat_v8i16_with_folded_gep_offset (i32) -> (v128)
500 ; CHECK-NEXT: # %bb.0:
501 ; CHECK-NEXT: local.get 0
502 ; CHECK-NEXT: v128.load16_splat 2
503 ; CHECK-NEXT: # fallthrough-return
504 %s = getelementptr inbounds i16, i16* %p, i32 1
505 %e = load i16, i16* %s
506 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
507 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
511 define <8 x i16> @load_sext_v8i16_with_folded_gep_offset(<8 x i8>* %p) {
512 ; CHECK-LABEL: load_sext_v8i16_with_folded_gep_offset:
513 ; CHECK: .functype load_sext_v8i16_with_folded_gep_offset (i32) -> (v128)
514 ; CHECK-NEXT: # %bb.0:
515 ; CHECK-NEXT: local.get 0
516 ; CHECK-NEXT: i16x8.load8x8_s 8
517 ; CHECK-NEXT: # fallthrough-return
518 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 1
519 %v = load <8 x i8>, <8 x i8>* %s
520 %v2 = sext <8 x i8> %v to <8 x i16>
524 define <8 x i16> @load_zext_v8i16_with_folded_gep_offset(<8 x i8>* %p) {
525 ; CHECK-LABEL: load_zext_v8i16_with_folded_gep_offset:
526 ; CHECK: .functype load_zext_v8i16_with_folded_gep_offset (i32) -> (v128)
527 ; CHECK-NEXT: # %bb.0:
528 ; CHECK-NEXT: local.get 0
529 ; CHECK-NEXT: i16x8.load8x8_u 8
530 ; CHECK-NEXT: # fallthrough-return
531 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 1
532 %v = load <8 x i8>, <8 x i8>* %s
533 %v2 = zext <8 x i8> %v to <8 x i16>
537 define <8 x i8> @load_ext_v8i16_with_folded_gep_offset(<8 x i8>* %p) {
538 ; CHECK-LABEL: load_ext_v8i16_with_folded_gep_offset:
539 ; CHECK: .functype load_ext_v8i16_with_folded_gep_offset (i32) -> (v128)
540 ; CHECK-NEXT: # %bb.0:
541 ; CHECK-NEXT: local.get 0
542 ; CHECK-NEXT: v128.load64_zero 8
543 ; CHECK-NEXT: # fallthrough-return
544 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 1
545 %v = load <8 x i8>, <8 x i8>* %s
549 define <8 x i16> @load_v8i16_with_unfolded_gep_negative_offset(<8 x i16>* %p) {
550 ; CHECK-LABEL: load_v8i16_with_unfolded_gep_negative_offset:
551 ; CHECK: .functype load_v8i16_with_unfolded_gep_negative_offset (i32) -> (v128)
552 ; CHECK-NEXT: # %bb.0:
553 ; CHECK-NEXT: local.get 0
554 ; CHECK-NEXT: i32.const -16
555 ; CHECK-NEXT: i32.add
556 ; CHECK-NEXT: v128.load 0
557 ; CHECK-NEXT: # fallthrough-return
558 %s = getelementptr inbounds <8 x i16>, <8 x i16>* %p, i32 -1
559 %v = load <8 x i16>, <8 x i16>* %s
563 define <8 x i16> @load_splat_v8i16_with_unfolded_gep_negative_offset(i16* %p) {
564 ; CHECK-LABEL: load_splat_v8i16_with_unfolded_gep_negative_offset:
565 ; CHECK: .functype load_splat_v8i16_with_unfolded_gep_negative_offset (i32) -> (v128)
566 ; CHECK-NEXT: # %bb.0:
567 ; CHECK-NEXT: local.get 0
568 ; CHECK-NEXT: i32.const -2
569 ; CHECK-NEXT: i32.add
570 ; CHECK-NEXT: v128.load16_splat 0
571 ; CHECK-NEXT: # fallthrough-return
572 %s = getelementptr inbounds i16, i16* %p, i32 -1
573 %e = load i16, i16* %s
574 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
575 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
579 define <8 x i16> @load_sext_v8i16_with_unfolded_gep_negative_offset(<8 x i8>* %p) {
580 ; CHECK-LABEL: load_sext_v8i16_with_unfolded_gep_negative_offset:
581 ; CHECK: .functype load_sext_v8i16_with_unfolded_gep_negative_offset (i32) -> (v128)
582 ; CHECK-NEXT: # %bb.0:
583 ; CHECK-NEXT: local.get 0
584 ; CHECK-NEXT: i32.const -8
585 ; CHECK-NEXT: i32.add
586 ; CHECK-NEXT: i16x8.load8x8_s 0
587 ; CHECK-NEXT: # fallthrough-return
588 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 -1
589 %v = load <8 x i8>, <8 x i8>* %s
590 %v2 = sext <8 x i8> %v to <8 x i16>
594 define <8 x i16> @load_zext_v8i16_with_unfolded_gep_negative_offset(<8 x i8>* %p) {
595 ; CHECK-LABEL: load_zext_v8i16_with_unfolded_gep_negative_offset:
596 ; CHECK: .functype load_zext_v8i16_with_unfolded_gep_negative_offset (i32) -> (v128)
597 ; CHECK-NEXT: # %bb.0:
598 ; CHECK-NEXT: local.get 0
599 ; CHECK-NEXT: i32.const -8
600 ; CHECK-NEXT: i32.add
601 ; CHECK-NEXT: i16x8.load8x8_u 0
602 ; CHECK-NEXT: # fallthrough-return
603 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 -1
604 %v = load <8 x i8>, <8 x i8>* %s
605 %v2 = zext <8 x i8> %v to <8 x i16>
609 define <8 x i8> @load_ext_v8i16_with_unfolded_gep_negative_offset(<8 x i8>* %p) {
610 ; CHECK-LABEL: load_ext_v8i16_with_unfolded_gep_negative_offset:
611 ; CHECK: .functype load_ext_v8i16_with_unfolded_gep_negative_offset (i32) -> (v128)
612 ; CHECK-NEXT: # %bb.0:
613 ; CHECK-NEXT: local.get 0
614 ; CHECK-NEXT: i32.const -8
615 ; CHECK-NEXT: i32.add
616 ; CHECK-NEXT: v128.load64_zero 0
617 ; CHECK-NEXT: # fallthrough-return
618 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 -1
619 %v = load <8 x i8>, <8 x i8>* %s
623 define <8 x i16> @load_v8i16_with_unfolded_offset(<8 x i16>* %p) {
624 ; CHECK-LABEL: load_v8i16_with_unfolded_offset:
625 ; CHECK: .functype load_v8i16_with_unfolded_offset (i32) -> (v128)
626 ; CHECK-NEXT: # %bb.0:
627 ; CHECK-NEXT: local.get 0
628 ; CHECK-NEXT: i32.const 16
629 ; CHECK-NEXT: i32.add
630 ; CHECK-NEXT: v128.load 0
631 ; CHECK-NEXT: # fallthrough-return
632 %q = ptrtoint <8 x i16>* %p to i32
633 %r = add nsw i32 %q, 16
634 %s = inttoptr i32 %r to <8 x i16>*
635 %v = load <8 x i16>, <8 x i16>* %s
639 define <8 x i16> @load_splat_v8i16_with_unfolded_offset(i16* %p) {
640 ; CHECK-LABEL: load_splat_v8i16_with_unfolded_offset:
641 ; CHECK: .functype load_splat_v8i16_with_unfolded_offset (i32) -> (v128)
642 ; CHECK-NEXT: # %bb.0:
643 ; CHECK-NEXT: local.get 0
644 ; CHECK-NEXT: i32.const 16
645 ; CHECK-NEXT: i32.add
646 ; CHECK-NEXT: v128.load16_splat 0
647 ; CHECK-NEXT: # fallthrough-return
648 %q = ptrtoint i16* %p to i32
649 %r = add nsw i32 %q, 16
650 %s = inttoptr i32 %r to i16*
651 %e = load i16, i16* %s
652 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
653 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
657 define <8 x i16> @load_sext_v8i16_with_unfolded_offset(<8 x i8>* %p) {
658 ; CHECK-LABEL: load_sext_v8i16_with_unfolded_offset:
659 ; CHECK: .functype load_sext_v8i16_with_unfolded_offset (i32) -> (v128)
660 ; CHECK-NEXT: # %bb.0:
661 ; CHECK-NEXT: local.get 0
662 ; CHECK-NEXT: i32.const 16
663 ; CHECK-NEXT: i32.add
664 ; CHECK-NEXT: i16x8.load8x8_s 0
665 ; CHECK-NEXT: # fallthrough-return
666 %q = ptrtoint <8 x i8>* %p to i32
667 %r = add nsw i32 %q, 16
668 %s = inttoptr i32 %r to <8 x i8>*
669 %v = load <8 x i8>, <8 x i8>* %s
670 %v2 = sext <8 x i8> %v to <8 x i16>
674 define <8 x i16> @load_zext_v8i16_with_unfolded_offset(<8 x i8>* %p) {
675 ; CHECK-LABEL: load_zext_v8i16_with_unfolded_offset:
676 ; CHECK: .functype load_zext_v8i16_with_unfolded_offset (i32) -> (v128)
677 ; CHECK-NEXT: # %bb.0:
678 ; CHECK-NEXT: local.get 0
679 ; CHECK-NEXT: i32.const 16
680 ; CHECK-NEXT: i32.add
681 ; CHECK-NEXT: i16x8.load8x8_u 0
682 ; CHECK-NEXT: # fallthrough-return
683 %q = ptrtoint <8 x i8>* %p to i32
684 %r = add nsw i32 %q, 16
685 %s = inttoptr i32 %r to <8 x i8>*
686 %v = load <8 x i8>, <8 x i8>* %s
687 %v2 = zext <8 x i8> %v to <8 x i16>
691 define <8 x i8> @load_ext_v8i16_with_unfolded_offset(<8 x i8>* %p) {
692 ; CHECK-LABEL: load_ext_v8i16_with_unfolded_offset:
693 ; CHECK: .functype load_ext_v8i16_with_unfolded_offset (i32) -> (v128)
694 ; CHECK-NEXT: # %bb.0:
695 ; CHECK-NEXT: local.get 0
696 ; CHECK-NEXT: i32.const 16
697 ; CHECK-NEXT: i32.add
698 ; CHECK-NEXT: v128.load64_zero 0
699 ; CHECK-NEXT: # fallthrough-return
700 %q = ptrtoint <8 x i8>* %p to i32
701 %r = add nsw i32 %q, 16
702 %s = inttoptr i32 %r to <8 x i8>*
703 %v = load <8 x i8>, <8 x i8>* %s
707 define <8 x i16> @load_v8i16_with_unfolded_gep_offset(<8 x i16>* %p) {
708 ; CHECK-LABEL: load_v8i16_with_unfolded_gep_offset:
709 ; CHECK: .functype load_v8i16_with_unfolded_gep_offset (i32) -> (v128)
710 ; CHECK-NEXT: # %bb.0:
711 ; CHECK-NEXT: local.get 0
712 ; CHECK-NEXT: i32.const 16
713 ; CHECK-NEXT: i32.add
714 ; CHECK-NEXT: v128.load 0
715 ; CHECK-NEXT: # fallthrough-return
716 %s = getelementptr <8 x i16>, <8 x i16>* %p, i32 1
717 %v = load <8 x i16>, <8 x i16>* %s
721 define <8 x i16> @load_splat_v8i16_with_unfolded_gep_offset(i16* %p) {
722 ; CHECK-LABEL: load_splat_v8i16_with_unfolded_gep_offset:
723 ; CHECK: .functype load_splat_v8i16_with_unfolded_gep_offset (i32) -> (v128)
724 ; CHECK-NEXT: # %bb.0:
725 ; CHECK-NEXT: local.get 0
726 ; CHECK-NEXT: i32.const 2
727 ; CHECK-NEXT: i32.add
728 ; CHECK-NEXT: v128.load16_splat 0
729 ; CHECK-NEXT: # fallthrough-return
730 %s = getelementptr i16, i16* %p, i32 1
731 %e = load i16, i16* %s
732 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
733 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
737 define <8 x i16> @load_sext_v8i16_with_unfolded_gep_offset(<8 x i8>* %p) {
738 ; CHECK-LABEL: load_sext_v8i16_with_unfolded_gep_offset:
739 ; CHECK: .functype load_sext_v8i16_with_unfolded_gep_offset (i32) -> (v128)
740 ; CHECK-NEXT: # %bb.0:
741 ; CHECK-NEXT: local.get 0
742 ; CHECK-NEXT: i32.const 8
743 ; CHECK-NEXT: i32.add
744 ; CHECK-NEXT: i16x8.load8x8_s 0
745 ; CHECK-NEXT: # fallthrough-return
746 %s = getelementptr <8 x i8>, <8 x i8>* %p, i32 1
747 %v = load <8 x i8>, <8 x i8>* %s
748 %v2 = sext <8 x i8> %v to <8 x i16>
752 define <8 x i16> @load_zext_v8i16_with_unfolded_gep_offset(<8 x i8>* %p) {
753 ; CHECK-LABEL: load_zext_v8i16_with_unfolded_gep_offset:
754 ; CHECK: .functype load_zext_v8i16_with_unfolded_gep_offset (i32) -> (v128)
755 ; CHECK-NEXT: # %bb.0:
756 ; CHECK-NEXT: local.get 0
757 ; CHECK-NEXT: i32.const 8
758 ; CHECK-NEXT: i32.add
759 ; CHECK-NEXT: i16x8.load8x8_u 0
760 ; CHECK-NEXT: # fallthrough-return
761 %s = getelementptr <8 x i8>, <8 x i8>* %p, i32 1
762 %v = load <8 x i8>, <8 x i8>* %s
763 %v2 = zext <8 x i8> %v to <8 x i16>
767 define <8 x i8> @load_ext_v8i16_with_unfolded_gep_offset(<8 x i8>* %p) {
768 ; CHECK-LABEL: load_ext_v8i16_with_unfolded_gep_offset:
769 ; CHECK: .functype load_ext_v8i16_with_unfolded_gep_offset (i32) -> (v128)
770 ; CHECK-NEXT: # %bb.0:
771 ; CHECK-NEXT: local.get 0
772 ; CHECK-NEXT: i32.const 8
773 ; CHECK-NEXT: i32.add
774 ; CHECK-NEXT: v128.load64_zero 0
775 ; CHECK-NEXT: # fallthrough-return
776 %s = getelementptr <8 x i8>, <8 x i8>* %p, i32 1
777 %v = load <8 x i8>, <8 x i8>* %s
781 define <8 x i16> @load_v8i16_from_numeric_address() {
782 ; CHECK-LABEL: load_v8i16_from_numeric_address:
783 ; CHECK: .functype load_v8i16_from_numeric_address () -> (v128)
784 ; CHECK-NEXT: # %bb.0:
785 ; CHECK-NEXT: i32.const 0
786 ; CHECK-NEXT: v128.load 32
787 ; CHECK-NEXT: # fallthrough-return
788 %s = inttoptr i32 32 to <8 x i16>*
789 %v = load <8 x i16>, <8 x i16>* %s
793 define <8 x i16> @load_splat_v8i16_from_numeric_address() {
794 ; CHECK-LABEL: load_splat_v8i16_from_numeric_address:
795 ; CHECK: .functype load_splat_v8i16_from_numeric_address () -> (v128)
796 ; CHECK-NEXT: # %bb.0:
797 ; CHECK-NEXT: i32.const 0
798 ; CHECK-NEXT: v128.load16_splat 32
799 ; CHECK-NEXT: # fallthrough-return
800 %s = inttoptr i32 32 to i16*
801 %e = load i16, i16* %s
802 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
803 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
807 define <8 x i16> @load_sext_v8i16_from_numeric_address() {
808 ; CHECK-LABEL: load_sext_v8i16_from_numeric_address:
809 ; CHECK: .functype load_sext_v8i16_from_numeric_address () -> (v128)
810 ; CHECK-NEXT: # %bb.0:
811 ; CHECK-NEXT: i32.const 0
812 ; CHECK-NEXT: i16x8.load8x8_s 32
813 ; CHECK-NEXT: # fallthrough-return
814 %s = inttoptr i32 32 to <8 x i8>*
815 %v = load <8 x i8>, <8 x i8>* %s
816 %v2 = sext <8 x i8> %v to <8 x i16>
820 define <8 x i16> @load_zext_v8i16_from_numeric_address() {
821 ; CHECK-LABEL: load_zext_v8i16_from_numeric_address:
822 ; CHECK: .functype load_zext_v8i16_from_numeric_address () -> (v128)
823 ; CHECK-NEXT: # %bb.0:
824 ; CHECK-NEXT: i32.const 0
825 ; CHECK-NEXT: i16x8.load8x8_u 32
826 ; CHECK-NEXT: # fallthrough-return
827 %s = inttoptr i32 32 to <8 x i8>*
828 %v = load <8 x i8>, <8 x i8>* %s
829 %v2 = zext <8 x i8> %v to <8 x i16>
833 define <8 x i8> @load_ext_v8i16_from_numeric_address() {
834 ; CHECK-LABEL: load_ext_v8i16_from_numeric_address:
835 ; CHECK: .functype load_ext_v8i16_from_numeric_address () -> (v128)
836 ; CHECK-NEXT: # %bb.0:
837 ; CHECK-NEXT: i32.const 0
838 ; CHECK-NEXT: v128.load64_zero 32
839 ; CHECK-NEXT: # fallthrough-return
840 %s = inttoptr i32 32 to <8 x i8>*
841 %v = load <8 x i8>, <8 x i8>* %s
845 @gv_v8i16 = global <8 x i16> <i16 42, i16 42, i16 42, i16 42, i16 42, i16 42, i16 42, i16 42>
846 define <8 x i16> @load_v8i16_from_global_address() {
847 ; CHECK-LABEL: load_v8i16_from_global_address:
848 ; CHECK: .functype load_v8i16_from_global_address () -> (v128)
849 ; CHECK-NEXT: # %bb.0:
850 ; CHECK-NEXT: i32.const 0
851 ; CHECK-NEXT: v128.load gv_v8i16
852 ; CHECK-NEXT: # fallthrough-return
853 %v = load <8 x i16>, <8 x i16>* @gv_v8i16
857 @gv_i16 = global i16 42
858 define <8 x i16> @load_splat_v8i16_from_global_address() {
859 ; CHECK-LABEL: load_splat_v8i16_from_global_address:
860 ; CHECK: .functype load_splat_v8i16_from_global_address () -> (v128)
861 ; CHECK-NEXT: # %bb.0:
862 ; CHECK-NEXT: i32.const 0
863 ; CHECK-NEXT: v128.load16_splat gv_i16
864 ; CHECK-NEXT: # fallthrough-return
865 %e = load i16, i16* @gv_i16
866 %v1 = insertelement <8 x i16> undef, i16 %e, i32 0
867 %v2 = shufflevector <8 x i16> %v1, <8 x i16> undef, <8 x i32> zeroinitializer
871 @gv_v8i8 = global <8 x i8> <i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42, i8 42>
872 define <8 x i16> @load_sext_v8i16_from_global_address() {
873 ; CHECK-LABEL: load_sext_v8i16_from_global_address:
874 ; CHECK: .functype load_sext_v8i16_from_global_address () -> (v128)
875 ; CHECK-NEXT: # %bb.0:
876 ; CHECK-NEXT: i32.const 0
877 ; CHECK-NEXT: i16x8.load8x8_s gv_v8i8
878 ; CHECK-NEXT: # fallthrough-return
879 %v = load <8 x i8>, <8 x i8>* @gv_v8i8
880 %v2 = sext <8 x i8> %v to <8 x i16>
884 define <8 x i16> @load_zext_v8i16_from_global_address() {
885 ; CHECK-LABEL: load_zext_v8i16_from_global_address:
886 ; CHECK: .functype load_zext_v8i16_from_global_address () -> (v128)
887 ; CHECK-NEXT: # %bb.0:
888 ; CHECK-NEXT: i32.const 0
889 ; CHECK-NEXT: i16x8.load8x8_u gv_v8i8
890 ; CHECK-NEXT: # fallthrough-return
891 %v = load <8 x i8>, <8 x i8>* @gv_v8i8
892 %v2 = zext <8 x i8> %v to <8 x i16>
896 define <8 x i8> @load_ext_v8i16_from_global_address() {
897 ; CHECK-LABEL: load_ext_v8i16_from_global_address:
898 ; CHECK: .functype load_ext_v8i16_from_global_address () -> (v128)
899 ; CHECK-NEXT: # %bb.0:
900 ; CHECK-NEXT: i32.const 0
901 ; CHECK-NEXT: v128.load64_zero gv_v8i8
902 ; CHECK-NEXT: # fallthrough-return
903 %v = load <8 x i8>, <8 x i8>* @gv_v8i8
908 define void @store_v8i16(<8 x i16> %v, <8 x i16>* %p) {
909 ; CHECK-LABEL: store_v8i16:
910 ; CHECK: .functype store_v8i16 (v128, i32) -> ()
911 ; CHECK-NEXT: # %bb.0:
912 ; CHECK-NEXT: local.get 1
913 ; CHECK-NEXT: local.get 0
914 ; CHECK-NEXT: v128.store 0
915 ; CHECK-NEXT: # fallthrough-return
916 store <8 x i16> %v , <8 x i16>* %p
920 define void @store_narrowing_v8i16(<8 x i8> %v, <8 x i8>* %p) {
921 ; CHECK-LABEL: store_narrowing_v8i16:
922 ; CHECK: .functype store_narrowing_v8i16 (v128, i32) -> ()
923 ; CHECK-NEXT: # %bb.0:
924 ; CHECK-NEXT: local.get 1
925 ; CHECK-NEXT: local.get 0
926 ; CHECK-NEXT: v128.store64_lane 0, 0
927 ; CHECK-NEXT: # fallthrough-return
928 store <8 x i8> %v, <8 x i8>* %p
932 define void @store_v8i16_with_folded_offset(<8 x i16> %v, <8 x i16>* %p) {
933 ; CHECK-LABEL: store_v8i16_with_folded_offset:
934 ; CHECK: .functype store_v8i16_with_folded_offset (v128, i32) -> ()
935 ; CHECK-NEXT: # %bb.0:
936 ; CHECK-NEXT: local.get 1
937 ; CHECK-NEXT: local.get 0
938 ; CHECK-NEXT: v128.store 16
939 ; CHECK-NEXT: # fallthrough-return
940 %q = ptrtoint <8 x i16>* %p to i32
941 %r = add nuw i32 %q, 16
942 %s = inttoptr i32 %r to <8 x i16>*
943 store <8 x i16> %v , <8 x i16>* %s
947 define void @store_narrowing_v8i16_with_folded_offset(<8 x i8> %v, <8 x i8>* %p) {
948 ; CHECK-LABEL: store_narrowing_v8i16_with_folded_offset:
949 ; CHECK: .functype store_narrowing_v8i16_with_folded_offset (v128, i32) -> ()
950 ; CHECK-NEXT: # %bb.0:
951 ; CHECK-NEXT: local.get 1
952 ; CHECK-NEXT: i32.const 16
953 ; CHECK-NEXT: i32.add
954 ; CHECK-NEXT: local.get 0
955 ; CHECK-NEXT: v128.store64_lane 0, 0
956 ; CHECK-NEXT: # fallthrough-return
957 %q = ptrtoint <8 x i8>* %p to i32
958 %r = add nuw i32 %q, 16
959 %s = inttoptr i32 %r to <8 x i8>*
960 store <8 x i8> %v , <8 x i8>* %s
964 define void @store_v8i16_with_folded_gep_offset(<8 x i16> %v, <8 x i16>* %p) {
965 ; CHECK-LABEL: store_v8i16_with_folded_gep_offset:
966 ; CHECK: .functype store_v8i16_with_folded_gep_offset (v128, i32) -> ()
967 ; CHECK-NEXT: # %bb.0:
968 ; CHECK-NEXT: local.get 1
969 ; CHECK-NEXT: local.get 0
970 ; CHECK-NEXT: v128.store 16
971 ; CHECK-NEXT: # fallthrough-return
972 %s = getelementptr inbounds <8 x i16>, <8 x i16>* %p, i32 1
973 store <8 x i16> %v , <8 x i16>* %s
977 define void @store_narrowing_v8i16_with_folded_gep_offset(<8 x i8> %v, <8 x i8>* %p) {
978 ; CHECK-LABEL: store_narrowing_v8i16_with_folded_gep_offset:
979 ; CHECK: .functype store_narrowing_v8i16_with_folded_gep_offset (v128, i32) -> ()
980 ; CHECK-NEXT: # %bb.0:
981 ; CHECK-NEXT: local.get 1
982 ; CHECK-NEXT: i32.const 8
983 ; CHECK-NEXT: i32.add
984 ; CHECK-NEXT: local.get 0
985 ; CHECK-NEXT: v128.store64_lane 0, 0
986 ; CHECK-NEXT: # fallthrough-return
987 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 1
988 store <8 x i8> %v , <8 x i8>* %s
992 define void @store_v8i16_with_unfolded_gep_negative_offset(<8 x i16> %v, <8 x i16>* %p) {
993 ; CHECK-LABEL: store_v8i16_with_unfolded_gep_negative_offset:
994 ; CHECK: .functype store_v8i16_with_unfolded_gep_negative_offset (v128, i32) -> ()
995 ; CHECK-NEXT: # %bb.0:
996 ; CHECK-NEXT: local.get 1
997 ; CHECK-NEXT: i32.const -16
998 ; CHECK-NEXT: i32.add
999 ; CHECK-NEXT: local.get 0
1000 ; CHECK-NEXT: v128.store 0
1001 ; CHECK-NEXT: # fallthrough-return
1002 %s = getelementptr inbounds <8 x i16>, <8 x i16>* %p, i32 -1
1003 store <8 x i16> %v , <8 x i16>* %s
1007 define void @store_narrowing_v8i16_with_unfolded_gep_negative_offset(<8 x i8> %v, <8 x i8>* %p) {
1008 ; CHECK-LABEL: store_narrowing_v8i16_with_unfolded_gep_negative_offset:
1009 ; CHECK: .functype store_narrowing_v8i16_with_unfolded_gep_negative_offset (v128, i32) -> ()
1010 ; CHECK-NEXT: # %bb.0:
1011 ; CHECK-NEXT: local.get 1
1012 ; CHECK-NEXT: i32.const -8
1013 ; CHECK-NEXT: i32.add
1014 ; CHECK-NEXT: local.get 0
1015 ; CHECK-NEXT: v128.store64_lane 0, 0
1016 ; CHECK-NEXT: # fallthrough-return
1017 %s = getelementptr inbounds <8 x i8>, <8 x i8>* %p, i32 -1
1018 store <8 x i8> %v , <8 x i8>* %s
1022 define void @store_v8i16_with_unfolded_offset(<8 x i16> %v, <8 x i16>* %p) {
1023 ; CHECK-LABEL: store_v8i16_with_unfolded_offset:
1024 ; CHECK: .functype store_v8i16_with_unfolded_offset (v128, i32) -> ()
1025 ; CHECK-NEXT: # %bb.0:
1026 ; CHECK-NEXT: local.get 1
1027 ; CHECK-NEXT: i32.const 16
1028 ; CHECK-NEXT: i32.add
1029 ; CHECK-NEXT: local.get 0
1030 ; CHECK-NEXT: v128.store 0
1031 ; CHECK-NEXT: # fallthrough-return
1032 %q = ptrtoint <8 x i16>* %p to i32
1033 %r = add nsw i32 %q, 16
1034 %s = inttoptr i32 %r to <8 x i16>*
1035 store <8 x i16> %v , <8 x i16>* %s
1039 define void @store_narrowing_v8i16_with_unfolded_offset(<8 x i8> %v, <8 x i8>* %p) {
1040 ; CHECK-LABEL: store_narrowing_v8i16_with_unfolded_offset:
1041 ; CHECK: .functype store_narrowing_v8i16_with_unfolded_offset (v128, i32) -> ()
1042 ; CHECK-NEXT: # %bb.0:
1043 ; CHECK-NEXT: local.get 1
1044 ; CHECK-NEXT: i32.const 16
1045 ; CHECK-NEXT: i32.add
1046 ; CHECK-NEXT: local.get 0
1047 ; CHECK-NEXT: v128.store64_lane 0, 0
1048 ; CHECK-NEXT: # fallthrough-return
1049 %q = ptrtoint <8 x i8>* %p to i32
1050 %r = add nsw i32 %q, 16
1051 %s = inttoptr i32 %r to <8 x i8>*
1052 store <8 x i8> %v , <8 x i8>* %s
1056 define void @store_v8i16_with_unfolded_gep_offset(<8 x i16> %v, <8 x i16>* %p) {
1057 ; CHECK-LABEL: store_v8i16_with_unfolded_gep_offset:
1058 ; CHECK: .functype store_v8i16_with_unfolded_gep_offset (v128, i32) -> ()
1059 ; CHECK-NEXT: # %bb.0:
1060 ; CHECK-NEXT: local.get 1
1061 ; CHECK-NEXT: i32.const 16
1062 ; CHECK-NEXT: i32.add
1063 ; CHECK-NEXT: local.get 0
1064 ; CHECK-NEXT: v128.store 0
1065 ; CHECK-NEXT: # fallthrough-return
1066 %s = getelementptr <8 x i16>, <8 x i16>* %p, i32 1
1067 store <8 x i16> %v , <8 x i16>* %s
1071 define void @store_narrowing_v8i16_with_unfolded_gep_offset(<8 x i8> %v, <8 x i8>* %p) {
1072 ; CHECK-LABEL: store_narrowing_v8i16_with_unfolded_gep_offset:
1073 ; CHECK: .functype store_narrowing_v8i16_with_unfolded_gep_offset (v128, i32) -> ()
1074 ; CHECK-NEXT: # %bb.0:
1075 ; CHECK-NEXT: local.get 1
1076 ; CHECK-NEXT: i32.const 8
1077 ; CHECK-NEXT: i32.add
1078 ; CHECK-NEXT: local.get 0
1079 ; CHECK-NEXT: v128.store64_lane 0, 0
1080 ; CHECK-NEXT: # fallthrough-return
1081 %s = getelementptr <8 x i8>, <8 x i8>* %p, i32 1
1082 store <8 x i8> %v , <8 x i8>* %s
1086 define void @store_v8i16_to_numeric_address(<8 x i16> %v) {
1087 ; CHECK-LABEL: store_v8i16_to_numeric_address:
1088 ; CHECK: .functype store_v8i16_to_numeric_address (v128) -> ()
1089 ; CHECK-NEXT: # %bb.0:
1090 ; CHECK-NEXT: i32.const 0
1091 ; CHECK-NEXT: local.get 0
1092 ; CHECK-NEXT: v128.store 32
1093 ; CHECK-NEXT: # fallthrough-return
1094 %s = inttoptr i32 32 to <8 x i16>*
1095 store <8 x i16> %v , <8 x i16>* %s
1099 define void @store_narrowing_v8i16_to_numeric_address(<8 x i8> %v, <8 x i8>* %p) {
1100 ; CHECK-LABEL: store_narrowing_v8i16_to_numeric_address:
1101 ; CHECK: .functype store_narrowing_v8i16_to_numeric_address (v128, i32) -> ()
1102 ; CHECK-NEXT: # %bb.0:
1103 ; CHECK-NEXT: i32.const 32
1104 ; CHECK-NEXT: local.get 0
1105 ; CHECK-NEXT: v128.store64_lane 0, 0
1106 ; CHECK-NEXT: # fallthrough-return
1107 %s = inttoptr i32 32 to <8 x i8>*
1108 store <8 x i8> %v , <8 x i8>* %s
1112 define void @store_v8i16_to_global_address(<8 x i16> %v) {
1113 ; CHECK-LABEL: store_v8i16_to_global_address:
1114 ; CHECK: .functype store_v8i16_to_global_address (v128) -> ()
1115 ; CHECK-NEXT: # %bb.0:
1116 ; CHECK-NEXT: i32.const 0
1117 ; CHECK-NEXT: local.get 0
1118 ; CHECK-NEXT: v128.store gv_v8i16
1119 ; CHECK-NEXT: # fallthrough-return
1120 store <8 x i16> %v , <8 x i16>* @gv_v8i16
1124 define void @store_narrowing_v8i16_to_global_address(<8 x i8> %v) {
1125 ; CHECK-LABEL: store_narrowing_v8i16_to_global_address:
1126 ; CHECK: .functype store_narrowing_v8i16_to_global_address (v128) -> ()
1127 ; CHECK-NEXT: # %bb.0:
1128 ; CHECK-NEXT: i32.const gv_v8i8
1129 ; CHECK-NEXT: local.get 0
1130 ; CHECK-NEXT: v128.store64_lane 0, 0
1131 ; CHECK-NEXT: # fallthrough-return
1132 store <8 x i8> %v , <8 x i8>* @gv_v8i8
1136 ; ==============================================================================
1138 ; ==============================================================================
1139 define <4 x i32> @load_v4i32(<4 x i32>* %p) {
1140 ; CHECK-LABEL: load_v4i32:
1141 ; CHECK: .functype load_v4i32 (i32) -> (v128)
1142 ; CHECK-NEXT: # %bb.0:
1143 ; CHECK-NEXT: local.get 0
1144 ; CHECK-NEXT: v128.load 0
1145 ; CHECK-NEXT: # fallthrough-return
1146 %v = load <4 x i32>, <4 x i32>* %p
1150 define <4 x i32> @load_splat_v4i32(i32* %addr) {
1151 ; CHECK-LABEL: load_splat_v4i32:
1152 ; CHECK: .functype load_splat_v4i32 (i32) -> (v128)
1153 ; CHECK-NEXT: # %bb.0:
1154 ; CHECK-NEXT: local.get 0
1155 ; CHECK-NEXT: v128.load32_splat 0
1156 ; CHECK-NEXT: # fallthrough-return
1157 %e = load i32, i32* %addr, align 4
1158 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1159 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1163 define <4 x i32> @load_sext_v4i32(<4 x i16>* %p) {
1164 ; CHECK-LABEL: load_sext_v4i32:
1165 ; CHECK: .functype load_sext_v4i32 (i32) -> (v128)
1166 ; CHECK-NEXT: # %bb.0:
1167 ; CHECK-NEXT: local.get 0
1168 ; CHECK-NEXT: i32x4.load16x4_s 0
1169 ; CHECK-NEXT: # fallthrough-return
1170 %v = load <4 x i16>, <4 x i16>* %p
1171 %v2 = sext <4 x i16> %v to <4 x i32>
1175 define <4 x i32> @load_zext_v4i32(<4 x i16>* %p) {
1176 ; CHECK-LABEL: load_zext_v4i32:
1177 ; CHECK: .functype load_zext_v4i32 (i32) -> (v128)
1178 ; CHECK-NEXT: # %bb.0:
1179 ; CHECK-NEXT: local.get 0
1180 ; CHECK-NEXT: i32x4.load16x4_u 0
1181 ; CHECK-NEXT: # fallthrough-return
1182 %v = load <4 x i16>, <4 x i16>* %p
1183 %v2 = zext <4 x i16> %v to <4 x i32>
1187 define <4 x i16> @load_ext_v4i32(<4 x i16>* %p) {
1188 ; CHECK-LABEL: load_ext_v4i32:
1189 ; CHECK: .functype load_ext_v4i32 (i32) -> (v128)
1190 ; CHECK-NEXT: # %bb.0:
1191 ; CHECK-NEXT: local.get 0
1192 ; CHECK-NEXT: v128.load64_zero 0
1193 ; CHECK-NEXT: # fallthrough-return
1194 %v = load <4 x i16>, <4 x i16>* %p
1198 define <4 x i32> @load_v4i32_with_folded_offset(<4 x i32>* %p) {
1199 ; CHECK-LABEL: load_v4i32_with_folded_offset:
1200 ; CHECK: .functype load_v4i32_with_folded_offset (i32) -> (v128)
1201 ; CHECK-NEXT: # %bb.0:
1202 ; CHECK-NEXT: local.get 0
1203 ; CHECK-NEXT: v128.load 16
1204 ; CHECK-NEXT: # fallthrough-return
1205 %q = ptrtoint <4 x i32>* %p to i32
1206 %r = add nuw i32 %q, 16
1207 %s = inttoptr i32 %r to <4 x i32>*
1208 %v = load <4 x i32>, <4 x i32>* %s
1212 define <4 x i32> @load_splat_v4i32_with_folded_offset(i32* %p) {
1213 ; CHECK-LABEL: load_splat_v4i32_with_folded_offset:
1214 ; CHECK: .functype load_splat_v4i32_with_folded_offset (i32) -> (v128)
1215 ; CHECK-NEXT: # %bb.0:
1216 ; CHECK-NEXT: local.get 0
1217 ; CHECK-NEXT: v128.load32_splat 16
1218 ; CHECK-NEXT: # fallthrough-return
1219 %q = ptrtoint i32* %p to i32
1220 %r = add nuw i32 %q, 16
1221 %s = inttoptr i32 %r to i32*
1222 %e = load i32, i32* %s
1223 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1224 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1228 define <4 x i32> @load_sext_v4i32_with_folded_offset(<4 x i16>* %p) {
1229 ; CHECK-LABEL: load_sext_v4i32_with_folded_offset:
1230 ; CHECK: .functype load_sext_v4i32_with_folded_offset (i32) -> (v128)
1231 ; CHECK-NEXT: # %bb.0:
1232 ; CHECK-NEXT: local.get 0
1233 ; CHECK-NEXT: i32x4.load16x4_s 16
1234 ; CHECK-NEXT: # fallthrough-return
1235 %q = ptrtoint <4 x i16>* %p to i32
1236 %r = add nuw i32 %q, 16
1237 %s = inttoptr i32 %r to <4 x i16>*
1238 %v = load <4 x i16>, <4 x i16>* %s
1239 %v2 = sext <4 x i16> %v to <4 x i32>
1243 define <4 x i32> @load_zext_v4i32_with_folded_offset(<4 x i16>* %p) {
1244 ; CHECK-LABEL: load_zext_v4i32_with_folded_offset:
1245 ; CHECK: .functype load_zext_v4i32_with_folded_offset (i32) -> (v128)
1246 ; CHECK-NEXT: # %bb.0:
1247 ; CHECK-NEXT: local.get 0
1248 ; CHECK-NEXT: i32x4.load16x4_u 16
1249 ; CHECK-NEXT: # fallthrough-return
1250 %q = ptrtoint <4 x i16>* %p to i32
1251 %r = add nuw i32 %q, 16
1252 %s = inttoptr i32 %r to <4 x i16>*
1253 %v = load <4 x i16>, <4 x i16>* %s
1254 %v2 = zext <4 x i16> %v to <4 x i32>
1258 define <4 x i16> @load_ext_v4i32_with_folded_offset(<4 x i16>* %p) {
1259 ; CHECK-LABEL: load_ext_v4i32_with_folded_offset:
1260 ; CHECK: .functype load_ext_v4i32_with_folded_offset (i32) -> (v128)
1261 ; CHECK-NEXT: # %bb.0:
1262 ; CHECK-NEXT: local.get 0
1263 ; CHECK-NEXT: v128.load64_zero 16
1264 ; CHECK-NEXT: # fallthrough-return
1265 %q = ptrtoint <4 x i16>* %p to i32
1266 %r = add nuw i32 %q, 16
1267 %s = inttoptr i32 %r to <4 x i16>*
1268 %v = load <4 x i16>, <4 x i16>* %s
1272 define <4 x i32> @load_v4i32_with_folded_gep_offset(<4 x i32>* %p) {
1273 ; CHECK-LABEL: load_v4i32_with_folded_gep_offset:
1274 ; CHECK: .functype load_v4i32_with_folded_gep_offset (i32) -> (v128)
1275 ; CHECK-NEXT: # %bb.0:
1276 ; CHECK-NEXT: local.get 0
1277 ; CHECK-NEXT: v128.load 16
1278 ; CHECK-NEXT: # fallthrough-return
1279 %s = getelementptr inbounds <4 x i32>, <4 x i32>* %p, i32 1
1280 %v = load <4 x i32>, <4 x i32>* %s
1284 define <4 x i32> @load_splat_v4i32_with_folded_gep_offset(i32* %p) {
1285 ; CHECK-LABEL: load_splat_v4i32_with_folded_gep_offset:
1286 ; CHECK: .functype load_splat_v4i32_with_folded_gep_offset (i32) -> (v128)
1287 ; CHECK-NEXT: # %bb.0:
1288 ; CHECK-NEXT: local.get 0
1289 ; CHECK-NEXT: v128.load32_splat 4
1290 ; CHECK-NEXT: # fallthrough-return
1291 %s = getelementptr inbounds i32, i32* %p, i32 1
1292 %e = load i32, i32* %s
1293 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1294 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1298 define <4 x i32> @load_sext_v4i32_with_folded_gep_offset(<4 x i16>* %p) {
1299 ; CHECK-LABEL: load_sext_v4i32_with_folded_gep_offset:
1300 ; CHECK: .functype load_sext_v4i32_with_folded_gep_offset (i32) -> (v128)
1301 ; CHECK-NEXT: # %bb.0:
1302 ; CHECK-NEXT: local.get 0
1303 ; CHECK-NEXT: i32x4.load16x4_s 8
1304 ; CHECK-NEXT: # fallthrough-return
1305 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 1
1306 %v = load <4 x i16>, <4 x i16>* %s
1307 %v2 = sext <4 x i16> %v to <4 x i32>
1311 define <4 x i32> @load_zext_v4i32_with_folded_gep_offset(<4 x i16>* %p) {
1312 ; CHECK-LABEL: load_zext_v4i32_with_folded_gep_offset:
1313 ; CHECK: .functype load_zext_v4i32_with_folded_gep_offset (i32) -> (v128)
1314 ; CHECK-NEXT: # %bb.0:
1315 ; CHECK-NEXT: local.get 0
1316 ; CHECK-NEXT: i32x4.load16x4_u 8
1317 ; CHECK-NEXT: # fallthrough-return
1318 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 1
1319 %v = load <4 x i16>, <4 x i16>* %s
1320 %v2 = zext <4 x i16> %v to <4 x i32>
1324 define <4 x i16> @load_ext_v4i32_with_folded_gep_offset(<4 x i16>* %p) {
1325 ; CHECK-LABEL: load_ext_v4i32_with_folded_gep_offset:
1326 ; CHECK: .functype load_ext_v4i32_with_folded_gep_offset (i32) -> (v128)
1327 ; CHECK-NEXT: # %bb.0:
1328 ; CHECK-NEXT: local.get 0
1329 ; CHECK-NEXT: v128.load64_zero 8
1330 ; CHECK-NEXT: # fallthrough-return
1331 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 1
1332 %v = load <4 x i16>, <4 x i16>* %s
1336 define <4 x i32> @load_v4i32_with_unfolded_gep_negative_offset(<4 x i32>* %p) {
1337 ; CHECK-LABEL: load_v4i32_with_unfolded_gep_negative_offset:
1338 ; CHECK: .functype load_v4i32_with_unfolded_gep_negative_offset (i32) -> (v128)
1339 ; CHECK-NEXT: # %bb.0:
1340 ; CHECK-NEXT: local.get 0
1341 ; CHECK-NEXT: i32.const -16
1342 ; CHECK-NEXT: i32.add
1343 ; CHECK-NEXT: v128.load 0
1344 ; CHECK-NEXT: # fallthrough-return
1345 %s = getelementptr inbounds <4 x i32>, <4 x i32>* %p, i32 -1
1346 %v = load <4 x i32>, <4 x i32>* %s
1350 define <4 x i32> @load_splat_v4i32_with_unfolded_gep_negative_offset(i32* %p) {
1351 ; CHECK-LABEL: load_splat_v4i32_with_unfolded_gep_negative_offset:
1352 ; CHECK: .functype load_splat_v4i32_with_unfolded_gep_negative_offset (i32) -> (v128)
1353 ; CHECK-NEXT: # %bb.0:
1354 ; CHECK-NEXT: local.get 0
1355 ; CHECK-NEXT: i32.const -4
1356 ; CHECK-NEXT: i32.add
1357 ; CHECK-NEXT: v128.load32_splat 0
1358 ; CHECK-NEXT: # fallthrough-return
1359 %s = getelementptr inbounds i32, i32* %p, i32 -1
1360 %e = load i32, i32* %s
1361 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1362 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1366 define <4 x i32> @load_sext_v4i32_with_unfolded_gep_negative_offset(<4 x i16>* %p) {
1367 ; CHECK-LABEL: load_sext_v4i32_with_unfolded_gep_negative_offset:
1368 ; CHECK: .functype load_sext_v4i32_with_unfolded_gep_negative_offset (i32) -> (v128)
1369 ; CHECK-NEXT: # %bb.0:
1370 ; CHECK-NEXT: local.get 0
1371 ; CHECK-NEXT: i32.const -8
1372 ; CHECK-NEXT: i32.add
1373 ; CHECK-NEXT: i32x4.load16x4_s 0
1374 ; CHECK-NEXT: # fallthrough-return
1375 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 -1
1376 %v = load <4 x i16>, <4 x i16>* %s
1377 %v2 = sext <4 x i16> %v to <4 x i32>
1381 define <4 x i32> @load_zext_v4i32_with_unfolded_gep_negative_offset(<4 x i16>* %p) {
1382 ; CHECK-LABEL: load_zext_v4i32_with_unfolded_gep_negative_offset:
1383 ; CHECK: .functype load_zext_v4i32_with_unfolded_gep_negative_offset (i32) -> (v128)
1384 ; CHECK-NEXT: # %bb.0:
1385 ; CHECK-NEXT: local.get 0
1386 ; CHECK-NEXT: i32.const -8
1387 ; CHECK-NEXT: i32.add
1388 ; CHECK-NEXT: i32x4.load16x4_u 0
1389 ; CHECK-NEXT: # fallthrough-return
1390 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 -1
1391 %v = load <4 x i16>, <4 x i16>* %s
1392 %v2 = zext <4 x i16> %v to <4 x i32>
1396 define <4 x i16> @load_ext_v4i32_with_unfolded_gep_negative_offset(<4 x i16>* %p) {
1397 ; CHECK-LABEL: load_ext_v4i32_with_unfolded_gep_negative_offset:
1398 ; CHECK: .functype load_ext_v4i32_with_unfolded_gep_negative_offset (i32) -> (v128)
1399 ; CHECK-NEXT: # %bb.0:
1400 ; CHECK-NEXT: local.get 0
1401 ; CHECK-NEXT: i32.const -8
1402 ; CHECK-NEXT: i32.add
1403 ; CHECK-NEXT: v128.load64_zero 0
1404 ; CHECK-NEXT: # fallthrough-return
1405 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 -1
1406 %v = load <4 x i16>, <4 x i16>* %s
1410 define <4 x i32> @load_v4i32_with_unfolded_offset(<4 x i32>* %p) {
1411 ; CHECK-LABEL: load_v4i32_with_unfolded_offset:
1412 ; CHECK: .functype load_v4i32_with_unfolded_offset (i32) -> (v128)
1413 ; CHECK-NEXT: # %bb.0:
1414 ; CHECK-NEXT: local.get 0
1415 ; CHECK-NEXT: i32.const 16
1416 ; CHECK-NEXT: i32.add
1417 ; CHECK-NEXT: v128.load 0
1418 ; CHECK-NEXT: # fallthrough-return
1419 %q = ptrtoint <4 x i32>* %p to i32
1420 %r = add nsw i32 %q, 16
1421 %s = inttoptr i32 %r to <4 x i32>*
1422 %v = load <4 x i32>, <4 x i32>* %s
1426 define <4 x i32> @load_splat_v4i32_with_unfolded_offset(i32* %p) {
1427 ; CHECK-LABEL: load_splat_v4i32_with_unfolded_offset:
1428 ; CHECK: .functype load_splat_v4i32_with_unfolded_offset (i32) -> (v128)
1429 ; CHECK-NEXT: # %bb.0:
1430 ; CHECK-NEXT: local.get 0
1431 ; CHECK-NEXT: i32.const 16
1432 ; CHECK-NEXT: i32.add
1433 ; CHECK-NEXT: v128.load32_splat 0
1434 ; CHECK-NEXT: # fallthrough-return
1435 %q = ptrtoint i32* %p to i32
1436 %r = add nsw i32 %q, 16
1437 %s = inttoptr i32 %r to i32*
1438 %e = load i32, i32* %s
1439 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1440 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1444 define <4 x i32> @load_sext_v4i32_with_unfolded_offset(<4 x i16>* %p) {
1445 ; CHECK-LABEL: load_sext_v4i32_with_unfolded_offset:
1446 ; CHECK: .functype load_sext_v4i32_with_unfolded_offset (i32) -> (v128)
1447 ; CHECK-NEXT: # %bb.0:
1448 ; CHECK-NEXT: local.get 0
1449 ; CHECK-NEXT: i32.const 16
1450 ; CHECK-NEXT: i32.add
1451 ; CHECK-NEXT: i32x4.load16x4_s 0
1452 ; CHECK-NEXT: # fallthrough-return
1453 %q = ptrtoint <4 x i16>* %p to i32
1454 %r = add nsw i32 %q, 16
1455 %s = inttoptr i32 %r to <4 x i16>*
1456 %v = load <4 x i16>, <4 x i16>* %s
1457 %v2 = sext <4 x i16> %v to <4 x i32>
1461 define <4 x i32> @load_zext_v4i32_with_unfolded_offset(<4 x i16>* %p) {
1462 ; CHECK-LABEL: load_zext_v4i32_with_unfolded_offset:
1463 ; CHECK: .functype load_zext_v4i32_with_unfolded_offset (i32) -> (v128)
1464 ; CHECK-NEXT: # %bb.0:
1465 ; CHECK-NEXT: local.get 0
1466 ; CHECK-NEXT: i32.const 16
1467 ; CHECK-NEXT: i32.add
1468 ; CHECK-NEXT: i32x4.load16x4_u 0
1469 ; CHECK-NEXT: # fallthrough-return
1470 %q = ptrtoint <4 x i16>* %p to i32
1471 %r = add nsw i32 %q, 16
1472 %s = inttoptr i32 %r to <4 x i16>*
1473 %v = load <4 x i16>, <4 x i16>* %s
1474 %v2 = zext <4 x i16> %v to <4 x i32>
1478 define <4 x i16> @load_ext_v4i32_with_unfolded_offset(<4 x i16>* %p) {
1479 ; CHECK-LABEL: load_ext_v4i32_with_unfolded_offset:
1480 ; CHECK: .functype load_ext_v4i32_with_unfolded_offset (i32) -> (v128)
1481 ; CHECK-NEXT: # %bb.0:
1482 ; CHECK-NEXT: local.get 0
1483 ; CHECK-NEXT: i32.const 16
1484 ; CHECK-NEXT: i32.add
1485 ; CHECK-NEXT: v128.load64_zero 0
1486 ; CHECK-NEXT: # fallthrough-return
1487 %q = ptrtoint <4 x i16>* %p to i32
1488 %r = add nsw i32 %q, 16
1489 %s = inttoptr i32 %r to <4 x i16>*
1490 %v = load <4 x i16>, <4 x i16>* %s
1494 define <4 x i32> @load_v4i32_with_unfolded_gep_offset(<4 x i32>* %p) {
1495 ; CHECK-LABEL: load_v4i32_with_unfolded_gep_offset:
1496 ; CHECK: .functype load_v4i32_with_unfolded_gep_offset (i32) -> (v128)
1497 ; CHECK-NEXT: # %bb.0:
1498 ; CHECK-NEXT: local.get 0
1499 ; CHECK-NEXT: i32.const 16
1500 ; CHECK-NEXT: i32.add
1501 ; CHECK-NEXT: v128.load 0
1502 ; CHECK-NEXT: # fallthrough-return
1503 %s = getelementptr <4 x i32>, <4 x i32>* %p, i32 1
1504 %v = load <4 x i32>, <4 x i32>* %s
1508 define <4 x i32> @load_splat_v4i32_with_unfolded_gep_offset(i32* %p) {
1509 ; CHECK-LABEL: load_splat_v4i32_with_unfolded_gep_offset:
1510 ; CHECK: .functype load_splat_v4i32_with_unfolded_gep_offset (i32) -> (v128)
1511 ; CHECK-NEXT: # %bb.0:
1512 ; CHECK-NEXT: local.get 0
1513 ; CHECK-NEXT: i32.const 4
1514 ; CHECK-NEXT: i32.add
1515 ; CHECK-NEXT: v128.load32_splat 0
1516 ; CHECK-NEXT: # fallthrough-return
1517 %s = getelementptr i32, i32* %p, i32 1
1518 %e = load i32, i32* %s
1519 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1520 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1524 define <4 x i32> @load_sext_v4i32_with_unfolded_gep_offset(<4 x i16>* %p) {
1525 ; CHECK-LABEL: load_sext_v4i32_with_unfolded_gep_offset:
1526 ; CHECK: .functype load_sext_v4i32_with_unfolded_gep_offset (i32) -> (v128)
1527 ; CHECK-NEXT: # %bb.0:
1528 ; CHECK-NEXT: local.get 0
1529 ; CHECK-NEXT: i32.const 8
1530 ; CHECK-NEXT: i32.add
1531 ; CHECK-NEXT: i32x4.load16x4_s 0
1532 ; CHECK-NEXT: # fallthrough-return
1533 %s = getelementptr <4 x i16>, <4 x i16>* %p, i32 1
1534 %v = load <4 x i16>, <4 x i16>* %s
1535 %v2 = sext <4 x i16> %v to <4 x i32>
1539 define <4 x i32> @load_zext_v4i32_with_unfolded_gep_offset(<4 x i16>* %p) {
1540 ; CHECK-LABEL: load_zext_v4i32_with_unfolded_gep_offset:
1541 ; CHECK: .functype load_zext_v4i32_with_unfolded_gep_offset (i32) -> (v128)
1542 ; CHECK-NEXT: # %bb.0:
1543 ; CHECK-NEXT: local.get 0
1544 ; CHECK-NEXT: i32.const 8
1545 ; CHECK-NEXT: i32.add
1546 ; CHECK-NEXT: i32x4.load16x4_u 0
1547 ; CHECK-NEXT: # fallthrough-return
1548 %s = getelementptr <4 x i16>, <4 x i16>* %p, i32 1
1549 %v = load <4 x i16>, <4 x i16>* %s
1550 %v2 = zext <4 x i16> %v to <4 x i32>
1554 define <4 x i16> @load_ext_v4i32_with_unfolded_gep_offset(<4 x i16>* %p) {
1555 ; CHECK-LABEL: load_ext_v4i32_with_unfolded_gep_offset:
1556 ; CHECK: .functype load_ext_v4i32_with_unfolded_gep_offset (i32) -> (v128)
1557 ; CHECK-NEXT: # %bb.0:
1558 ; CHECK-NEXT: local.get 0
1559 ; CHECK-NEXT: i32.const 8
1560 ; CHECK-NEXT: i32.add
1561 ; CHECK-NEXT: v128.load64_zero 0
1562 ; CHECK-NEXT: # fallthrough-return
1563 %s = getelementptr <4 x i16>, <4 x i16>* %p, i32 1
1564 %v = load <4 x i16>, <4 x i16>* %s
1568 define <4 x i32> @load_v4i32_from_numeric_address() {
1569 ; CHECK-LABEL: load_v4i32_from_numeric_address:
1570 ; CHECK: .functype load_v4i32_from_numeric_address () -> (v128)
1571 ; CHECK-NEXT: # %bb.0:
1572 ; CHECK-NEXT: i32.const 0
1573 ; CHECK-NEXT: v128.load 32
1574 ; CHECK-NEXT: # fallthrough-return
1575 %s = inttoptr i32 32 to <4 x i32>*
1576 %v = load <4 x i32>, <4 x i32>* %s
1580 define <4 x i32> @load_splat_v4i32_from_numeric_address() {
1581 ; CHECK-LABEL: load_splat_v4i32_from_numeric_address:
1582 ; CHECK: .functype load_splat_v4i32_from_numeric_address () -> (v128)
1583 ; CHECK-NEXT: # %bb.0:
1584 ; CHECK-NEXT: i32.const 0
1585 ; CHECK-NEXT: v128.load32_splat 32
1586 ; CHECK-NEXT: # fallthrough-return
1587 %s = inttoptr i32 32 to i32*
1588 %e = load i32, i32* %s
1589 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1590 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1594 define <4 x i32> @load_sext_v4i32_from_numeric_address() {
1595 ; CHECK-LABEL: load_sext_v4i32_from_numeric_address:
1596 ; CHECK: .functype load_sext_v4i32_from_numeric_address () -> (v128)
1597 ; CHECK-NEXT: # %bb.0:
1598 ; CHECK-NEXT: i32.const 0
1599 ; CHECK-NEXT: i32x4.load16x4_s 32
1600 ; CHECK-NEXT: # fallthrough-return
1601 %s = inttoptr i32 32 to <4 x i16>*
1602 %v = load <4 x i16>, <4 x i16>* %s
1603 %v2 = sext <4 x i16> %v to <4 x i32>
1607 define <4 x i32> @load_zext_v4i32_from_numeric_address() {
1608 ; CHECK-LABEL: load_zext_v4i32_from_numeric_address:
1609 ; CHECK: .functype load_zext_v4i32_from_numeric_address () -> (v128)
1610 ; CHECK-NEXT: # %bb.0:
1611 ; CHECK-NEXT: i32.const 0
1612 ; CHECK-NEXT: i32x4.load16x4_u 32
1613 ; CHECK-NEXT: # fallthrough-return
1614 %s = inttoptr i32 32 to <4 x i16>*
1615 %v = load <4 x i16>, <4 x i16>* %s
1616 %v2 = zext <4 x i16> %v to <4 x i32>
1620 define <4 x i16> @load_ext_v4i32_from_numeric_address() {
1621 ; CHECK-LABEL: load_ext_v4i32_from_numeric_address:
1622 ; CHECK: .functype load_ext_v4i32_from_numeric_address () -> (v128)
1623 ; CHECK-NEXT: # %bb.0:
1624 ; CHECK-NEXT: i32.const 0
1625 ; CHECK-NEXT: v128.load64_zero 32
1626 ; CHECK-NEXT: # fallthrough-return
1627 %s = inttoptr i32 32 to <4 x i16>*
1628 %v = load <4 x i16>, <4 x i16>* %s
1632 @gv_v4i32 = global <4 x i32> <i32 42, i32 42, i32 42, i32 42>
1633 define <4 x i32> @load_v4i32_from_global_address() {
1634 ; CHECK-LABEL: load_v4i32_from_global_address:
1635 ; CHECK: .functype load_v4i32_from_global_address () -> (v128)
1636 ; CHECK-NEXT: # %bb.0:
1637 ; CHECK-NEXT: i32.const 0
1638 ; CHECK-NEXT: v128.load gv_v4i32
1639 ; CHECK-NEXT: # fallthrough-return
1640 %v = load <4 x i32>, <4 x i32>* @gv_v4i32
1644 @gv_i32 = global i32 42
1645 define <4 x i32> @load_splat_v4i32_from_global_address() {
1646 ; CHECK-LABEL: load_splat_v4i32_from_global_address:
1647 ; CHECK: .functype load_splat_v4i32_from_global_address () -> (v128)
1648 ; CHECK-NEXT: # %bb.0:
1649 ; CHECK-NEXT: i32.const 0
1650 ; CHECK-NEXT: v128.load32_splat gv_i32
1651 ; CHECK-NEXT: # fallthrough-return
1652 %e = load i32, i32* @gv_i32
1653 %v1 = insertelement <4 x i32> undef, i32 %e, i32 0
1654 %v2 = shufflevector <4 x i32> %v1, <4 x i32> undef, <4 x i32> zeroinitializer
1658 @gv_v4i16 = global <4 x i16> <i16 42, i16 42, i16 42, i16 42>
1659 define <4 x i32> @load_sext_v4i32_from_global_address() {
1660 ; CHECK-LABEL: load_sext_v4i32_from_global_address:
1661 ; CHECK: .functype load_sext_v4i32_from_global_address () -> (v128)
1662 ; CHECK-NEXT: # %bb.0:
1663 ; CHECK-NEXT: i32.const 0
1664 ; CHECK-NEXT: i32x4.load16x4_s gv_v4i16
1665 ; CHECK-NEXT: # fallthrough-return
1666 %v = load <4 x i16>, <4 x i16>* @gv_v4i16
1667 %v2 = sext <4 x i16> %v to <4 x i32>
1671 define <4 x i32> @load_zext_v4i32_from_global_address() {
1672 ; CHECK-LABEL: load_zext_v4i32_from_global_address:
1673 ; CHECK: .functype load_zext_v4i32_from_global_address () -> (v128)
1674 ; CHECK-NEXT: # %bb.0:
1675 ; CHECK-NEXT: i32.const 0
1676 ; CHECK-NEXT: i32x4.load16x4_u gv_v4i16
1677 ; CHECK-NEXT: # fallthrough-return
1678 %v = load <4 x i16>, <4 x i16>* @gv_v4i16
1679 %v2 = zext <4 x i16> %v to <4 x i32>
1683 define <4 x i16> @load_ext_v4i32_from_global_address() {
1684 ; CHECK-LABEL: load_ext_v4i32_from_global_address:
1685 ; CHECK: .functype load_ext_v4i32_from_global_address () -> (v128)
1686 ; CHECK-NEXT: # %bb.0:
1687 ; CHECK-NEXT: i32.const 0
1688 ; CHECK-NEXT: v128.load64_zero gv_v4i16
1689 ; CHECK-NEXT: # fallthrough-return
1690 %v = load <4 x i16>, <4 x i16>* @gv_v4i16
1694 define void @store_v4i32(<4 x i32> %v, <4 x i32>* %p) {
1695 ; CHECK-LABEL: store_v4i32:
1696 ; CHECK: .functype store_v4i32 (v128, i32) -> ()
1697 ; CHECK-NEXT: # %bb.0:
1698 ; CHECK-NEXT: local.get 1
1699 ; CHECK-NEXT: local.get 0
1700 ; CHECK-NEXT: v128.store 0
1701 ; CHECK-NEXT: # fallthrough-return
1702 store <4 x i32> %v , <4 x i32>* %p
1706 define void @store_narrowing_v4i32(<4 x i16> %v, <4 x i16>* %p) {
1707 ; CHECK-LABEL: store_narrowing_v4i32:
1708 ; CHECK: .functype store_narrowing_v4i32 (v128, i32) -> ()
1709 ; CHECK-NEXT: # %bb.0:
1710 ; CHECK-NEXT: local.get 1
1711 ; CHECK-NEXT: local.get 0
1712 ; CHECK-NEXT: v128.store64_lane 0, 0
1713 ; CHECK-NEXT: # fallthrough-return
1714 store <4 x i16> %v , <4 x i16>* %p
1718 define void @store_v4i32_with_folded_offset(<4 x i32> %v, <4 x i32>* %p) {
1719 ; CHECK-LABEL: store_v4i32_with_folded_offset:
1720 ; CHECK: .functype store_v4i32_with_folded_offset (v128, i32) -> ()
1721 ; CHECK-NEXT: # %bb.0:
1722 ; CHECK-NEXT: local.get 1
1723 ; CHECK-NEXT: local.get 0
1724 ; CHECK-NEXT: v128.store 16
1725 ; CHECK-NEXT: # fallthrough-return
1726 %q = ptrtoint <4 x i32>* %p to i32
1727 %r = add nuw i32 %q, 16
1728 %s = inttoptr i32 %r to <4 x i32>*
1729 store <4 x i32> %v , <4 x i32>* %s
1733 define void @store_narrowing_v4i32_with_folded_offset(<4 x i16> %v, <4 x i16>* %p) {
1734 ; CHECK-LABEL: store_narrowing_v4i32_with_folded_offset:
1735 ; CHECK: .functype store_narrowing_v4i32_with_folded_offset (v128, i32) -> ()
1736 ; CHECK-NEXT: # %bb.0:
1737 ; CHECK-NEXT: local.get 1
1738 ; CHECK-NEXT: i32.const 16
1739 ; CHECK-NEXT: i32.add
1740 ; CHECK-NEXT: local.get 0
1741 ; CHECK-NEXT: v128.store64_lane 0, 0
1742 ; CHECK-NEXT: # fallthrough-return
1743 %q = ptrtoint <4 x i16>* %p to i32
1744 %r = add nuw i32 %q, 16
1745 %s = inttoptr i32 %r to <4 x i16>*
1746 store <4 x i16> %v , <4 x i16>* %s
1750 define void @store_v4i32_with_folded_gep_offset(<4 x i32> %v, <4 x i32>* %p) {
1751 ; CHECK-LABEL: store_v4i32_with_folded_gep_offset:
1752 ; CHECK: .functype store_v4i32_with_folded_gep_offset (v128, i32) -> ()
1753 ; CHECK-NEXT: # %bb.0:
1754 ; CHECK-NEXT: local.get 1
1755 ; CHECK-NEXT: local.get 0
1756 ; CHECK-NEXT: v128.store 16
1757 ; CHECK-NEXT: # fallthrough-return
1758 %s = getelementptr inbounds <4 x i32>, <4 x i32>* %p, i32 1
1759 store <4 x i32> %v , <4 x i32>* %s
1763 define void @store_narrowing_v4i32_with_folded_gep_offset(<4 x i16> %v, <4 x i16>* %p) {
1764 ; CHECK-LABEL: store_narrowing_v4i32_with_folded_gep_offset:
1765 ; CHECK: .functype store_narrowing_v4i32_with_folded_gep_offset (v128, i32) -> ()
1766 ; CHECK-NEXT: # %bb.0:
1767 ; CHECK-NEXT: local.get 1
1768 ; CHECK-NEXT: i32.const 8
1769 ; CHECK-NEXT: i32.add
1770 ; CHECK-NEXT: local.get 0
1771 ; CHECK-NEXT: v128.store64_lane 0, 0
1772 ; CHECK-NEXT: # fallthrough-return
1773 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 1
1774 store <4 x i16> %v , <4 x i16>* %s
1778 define void @store_v4i32_with_unfolded_gep_negative_offset(<4 x i32> %v, <4 x i32>* %p) {
1779 ; CHECK-LABEL: store_v4i32_with_unfolded_gep_negative_offset:
1780 ; CHECK: .functype store_v4i32_with_unfolded_gep_negative_offset (v128, i32) -> ()
1781 ; CHECK-NEXT: # %bb.0:
1782 ; CHECK-NEXT: local.get 1
1783 ; CHECK-NEXT: i32.const -16
1784 ; CHECK-NEXT: i32.add
1785 ; CHECK-NEXT: local.get 0
1786 ; CHECK-NEXT: v128.store 0
1787 ; CHECK-NEXT: # fallthrough-return
1788 %s = getelementptr inbounds <4 x i32>, <4 x i32>* %p, i32 -1
1789 store <4 x i32> %v , <4 x i32>* %s
1793 define void @store_narrowing_v4i32_with_unfolded_gep_negative_offset(<4 x i16> %v, <4 x i16>* %p) {
1794 ; CHECK-LABEL: store_narrowing_v4i32_with_unfolded_gep_negative_offset:
1795 ; CHECK: .functype store_narrowing_v4i32_with_unfolded_gep_negative_offset (v128, i32) -> ()
1796 ; CHECK-NEXT: # %bb.0:
1797 ; CHECK-NEXT: local.get 1
1798 ; CHECK-NEXT: i32.const -8
1799 ; CHECK-NEXT: i32.add
1800 ; CHECK-NEXT: local.get 0
1801 ; CHECK-NEXT: v128.store64_lane 0, 0
1802 ; CHECK-NEXT: # fallthrough-return
1803 %s = getelementptr inbounds <4 x i16>, <4 x i16>* %p, i32 -1
1804 store <4 x i16> %v , <4 x i16>* %s
1808 define void @store_v4i32_with_unfolded_offset(<4 x i32> %v, <4 x i32>* %p) {
1809 ; CHECK-LABEL: store_v4i32_with_unfolded_offset:
1810 ; CHECK: .functype store_v4i32_with_unfolded_offset (v128, i32) -> ()
1811 ; CHECK-NEXT: # %bb.0:
1812 ; CHECK-NEXT: local.get 1
1813 ; CHECK-NEXT: i32.const 16
1814 ; CHECK-NEXT: i32.add
1815 ; CHECK-NEXT: local.get 0
1816 ; CHECK-NEXT: v128.store 0
1817 ; CHECK-NEXT: # fallthrough-return
1818 %q = ptrtoint <4 x i32>* %p to i32
1819 %r = add nsw i32 %q, 16
1820 %s = inttoptr i32 %r to <4 x i32>*
1821 store <4 x i32> %v , <4 x i32>* %s
1825 define void @store_narrowing_v4i32_with_unfolded_offset(<4 x i16> %v, <4 x i16>* %p) {
1826 ; CHECK-LABEL: store_narrowing_v4i32_with_unfolded_offset:
1827 ; CHECK: .functype store_narrowing_v4i32_with_unfolded_offset (v128, i32) -> ()
1828 ; CHECK-NEXT: # %bb.0:
1829 ; CHECK-NEXT: local.get 1
1830 ; CHECK-NEXT: i32.const 16
1831 ; CHECK-NEXT: i32.add
1832 ; CHECK-NEXT: local.get 0
1833 ; CHECK-NEXT: v128.store64_lane 0, 0
1834 ; CHECK-NEXT: # fallthrough-return
1835 %q = ptrtoint <4 x i16>* %p to i32
1836 %r = add nsw i32 %q, 16
1837 %s = inttoptr i32 %r to <4 x i16>*
1838 store <4 x i16> %v , <4 x i16>* %s
1842 define void @store_v4i32_with_unfolded_gep_offset(<4 x i32> %v, <4 x i32>* %p) {
1843 ; CHECK-LABEL: store_v4i32_with_unfolded_gep_offset:
1844 ; CHECK: .functype store_v4i32_with_unfolded_gep_offset (v128, i32) -> ()
1845 ; CHECK-NEXT: # %bb.0:
1846 ; CHECK-NEXT: local.get 1
1847 ; CHECK-NEXT: i32.const 16
1848 ; CHECK-NEXT: i32.add
1849 ; CHECK-NEXT: local.get 0
1850 ; CHECK-NEXT: v128.store 0
1851 ; CHECK-NEXT: # fallthrough-return
1852 %s = getelementptr <4 x i32>, <4 x i32>* %p, i32 1
1853 store <4 x i32> %v , <4 x i32>* %s
1857 define void @store_narrowing_v4i32_with_unfolded_gep_offset(<4 x i16> %v, <4 x i16>* %p) {
1858 ; CHECK-LABEL: store_narrowing_v4i32_with_unfolded_gep_offset:
1859 ; CHECK: .functype store_narrowing_v4i32_with_unfolded_gep_offset (v128, i32) -> ()
1860 ; CHECK-NEXT: # %bb.0:
1861 ; CHECK-NEXT: local.get 1
1862 ; CHECK-NEXT: i32.const 8
1863 ; CHECK-NEXT: i32.add
1864 ; CHECK-NEXT: local.get 0
1865 ; CHECK-NEXT: v128.store64_lane 0, 0
1866 ; CHECK-NEXT: # fallthrough-return
1867 %s = getelementptr <4 x i16>, <4 x i16>* %p, i32 1
1868 store <4 x i16> %v , <4 x i16>* %s
1872 define void @store_v4i32_to_numeric_address(<4 x i32> %v) {
1873 ; CHECK-LABEL: store_v4i32_to_numeric_address:
1874 ; CHECK: .functype store_v4i32_to_numeric_address (v128) -> ()
1875 ; CHECK-NEXT: # %bb.0:
1876 ; CHECK-NEXT: i32.const 0
1877 ; CHECK-NEXT: local.get 0
1878 ; CHECK-NEXT: v128.store 32
1879 ; CHECK-NEXT: # fallthrough-return
1880 %s = inttoptr i32 32 to <4 x i32>*
1881 store <4 x i32> %v , <4 x i32>* %s
1885 define void @store_narrowing_v4i32_to_numeric_address(<4 x i16> %v) {
1886 ; CHECK-LABEL: store_narrowing_v4i32_to_numeric_address:
1887 ; CHECK: .functype store_narrowing_v4i32_to_numeric_address (v128) -> ()
1888 ; CHECK-NEXT: # %bb.0:
1889 ; CHECK-NEXT: i32.const 32
1890 ; CHECK-NEXT: local.get 0
1891 ; CHECK-NEXT: v128.store64_lane 0, 0
1892 ; CHECK-NEXT: # fallthrough-return
1893 %s = inttoptr i32 32 to <4 x i16>*
1894 store <4 x i16> %v , <4 x i16>* %s
1898 define void @store_v4i32_to_global_address(<4 x i32> %v) {
1899 ; CHECK-LABEL: store_v4i32_to_global_address:
1900 ; CHECK: .functype store_v4i32_to_global_address (v128) -> ()
1901 ; CHECK-NEXT: # %bb.0:
1902 ; CHECK-NEXT: i32.const 0
1903 ; CHECK-NEXT: local.get 0
1904 ; CHECK-NEXT: v128.store gv_v4i32
1905 ; CHECK-NEXT: # fallthrough-return
1906 store <4 x i32> %v , <4 x i32>* @gv_v4i32
1910 define void @store_narrowing_v4i32_to_global_address(<4 x i16> %v) {
1911 ; CHECK-LABEL: store_narrowing_v4i32_to_global_address:
1912 ; CHECK: .functype store_narrowing_v4i32_to_global_address (v128) -> ()
1913 ; CHECK-NEXT: # %bb.0:
1914 ; CHECK-NEXT: i32.const gv_v4i16
1915 ; CHECK-NEXT: local.get 0
1916 ; CHECK-NEXT: v128.store64_lane 0, 0
1917 ; CHECK-NEXT: # fallthrough-return
1918 store <4 x i16> %v , <4 x i16>* @gv_v4i16
1922 ; ==============================================================================
1924 ; ==============================================================================
1925 define <2 x i64> @load_v2i64(<2 x i64>* %p) {
1926 ; CHECK-LABEL: load_v2i64:
1927 ; CHECK: .functype load_v2i64 (i32) -> (v128)
1928 ; CHECK-NEXT: # %bb.0:
1929 ; CHECK-NEXT: local.get 0
1930 ; CHECK-NEXT: v128.load 0
1931 ; CHECK-NEXT: # fallthrough-return
1932 %v = load <2 x i64>, <2 x i64>* %p
1936 define <2 x i64> @load_splat_v2i64(i64* %p) {
1937 ; CHECK-LABEL: load_splat_v2i64:
1938 ; CHECK: .functype load_splat_v2i64 (i32) -> (v128)
1939 ; CHECK-NEXT: # %bb.0:
1940 ; CHECK-NEXT: local.get 0
1941 ; CHECK-NEXT: v128.load64_splat 0
1942 ; CHECK-NEXT: # fallthrough-return
1943 %e = load i64, i64* %p
1944 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
1945 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
1949 define <2 x i64> @load_sext_v2i64(<2 x i32>* %p) {
1950 ; CHECK-LABEL: load_sext_v2i64:
1951 ; CHECK: .functype load_sext_v2i64 (i32) -> (v128)
1952 ; CHECK-NEXT: # %bb.0:
1953 ; CHECK-NEXT: local.get 0
1954 ; CHECK-NEXT: i64x2.load32x2_s 0
1955 ; CHECK-NEXT: # fallthrough-return
1956 %v = load <2 x i32>, <2 x i32>* %p
1957 %v2 = sext <2 x i32> %v to <2 x i64>
1961 define <2 x i64> @load_zext_v2i64(<2 x i32>* %p) {
1962 ; CHECK-LABEL: load_zext_v2i64:
1963 ; CHECK: .functype load_zext_v2i64 (i32) -> (v128)
1964 ; CHECK-NEXT: # %bb.0:
1965 ; CHECK-NEXT: local.get 0
1966 ; CHECK-NEXT: i64x2.load32x2_u 0
1967 ; CHECK-NEXT: # fallthrough-return
1968 %v = load <2 x i32>, <2 x i32>* %p
1969 %v2 = zext <2 x i32> %v to <2 x i64>
1973 define <2 x i32> @load_ext_v2i64(<2 x i32>* %p) {
1974 ; CHECK-LABEL: load_ext_v2i64:
1975 ; CHECK: .functype load_ext_v2i64 (i32) -> (v128)
1976 ; CHECK-NEXT: # %bb.0:
1977 ; CHECK-NEXT: local.get 0
1978 ; CHECK-NEXT: v128.load64_zero 0
1979 ; CHECK-NEXT: # fallthrough-return
1980 %v = load <2 x i32>, <2 x i32>* %p
1984 define <2 x i64> @load_v2i64_with_folded_offset(<2 x i64>* %p) {
1985 ; CHECK-LABEL: load_v2i64_with_folded_offset:
1986 ; CHECK: .functype load_v2i64_with_folded_offset (i32) -> (v128)
1987 ; CHECK-NEXT: # %bb.0:
1988 ; CHECK-NEXT: local.get 0
1989 ; CHECK-NEXT: v128.load 16
1990 ; CHECK-NEXT: # fallthrough-return
1991 %q = ptrtoint <2 x i64>* %p to i32
1992 %r = add nuw i32 %q, 16
1993 %s = inttoptr i32 %r to <2 x i64>*
1994 %v = load <2 x i64>, <2 x i64>* %s
1998 define <2 x i64> @load_splat_v2i64_with_folded_offset(i64* %p) {
1999 ; CHECK-LABEL: load_splat_v2i64_with_folded_offset:
2000 ; CHECK: .functype load_splat_v2i64_with_folded_offset (i32) -> (v128)
2001 ; CHECK-NEXT: # %bb.0:
2002 ; CHECK-NEXT: local.get 0
2003 ; CHECK-NEXT: v128.load64_splat 16
2004 ; CHECK-NEXT: # fallthrough-return
2005 %q = ptrtoint i64* %p to i32
2006 %r = add nuw i32 %q, 16
2007 %s = inttoptr i32 %r to i64*
2008 %e = load i64, i64* %s
2009 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2010 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2014 define <2 x i64> @load_sext_v2i64_with_folded_offset(<2 x i32>* %p) {
2015 ; CHECK-LABEL: load_sext_v2i64_with_folded_offset:
2016 ; CHECK: .functype load_sext_v2i64_with_folded_offset (i32) -> (v128)
2017 ; CHECK-NEXT: # %bb.0:
2018 ; CHECK-NEXT: local.get 0
2019 ; CHECK-NEXT: i64x2.load32x2_s 16
2020 ; CHECK-NEXT: # fallthrough-return
2021 %q = ptrtoint <2 x i32>* %p to i32
2022 %r = add nuw i32 %q, 16
2023 %s = inttoptr i32 %r to <2 x i32>*
2024 %v = load <2 x i32>, <2 x i32>* %s
2025 %v2 = sext <2 x i32> %v to <2 x i64>
2029 define <2 x i64> @load_zext_v2i64_with_folded_offset(<2 x i32>* %p) {
2030 ; CHECK-LABEL: load_zext_v2i64_with_folded_offset:
2031 ; CHECK: .functype load_zext_v2i64_with_folded_offset (i32) -> (v128)
2032 ; CHECK-NEXT: # %bb.0:
2033 ; CHECK-NEXT: local.get 0
2034 ; CHECK-NEXT: i64x2.load32x2_u 16
2035 ; CHECK-NEXT: # fallthrough-return
2036 %q = ptrtoint <2 x i32>* %p to i32
2037 %r = add nuw i32 %q, 16
2038 %s = inttoptr i32 %r to <2 x i32>*
2039 %v = load <2 x i32>, <2 x i32>* %s
2040 %v2 = zext <2 x i32> %v to <2 x i64>
2044 define <2 x i32> @load_ext_v2i64_with_folded_offset(<2 x i32>* %p) {
2045 ; CHECK-LABEL: load_ext_v2i64_with_folded_offset:
2046 ; CHECK: .functype load_ext_v2i64_with_folded_offset (i32) -> (v128)
2047 ; CHECK-NEXT: # %bb.0:
2048 ; CHECK-NEXT: local.get 0
2049 ; CHECK-NEXT: v128.load64_zero 16
2050 ; CHECK-NEXT: # fallthrough-return
2051 %q = ptrtoint <2 x i32>* %p to i32
2052 %r = add nuw i32 %q, 16
2053 %s = inttoptr i32 %r to <2 x i32>*
2054 %v = load <2 x i32>, <2 x i32>* %s
2058 define <2 x i64> @load_v2i64_with_folded_gep_offset(<2 x i64>* %p) {
2059 ; CHECK-LABEL: load_v2i64_with_folded_gep_offset:
2060 ; CHECK: .functype load_v2i64_with_folded_gep_offset (i32) -> (v128)
2061 ; CHECK-NEXT: # %bb.0:
2062 ; CHECK-NEXT: local.get 0
2063 ; CHECK-NEXT: v128.load 16
2064 ; CHECK-NEXT: # fallthrough-return
2065 %s = getelementptr inbounds <2 x i64>, <2 x i64>* %p, i32 1
2066 %v = load <2 x i64>, <2 x i64>* %s
2070 define <2 x i64> @load_splat_v2i64_with_folded_gep_offset(i64* %p) {
2071 ; CHECK-LABEL: load_splat_v2i64_with_folded_gep_offset:
2072 ; CHECK: .functype load_splat_v2i64_with_folded_gep_offset (i32) -> (v128)
2073 ; CHECK-NEXT: # %bb.0:
2074 ; CHECK-NEXT: local.get 0
2075 ; CHECK-NEXT: v128.load64_splat 8
2076 ; CHECK-NEXT: # fallthrough-return
2077 %s = getelementptr inbounds i64, i64* %p, i32 1
2078 %e = load i64, i64* %s
2079 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2080 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2084 define <2 x i64> @load_sext_v2i64_with_folded_gep_offset(<2 x i32>* %p) {
2085 ; CHECK-LABEL: load_sext_v2i64_with_folded_gep_offset:
2086 ; CHECK: .functype load_sext_v2i64_with_folded_gep_offset (i32) -> (v128)
2087 ; CHECK-NEXT: # %bb.0:
2088 ; CHECK-NEXT: local.get 0
2089 ; CHECK-NEXT: i64x2.load32x2_s 8
2090 ; CHECK-NEXT: # fallthrough-return
2091 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 1
2092 %v = load <2 x i32>, <2 x i32>* %s
2093 %v2 = sext <2 x i32> %v to <2 x i64>
2097 define <2 x i64> @load_zext_v2i64_with_folded_gep_offset(<2 x i32>* %p) {
2098 ; CHECK-LABEL: load_zext_v2i64_with_folded_gep_offset:
2099 ; CHECK: .functype load_zext_v2i64_with_folded_gep_offset (i32) -> (v128)
2100 ; CHECK-NEXT: # %bb.0:
2101 ; CHECK-NEXT: local.get 0
2102 ; CHECK-NEXT: i64x2.load32x2_u 8
2103 ; CHECK-NEXT: # fallthrough-return
2104 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 1
2105 %v = load <2 x i32>, <2 x i32>* %s
2106 %v2 = zext <2 x i32> %v to <2 x i64>
2110 define <2 x i32> @load_ext_v2i64_with_folded_gep_offset(<2 x i32>* %p) {
2111 ; CHECK-LABEL: load_ext_v2i64_with_folded_gep_offset:
2112 ; CHECK: .functype load_ext_v2i64_with_folded_gep_offset (i32) -> (v128)
2113 ; CHECK-NEXT: # %bb.0:
2114 ; CHECK-NEXT: local.get 0
2115 ; CHECK-NEXT: v128.load64_zero 8
2116 ; CHECK-NEXT: # fallthrough-return
2117 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 1
2118 %v = load <2 x i32>, <2 x i32>* %s
2122 define <2 x i64> @load_v2i64_with_unfolded_gep_negative_offset(<2 x i64>* %p) {
2123 ; CHECK-LABEL: load_v2i64_with_unfolded_gep_negative_offset:
2124 ; CHECK: .functype load_v2i64_with_unfolded_gep_negative_offset (i32) -> (v128)
2125 ; CHECK-NEXT: # %bb.0:
2126 ; CHECK-NEXT: local.get 0
2127 ; CHECK-NEXT: i32.const -16
2128 ; CHECK-NEXT: i32.add
2129 ; CHECK-NEXT: v128.load 0
2130 ; CHECK-NEXT: # fallthrough-return
2131 %s = getelementptr inbounds <2 x i64>, <2 x i64>* %p, i32 -1
2132 %v = load <2 x i64>, <2 x i64>* %s
2136 define <2 x i64> @load_splat_v2i64_with_unfolded_gep_negative_offset(i64* %p) {
2137 ; CHECK-LABEL: load_splat_v2i64_with_unfolded_gep_negative_offset:
2138 ; CHECK: .functype load_splat_v2i64_with_unfolded_gep_negative_offset (i32) -> (v128)
2139 ; CHECK-NEXT: # %bb.0:
2140 ; CHECK-NEXT: local.get 0
2141 ; CHECK-NEXT: i32.const -8
2142 ; CHECK-NEXT: i32.add
2143 ; CHECK-NEXT: v128.load64_splat 0
2144 ; CHECK-NEXT: # fallthrough-return
2145 %s = getelementptr inbounds i64, i64* %p, i32 -1
2146 %e = load i64, i64* %s
2147 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2148 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2152 define <2 x i64> @load_sext_v2i64_with_unfolded_gep_negative_offset(<2 x i32>* %p) {
2153 ; CHECK-LABEL: load_sext_v2i64_with_unfolded_gep_negative_offset:
2154 ; CHECK: .functype load_sext_v2i64_with_unfolded_gep_negative_offset (i32) -> (v128)
2155 ; CHECK-NEXT: # %bb.0:
2156 ; CHECK-NEXT: local.get 0
2157 ; CHECK-NEXT: i32.const -8
2158 ; CHECK-NEXT: i32.add
2159 ; CHECK-NEXT: i64x2.load32x2_s 0
2160 ; CHECK-NEXT: # fallthrough-return
2161 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 -1
2162 %v = load <2 x i32>, <2 x i32>* %s
2163 %v2 = sext <2 x i32> %v to <2 x i64>
2167 define <2 x i64> @load_zext_v2i64_with_unfolded_gep_negative_offset(<2 x i32>* %p) {
2168 ; CHECK-LABEL: load_zext_v2i64_with_unfolded_gep_negative_offset:
2169 ; CHECK: .functype load_zext_v2i64_with_unfolded_gep_negative_offset (i32) -> (v128)
2170 ; CHECK-NEXT: # %bb.0:
2171 ; CHECK-NEXT: local.get 0
2172 ; CHECK-NEXT: i32.const -8
2173 ; CHECK-NEXT: i32.add
2174 ; CHECK-NEXT: i64x2.load32x2_u 0
2175 ; CHECK-NEXT: # fallthrough-return
2176 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 -1
2177 %v = load <2 x i32>, <2 x i32>* %s
2178 %v2 = zext <2 x i32> %v to <2 x i64>
2182 define <2 x i32> @load_ext_v2i64_with_unfolded_gep_negative_offset(<2 x i32>* %p) {
2183 ; CHECK-LABEL: load_ext_v2i64_with_unfolded_gep_negative_offset:
2184 ; CHECK: .functype load_ext_v2i64_with_unfolded_gep_negative_offset (i32) -> (v128)
2185 ; CHECK-NEXT: # %bb.0:
2186 ; CHECK-NEXT: local.get 0
2187 ; CHECK-NEXT: i32.const -8
2188 ; CHECK-NEXT: i32.add
2189 ; CHECK-NEXT: v128.load64_zero 0
2190 ; CHECK-NEXT: # fallthrough-return
2191 %s = getelementptr inbounds <2 x i32>, <2 x i32>* %p, i32 -1
2192 %v = load <2 x i32>, <2 x i32>* %s
2196 define <2 x i64> @load_v2i64_with_unfolded_offset(<2 x i64>* %p) {
2197 ; CHECK-LABEL: load_v2i64_with_unfolded_offset:
2198 ; CHECK: .functype load_v2i64_with_unfolded_offset (i32) -> (v128)
2199 ; CHECK-NEXT: # %bb.0:
2200 ; CHECK-NEXT: local.get 0
2201 ; CHECK-NEXT: i32.const 16
2202 ; CHECK-NEXT: i32.add
2203 ; CHECK-NEXT: v128.load 0
2204 ; CHECK-NEXT: # fallthrough-return
2205 %q = ptrtoint <2 x i64>* %p to i32
2206 %r = add nsw i32 %q, 16
2207 %s = inttoptr i32 %r to <2 x i64>*
2208 %v = load <2 x i64>, <2 x i64>* %s
2212 define <2 x i64> @load_splat_v2i64_with_unfolded_offset(i64* %p) {
2213 ; CHECK-LABEL: load_splat_v2i64_with_unfolded_offset:
2214 ; CHECK: .functype load_splat_v2i64_with_unfolded_offset (i32) -> (v128)
2215 ; CHECK-NEXT: # %bb.0:
2216 ; CHECK-NEXT: local.get 0
2217 ; CHECK-NEXT: i32.const 16
2218 ; CHECK-NEXT: i32.add
2219 ; CHECK-NEXT: v128.load64_splat 0
2220 ; CHECK-NEXT: # fallthrough-return
2221 %q = ptrtoint i64* %p to i32
2222 %r = add nsw i32 %q, 16
2223 %s = inttoptr i32 %r to i64*
2224 %e = load i64, i64* %s
2225 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2226 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2230 define <2 x i64> @load_sext_v2i64_with_unfolded_offset(<2 x i32>* %p) {
2231 ; CHECK-LABEL: load_sext_v2i64_with_unfolded_offset:
2232 ; CHECK: .functype load_sext_v2i64_with_unfolded_offset (i32) -> (v128)
2233 ; CHECK-NEXT: # %bb.0:
2234 ; CHECK-NEXT: local.get 0
2235 ; CHECK-NEXT: i32.const 16
2236 ; CHECK-NEXT: i32.add
2237 ; CHECK-NEXT: i64x2.load32x2_s 0
2238 ; CHECK-NEXT: # fallthrough-return
2239 %q = ptrtoint <2 x i32>* %p to i32
2240 %r = add nsw i32 %q, 16
2241 %s = inttoptr i32 %r to <2 x i32>*
2242 %v = load <2 x i32>, <2 x i32>* %s
2243 %v2 = sext <2 x i32> %v to <2 x i64>
2247 define <2 x i64> @load_zext_v2i64_with_unfolded_offset(<2 x i32>* %p) {
2248 ; CHECK-LABEL: load_zext_v2i64_with_unfolded_offset:
2249 ; CHECK: .functype load_zext_v2i64_with_unfolded_offset (i32) -> (v128)
2250 ; CHECK-NEXT: # %bb.0:
2251 ; CHECK-NEXT: local.get 0
2252 ; CHECK-NEXT: i32.const 16
2253 ; CHECK-NEXT: i32.add
2254 ; CHECK-NEXT: i64x2.load32x2_u 0
2255 ; CHECK-NEXT: # fallthrough-return
2256 %q = ptrtoint <2 x i32>* %p to i32
2257 %r = add nsw i32 %q, 16
2258 %s = inttoptr i32 %r to <2 x i32>*
2259 %v = load <2 x i32>, <2 x i32>* %s
2260 %v2 = zext <2 x i32> %v to <2 x i64>
2264 define <2 x i32> @load_ext_v2i64_with_unfolded_offset(<2 x i32>* %p) {
2265 ; CHECK-LABEL: load_ext_v2i64_with_unfolded_offset:
2266 ; CHECK: .functype load_ext_v2i64_with_unfolded_offset (i32) -> (v128)
2267 ; CHECK-NEXT: # %bb.0:
2268 ; CHECK-NEXT: local.get 0
2269 ; CHECK-NEXT: i32.const 16
2270 ; CHECK-NEXT: i32.add
2271 ; CHECK-NEXT: v128.load64_zero 0
2272 ; CHECK-NEXT: # fallthrough-return
2273 %q = ptrtoint <2 x i32>* %p to i32
2274 %r = add nsw i32 %q, 16
2275 %s = inttoptr i32 %r to <2 x i32>*
2276 %v = load <2 x i32>, <2 x i32>* %s
2280 define <2 x i64> @load_v2i64_with_unfolded_gep_offset(<2 x i64>* %p) {
2281 ; CHECK-LABEL: load_v2i64_with_unfolded_gep_offset:
2282 ; CHECK: .functype load_v2i64_with_unfolded_gep_offset (i32) -> (v128)
2283 ; CHECK-NEXT: # %bb.0:
2284 ; CHECK-NEXT: local.get 0
2285 ; CHECK-NEXT: i32.const 16
2286 ; CHECK-NEXT: i32.add
2287 ; CHECK-NEXT: v128.load 0
2288 ; CHECK-NEXT: # fallthrough-return
2289 %s = getelementptr <2 x i64>, <2 x i64>* %p, i32 1
2290 %v = load <2 x i64>, <2 x i64>* %s
2294 define <2 x i64> @load_splat_v2i64_with_unfolded_gep_offset(i64* %p) {
2295 ; CHECK-LABEL: load_splat_v2i64_with_unfolded_gep_offset:
2296 ; CHECK: .functype load_splat_v2i64_with_unfolded_gep_offset (i32) -> (v128)
2297 ; CHECK-NEXT: # %bb.0:
2298 ; CHECK-NEXT: local.get 0
2299 ; CHECK-NEXT: i32.const 8
2300 ; CHECK-NEXT: i32.add
2301 ; CHECK-NEXT: v128.load64_splat 0
2302 ; CHECK-NEXT: # fallthrough-return
2303 %s = getelementptr i64, i64* %p, i32 1
2304 %e = load i64, i64* %s
2305 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2306 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2310 define <2 x i64> @load_sext_v2i64_with_unfolded_gep_offset(<2 x i32>* %p) {
2311 ; CHECK-LABEL: load_sext_v2i64_with_unfolded_gep_offset:
2312 ; CHECK: .functype load_sext_v2i64_with_unfolded_gep_offset (i32) -> (v128)
2313 ; CHECK-NEXT: # %bb.0:
2314 ; CHECK-NEXT: local.get 0
2315 ; CHECK-NEXT: i32.const 8
2316 ; CHECK-NEXT: i32.add
2317 ; CHECK-NEXT: i64x2.load32x2_s 0
2318 ; CHECK-NEXT: # fallthrough-return
2319 %s = getelementptr <2 x i32>, <2 x i32>* %p, i32 1
2320 %v = load <2 x i32>, <2 x i32>* %s
2321 %v2 = sext <2 x i32> %v to <2 x i64>
2325 define <2 x i64> @load_zext_v2i64_with_unfolded_gep_offset(<2 x i32>* %p) {
2326 ; CHECK-LABEL: load_zext_v2i64_with_unfolded_gep_offset:
2327 ; CHECK: .functype load_zext_v2i64_with_unfolded_gep_offset (i32) -> (v128)
2328 ; CHECK-NEXT: # %bb.0:
2329 ; CHECK-NEXT: local.get 0
2330 ; CHECK-NEXT: i32.const 8
2331 ; CHECK-NEXT: i32.add
2332 ; CHECK-NEXT: i64x2.load32x2_u 0
2333 ; CHECK-NEXT: # fallthrough-return
2334 %s = getelementptr <2 x i32>, <2 x i32>* %p, i32 1
2335 %v = load <2 x i32>, <2 x i32>* %s
2336 %v2 = zext <2 x i32> %v to <2 x i64>
2340 define <2 x i32> @load_ext_v2i64_with_unfolded_gep_offset(<2 x i32>* %p) {
2341 ; CHECK-LABEL: load_ext_v2i64_with_unfolded_gep_offset:
2342 ; CHECK: .functype load_ext_v2i64_with_unfolded_gep_offset (i32) -> (v128)
2343 ; CHECK-NEXT: # %bb.0:
2344 ; CHECK-NEXT: local.get 0
2345 ; CHECK-NEXT: i32.const 8
2346 ; CHECK-NEXT: i32.add
2347 ; CHECK-NEXT: v128.load64_zero 0
2348 ; CHECK-NEXT: # fallthrough-return
2349 %s = getelementptr <2 x i32>, <2 x i32>* %p, i32 1
2350 %v = load <2 x i32>, <2 x i32>* %s
2354 define <2 x i64> @load_v2i64_from_numeric_address() {
2355 ; CHECK-LABEL: load_v2i64_from_numeric_address:
2356 ; CHECK: .functype load_v2i64_from_numeric_address () -> (v128)
2357 ; CHECK-NEXT: # %bb.0:
2358 ; CHECK-NEXT: i32.const 0
2359 ; CHECK-NEXT: v128.load 32
2360 ; CHECK-NEXT: # fallthrough-return
2361 %s = inttoptr i32 32 to <2 x i64>*
2362 %v = load <2 x i64>, <2 x i64>* %s
2366 define <2 x i64> @load_splat_v2i64_from_numeric_address() {
2367 ; CHECK-LABEL: load_splat_v2i64_from_numeric_address:
2368 ; CHECK: .functype load_splat_v2i64_from_numeric_address () -> (v128)
2369 ; CHECK-NEXT: # %bb.0:
2370 ; CHECK-NEXT: i32.const 0
2371 ; CHECK-NEXT: v128.load64_splat 32
2372 ; CHECK-NEXT: # fallthrough-return
2373 %s = inttoptr i32 32 to i64*
2374 %e = load i64, i64* %s
2375 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2376 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2380 define <2 x i64> @load_sext_v2i64_from_numeric_address() {
2381 ; CHECK-LABEL: load_sext_v2i64_from_numeric_address:
2382 ; CHECK: .functype load_sext_v2i64_from_numeric_address () -> (v128)
2383 ; CHECK-NEXT: # %bb.0:
2384 ; CHECK-NEXT: i32.const 0
2385 ; CHECK-NEXT: i64x2.load32x2_s 32
2386 ; CHECK-NEXT: # fallthrough-return
2387 %s = inttoptr i32 32 to <2 x i32>*
2388 %v = load <2 x i32>, <2 x i32>* %s
2389 %v2 = sext <2 x i32> %v to <2 x i64>
2393 define <2 x i64> @load_zext_v2i64_from_numeric_address() {
2394 ; CHECK-LABEL: load_zext_v2i64_from_numeric_address:
2395 ; CHECK: .functype load_zext_v2i64_from_numeric_address () -> (v128)
2396 ; CHECK-NEXT: # %bb.0:
2397 ; CHECK-NEXT: i32.const 0
2398 ; CHECK-NEXT: i64x2.load32x2_u 32
2399 ; CHECK-NEXT: # fallthrough-return
2400 %s = inttoptr i32 32 to <2 x i32>*
2401 %v = load <2 x i32>, <2 x i32>* %s
2402 %v2 = zext <2 x i32> %v to <2 x i64>
2406 define <2 x i32> @load_ext_v2i64_from_numeric_address() {
2407 ; CHECK-LABEL: load_ext_v2i64_from_numeric_address:
2408 ; CHECK: .functype load_ext_v2i64_from_numeric_address () -> (v128)
2409 ; CHECK-NEXT: # %bb.0:
2410 ; CHECK-NEXT: i32.const 0
2411 ; CHECK-NEXT: v128.load64_zero 32
2412 ; CHECK-NEXT: # fallthrough-return
2413 %s = inttoptr i32 32 to <2 x i32>*
2414 %v = load <2 x i32>, <2 x i32>* %s
2418 @gv_v2i64 = global <2 x i64> <i64 42, i64 42>
2419 define <2 x i64> @load_v2i64_from_global_address() {
2420 ; CHECK-LABEL: load_v2i64_from_global_address:
2421 ; CHECK: .functype load_v2i64_from_global_address () -> (v128)
2422 ; CHECK-NEXT: # %bb.0:
2423 ; CHECK-NEXT: i32.const 0
2424 ; CHECK-NEXT: v128.load gv_v2i64
2425 ; CHECK-NEXT: # fallthrough-return
2426 %v = load <2 x i64>, <2 x i64>* @gv_v2i64
2430 @gv_i64 = global i64 42
2431 define <2 x i64> @load_splat_v2i64_from_global_address() {
2432 ; CHECK-LABEL: load_splat_v2i64_from_global_address:
2433 ; CHECK: .functype load_splat_v2i64_from_global_address () -> (v128)
2434 ; CHECK-NEXT: # %bb.0:
2435 ; CHECK-NEXT: i32.const 0
2436 ; CHECK-NEXT: v128.load64_splat gv_i64
2437 ; CHECK-NEXT: # fallthrough-return
2438 %e = load i64, i64* @gv_i64
2439 %v1 = insertelement <2 x i64> undef, i64 %e, i32 0
2440 %v2 = shufflevector <2 x i64> %v1, <2 x i64> undef, <2 x i32> zeroinitializer
2444 @gv_v2i32 = global <2 x i32> <i32 42, i32 42>
2445 define <2 x i64> @load_sext_v2i64_from_global_address() {
2446 ; CHECK-LABEL: load_sext_v2i64_from_global_address:
2447 ; CHECK: .functype load_sext_v2i64_from_global_address () -> (v128)
2448 ; CHECK-NEXT: # %bb.0:
2449 ; CHECK-NEXT: i32.const 0
2450 ; CHECK-NEXT: i64x2.load32x2_s gv_v2i32
2451 ; CHECK-NEXT: # fallthrough-return
2452 %v = load <2 x i32>, <2 x i32>* @gv_v2i32
2453 %v2 = sext <2 x i32> %v to <2 x i64>
2457 define <2 x i64> @load_zext_v2i64_from_global_address() {
2458 ; CHECK-LABEL: load_zext_v2i64_from_global_address:
2459 ; CHECK: .functype load_zext_v2i64_from_global_address () -> (v128)
2460 ; CHECK-NEXT: # %bb.0:
2461 ; CHECK-NEXT: i32.const 0
2462 ; CHECK-NEXT: i64x2.load32x2_u gv_v2i32
2463 ; CHECK-NEXT: # fallthrough-return
2464 %v = load <2 x i32>, <2 x i32>* @gv_v2i32
2465 %v2 = zext <2 x i32> %v to <2 x i64>
2469 define <2 x i32> @load_ext_v2i64_from_global_address() {
2470 ; CHECK-LABEL: load_ext_v2i64_from_global_address:
2471 ; CHECK: .functype load_ext_v2i64_from_global_address () -> (v128)
2472 ; CHECK-NEXT: # %bb.0:
2473 ; CHECK-NEXT: i32.const 0
2474 ; CHECK-NEXT: v128.load64_zero gv_v2i32
2475 ; CHECK-NEXT: # fallthrough-return
2476 %v = load <2 x i32>, <2 x i32>* @gv_v2i32
2480 define void @store_v2i64(<2 x i64> %v, <2 x i64>* %p) {
2481 ; CHECK-LABEL: store_v2i64:
2482 ; CHECK: .functype store_v2i64 (v128, i32) -> ()
2483 ; CHECK-NEXT: # %bb.0:
2484 ; CHECK-NEXT: local.get 1
2485 ; CHECK-NEXT: local.get 0
2486 ; CHECK-NEXT: v128.store 0
2487 ; CHECK-NEXT: # fallthrough-return
2488 store <2 x i64> %v , <2 x i64>* %p
2492 define void @store_v2i64_with_folded_offset(<2 x i64> %v, <2 x i64>* %p) {
2493 ; CHECK-LABEL: store_v2i64_with_folded_offset:
2494 ; CHECK: .functype store_v2i64_with_folded_offset (v128, i32) -> ()
2495 ; CHECK-NEXT: # %bb.0:
2496 ; CHECK-NEXT: local.get 1
2497 ; CHECK-NEXT: local.get 0
2498 ; CHECK-NEXT: v128.store 16
2499 ; CHECK-NEXT: # fallthrough-return
2500 %q = ptrtoint <2 x i64>* %p to i32
2501 %r = add nuw i32 %q, 16
2502 %s = inttoptr i32 %r to <2 x i64>*
2503 store <2 x i64> %v , <2 x i64>* %s
2507 define void @store_v2i64_with_folded_gep_offset(<2 x i64> %v, <2 x i64>* %p) {
2508 ; CHECK-LABEL: store_v2i64_with_folded_gep_offset:
2509 ; CHECK: .functype store_v2i64_with_folded_gep_offset (v128, i32) -> ()
2510 ; CHECK-NEXT: # %bb.0:
2511 ; CHECK-NEXT: local.get 1
2512 ; CHECK-NEXT: local.get 0
2513 ; CHECK-NEXT: v128.store 16
2514 ; CHECK-NEXT: # fallthrough-return
2515 %s = getelementptr inbounds <2 x i64>, <2 x i64>* %p, i32 1
2516 store <2 x i64> %v , <2 x i64>* %s
2520 define void @store_v2i64_with_unfolded_gep_negative_offset(<2 x i64> %v, <2 x i64>* %p) {
2521 ; CHECK-LABEL: store_v2i64_with_unfolded_gep_negative_offset:
2522 ; CHECK: .functype store_v2i64_with_unfolded_gep_negative_offset (v128, i32) -> ()
2523 ; CHECK-NEXT: # %bb.0:
2524 ; CHECK-NEXT: local.get 1
2525 ; CHECK-NEXT: i32.const -16
2526 ; CHECK-NEXT: i32.add
2527 ; CHECK-NEXT: local.get 0
2528 ; CHECK-NEXT: v128.store 0
2529 ; CHECK-NEXT: # fallthrough-return
2530 %s = getelementptr inbounds <2 x i64>, <2 x i64>* %p, i32 -1
2531 store <2 x i64> %v , <2 x i64>* %s
2535 define void @store_v2i64_with_unfolded_offset(<2 x i64> %v, <2 x i64>* %p) {
2536 ; CHECK-LABEL: store_v2i64_with_unfolded_offset:
2537 ; CHECK: .functype store_v2i64_with_unfolded_offset (v128, i32) -> ()
2538 ; CHECK-NEXT: # %bb.0:
2539 ; CHECK-NEXT: local.get 1
2540 ; CHECK-NEXT: i32.const 16
2541 ; CHECK-NEXT: i32.add
2542 ; CHECK-NEXT: local.get 0
2543 ; CHECK-NEXT: v128.store 0
2544 ; CHECK-NEXT: # fallthrough-return
2545 %q = ptrtoint <2 x i64>* %p to i32
2546 %r = add nsw i32 %q, 16
2547 %s = inttoptr i32 %r to <2 x i64>*
2548 store <2 x i64> %v , <2 x i64>* %s
2552 define void @store_v2i64_with_unfolded_gep_offset(<2 x i64> %v, <2 x i64>* %p) {
2553 ; CHECK-LABEL: store_v2i64_with_unfolded_gep_offset:
2554 ; CHECK: .functype store_v2i64_with_unfolded_gep_offset (v128, i32) -> ()
2555 ; CHECK-NEXT: # %bb.0:
2556 ; CHECK-NEXT: local.get 1
2557 ; CHECK-NEXT: i32.const 16
2558 ; CHECK-NEXT: i32.add
2559 ; CHECK-NEXT: local.get 0
2560 ; CHECK-NEXT: v128.store 0
2561 ; CHECK-NEXT: # fallthrough-return
2562 %s = getelementptr <2 x i64>, <2 x i64>* %p, i32 1
2563 store <2 x i64> %v , <2 x i64>* %s
2567 define void @store_v2i64_to_numeric_address(<2 x i64> %v) {
2568 ; CHECK-LABEL: store_v2i64_to_numeric_address:
2569 ; CHECK: .functype store_v2i64_to_numeric_address (v128) -> ()
2570 ; CHECK-NEXT: # %bb.0:
2571 ; CHECK-NEXT: i32.const 0
2572 ; CHECK-NEXT: local.get 0
2573 ; CHECK-NEXT: v128.store 32
2574 ; CHECK-NEXT: # fallthrough-return
2575 %s = inttoptr i32 32 to <2 x i64>*
2576 store <2 x i64> %v , <2 x i64>* %s
2580 define void @store_v2i64_to_global_address(<2 x i64> %v) {
2581 ; CHECK-LABEL: store_v2i64_to_global_address:
2582 ; CHECK: .functype store_v2i64_to_global_address (v128) -> ()
2583 ; CHECK-NEXT: # %bb.0:
2584 ; CHECK-NEXT: i32.const 0
2585 ; CHECK-NEXT: local.get 0
2586 ; CHECK-NEXT: v128.store gv_v2i64
2587 ; CHECK-NEXT: # fallthrough-return
2588 store <2 x i64> %v , <2 x i64>* @gv_v2i64
2592 ; ==============================================================================
2594 ; ==============================================================================
2595 define <4 x float> @load_v4f32(<4 x float>* %p) {
2596 ; CHECK-LABEL: load_v4f32:
2597 ; CHECK: .functype load_v4f32 (i32) -> (v128)
2598 ; CHECK-NEXT: # %bb.0:
2599 ; CHECK-NEXT: local.get 0
2600 ; CHECK-NEXT: v128.load 0
2601 ; CHECK-NEXT: # fallthrough-return
2602 %v = load <4 x float>, <4 x float>* %p
2606 define <4 x float> @load_splat_v4f32(float* %p) {
2607 ; CHECK-LABEL: load_splat_v4f32:
2608 ; CHECK: .functype load_splat_v4f32 (i32) -> (v128)
2609 ; CHECK-NEXT: # %bb.0:
2610 ; CHECK-NEXT: local.get 0
2611 ; CHECK-NEXT: v128.load32_splat 0
2612 ; CHECK-NEXT: # fallthrough-return
2613 %e = load float, float* %p
2614 %v1 = insertelement <4 x float> undef, float %e, i32 0
2615 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2619 define <4 x float> @load_v4f32_with_folded_offset(<4 x float>* %p) {
2620 ; CHECK-LABEL: load_v4f32_with_folded_offset:
2621 ; CHECK: .functype load_v4f32_with_folded_offset (i32) -> (v128)
2622 ; CHECK-NEXT: # %bb.0:
2623 ; CHECK-NEXT: local.get 0
2624 ; CHECK-NEXT: v128.load 16
2625 ; CHECK-NEXT: # fallthrough-return
2626 %q = ptrtoint <4 x float>* %p to i32
2627 %r = add nuw i32 %q, 16
2628 %s = inttoptr i32 %r to <4 x float>*
2629 %v = load <4 x float>, <4 x float>* %s
2633 define <4 x float> @load_splat_v4f32_with_folded_offset(float* %p) {
2634 ; CHECK-LABEL: load_splat_v4f32_with_folded_offset:
2635 ; CHECK: .functype load_splat_v4f32_with_folded_offset (i32) -> (v128)
2636 ; CHECK-NEXT: # %bb.0:
2637 ; CHECK-NEXT: local.get 0
2638 ; CHECK-NEXT: v128.load32_splat 16
2639 ; CHECK-NEXT: # fallthrough-return
2640 %q = ptrtoint float* %p to i32
2641 %r = add nuw i32 %q, 16
2642 %s = inttoptr i32 %r to float*
2643 %e = load float, float* %s
2644 %v1 = insertelement <4 x float> undef, float %e, i32 0
2645 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2649 define <4 x float> @load_v4f32_with_folded_gep_offset(<4 x float>* %p) {
2650 ; CHECK-LABEL: load_v4f32_with_folded_gep_offset:
2651 ; CHECK: .functype load_v4f32_with_folded_gep_offset (i32) -> (v128)
2652 ; CHECK-NEXT: # %bb.0:
2653 ; CHECK-NEXT: local.get 0
2654 ; CHECK-NEXT: v128.load 16
2655 ; CHECK-NEXT: # fallthrough-return
2656 %s = getelementptr inbounds <4 x float>, <4 x float>* %p, i32 1
2657 %v = load <4 x float>, <4 x float>* %s
2661 define <4 x float> @load_splat_v4f32_with_folded_gep_offset(float* %p) {
2662 ; CHECK-LABEL: load_splat_v4f32_with_folded_gep_offset:
2663 ; CHECK: .functype load_splat_v4f32_with_folded_gep_offset (i32) -> (v128)
2664 ; CHECK-NEXT: # %bb.0:
2665 ; CHECK-NEXT: local.get 0
2666 ; CHECK-NEXT: v128.load32_splat 4
2667 ; CHECK-NEXT: # fallthrough-return
2668 %s = getelementptr inbounds float, float* %p, i32 1
2669 %e = load float, float* %s
2670 %v1 = insertelement <4 x float> undef, float %e, i32 0
2671 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2675 define <4 x float> @load_v4f32_with_unfolded_gep_negative_offset(<4 x float>* %p) {
2676 ; CHECK-LABEL: load_v4f32_with_unfolded_gep_negative_offset:
2677 ; CHECK: .functype load_v4f32_with_unfolded_gep_negative_offset (i32) -> (v128)
2678 ; CHECK-NEXT: # %bb.0:
2679 ; CHECK-NEXT: local.get 0
2680 ; CHECK-NEXT: i32.const -16
2681 ; CHECK-NEXT: i32.add
2682 ; CHECK-NEXT: v128.load 0
2683 ; CHECK-NEXT: # fallthrough-return
2684 %s = getelementptr inbounds <4 x float>, <4 x float>* %p, i32 -1
2685 %v = load <4 x float>, <4 x float>* %s
2689 define <4 x float> @load_splat_v4f32_with_unfolded_gep_negative_offset(float* %p) {
2690 ; CHECK-LABEL: load_splat_v4f32_with_unfolded_gep_negative_offset:
2691 ; CHECK: .functype load_splat_v4f32_with_unfolded_gep_negative_offset (i32) -> (v128)
2692 ; CHECK-NEXT: # %bb.0:
2693 ; CHECK-NEXT: local.get 0
2694 ; CHECK-NEXT: i32.const -4
2695 ; CHECK-NEXT: i32.add
2696 ; CHECK-NEXT: v128.load32_splat 0
2697 ; CHECK-NEXT: # fallthrough-return
2698 %s = getelementptr inbounds float, float* %p, i32 -1
2699 %e = load float, float* %s
2700 %v1 = insertelement <4 x float> undef, float %e, i32 0
2701 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2705 define <4 x float> @load_v4f32_with_unfolded_offset(<4 x float>* %p) {
2706 ; CHECK-LABEL: load_v4f32_with_unfolded_offset:
2707 ; CHECK: .functype load_v4f32_with_unfolded_offset (i32) -> (v128)
2708 ; CHECK-NEXT: # %bb.0:
2709 ; CHECK-NEXT: local.get 0
2710 ; CHECK-NEXT: i32.const 16
2711 ; CHECK-NEXT: i32.add
2712 ; CHECK-NEXT: v128.load 0
2713 ; CHECK-NEXT: # fallthrough-return
2714 %q = ptrtoint <4 x float>* %p to i32
2715 %r = add nsw i32 %q, 16
2716 %s = inttoptr i32 %r to <4 x float>*
2717 %v = load <4 x float>, <4 x float>* %s
2721 define <4 x float> @load_splat_v4f32_with_unfolded_offset(float* %p) {
2722 ; CHECK-LABEL: load_splat_v4f32_with_unfolded_offset:
2723 ; CHECK: .functype load_splat_v4f32_with_unfolded_offset (i32) -> (v128)
2724 ; CHECK-NEXT: # %bb.0:
2725 ; CHECK-NEXT: local.get 0
2726 ; CHECK-NEXT: i32.const 16
2727 ; CHECK-NEXT: i32.add
2728 ; CHECK-NEXT: v128.load32_splat 0
2729 ; CHECK-NEXT: # fallthrough-return
2730 %q = ptrtoint float* %p to i32
2731 %r = add nsw i32 %q, 16
2732 %s = inttoptr i32 %r to float*
2733 %e = load float, float* %s
2734 %v1 = insertelement <4 x float> undef, float %e, i32 0
2735 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2739 define <4 x float> @load_v4f32_with_unfolded_gep_offset(<4 x float>* %p) {
2740 ; CHECK-LABEL: load_v4f32_with_unfolded_gep_offset:
2741 ; CHECK: .functype load_v4f32_with_unfolded_gep_offset (i32) -> (v128)
2742 ; CHECK-NEXT: # %bb.0:
2743 ; CHECK-NEXT: local.get 0
2744 ; CHECK-NEXT: i32.const 16
2745 ; CHECK-NEXT: i32.add
2746 ; CHECK-NEXT: v128.load 0
2747 ; CHECK-NEXT: # fallthrough-return
2748 %s = getelementptr <4 x float>, <4 x float>* %p, i32 1
2749 %v = load <4 x float>, <4 x float>* %s
2753 define <4 x float> @load_splat_v4f32_with_unfolded_gep_offset(float* %p) {
2754 ; CHECK-LABEL: load_splat_v4f32_with_unfolded_gep_offset:
2755 ; CHECK: .functype load_splat_v4f32_with_unfolded_gep_offset (i32) -> (v128)
2756 ; CHECK-NEXT: # %bb.0:
2757 ; CHECK-NEXT: local.get 0
2758 ; CHECK-NEXT: i32.const 4
2759 ; CHECK-NEXT: i32.add
2760 ; CHECK-NEXT: v128.load32_splat 0
2761 ; CHECK-NEXT: # fallthrough-return
2762 %s = getelementptr float, float* %p, i32 1
2763 %e = load float, float* %s
2764 %v1 = insertelement <4 x float> undef, float %e, i32 0
2765 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2769 define <4 x float> @load_v4f32_from_numeric_address() {
2770 ; CHECK-LABEL: load_v4f32_from_numeric_address:
2771 ; CHECK: .functype load_v4f32_from_numeric_address () -> (v128)
2772 ; CHECK-NEXT: # %bb.0:
2773 ; CHECK-NEXT: i32.const 0
2774 ; CHECK-NEXT: v128.load 32
2775 ; CHECK-NEXT: # fallthrough-return
2776 %s = inttoptr i32 32 to <4 x float>*
2777 %v = load <4 x float>, <4 x float>* %s
2781 define <4 x float> @load_splat_v4f32_from_numeric_address() {
2782 ; CHECK-LABEL: load_splat_v4f32_from_numeric_address:
2783 ; CHECK: .functype load_splat_v4f32_from_numeric_address () -> (v128)
2784 ; CHECK-NEXT: # %bb.0:
2785 ; CHECK-NEXT: i32.const 0
2786 ; CHECK-NEXT: v128.load32_splat 32
2787 ; CHECK-NEXT: # fallthrough-return
2788 %s = inttoptr i32 32 to float*
2789 %e = load float, float* %s
2790 %v1 = insertelement <4 x float> undef, float %e, i32 0
2791 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2795 @gv_v4f32 = global <4 x float> <float 42., float 42., float 42., float 42.>
2796 define <4 x float> @load_v4f32_from_global_address() {
2797 ; CHECK-LABEL: load_v4f32_from_global_address:
2798 ; CHECK: .functype load_v4f32_from_global_address () -> (v128)
2799 ; CHECK-NEXT: # %bb.0:
2800 ; CHECK-NEXT: i32.const 0
2801 ; CHECK-NEXT: v128.load gv_v4f32
2802 ; CHECK-NEXT: # fallthrough-return
2803 %v = load <4 x float>, <4 x float>* @gv_v4f32
2807 @gv_f32 = global float 42.
2808 define <4 x float> @load_splat_v4f32_from_global_address() {
2809 ; CHECK-LABEL: load_splat_v4f32_from_global_address:
2810 ; CHECK: .functype load_splat_v4f32_from_global_address () -> (v128)
2811 ; CHECK-NEXT: # %bb.0:
2812 ; CHECK-NEXT: i32.const 0
2813 ; CHECK-NEXT: v128.load32_splat gv_f32
2814 ; CHECK-NEXT: # fallthrough-return
2815 %e = load float, float* @gv_f32
2816 %v1 = insertelement <4 x float> undef, float %e, i32 0
2817 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> zeroinitializer
2821 define void @store_v4f32(<4 x float> %v, <4 x float>* %p) {
2822 ; CHECK-LABEL: store_v4f32:
2823 ; CHECK: .functype store_v4f32 (v128, i32) -> ()
2824 ; CHECK-NEXT: # %bb.0:
2825 ; CHECK-NEXT: local.get 1
2826 ; CHECK-NEXT: local.get 0
2827 ; CHECK-NEXT: v128.store 0
2828 ; CHECK-NEXT: # fallthrough-return
2829 store <4 x float> %v , <4 x float>* %p
2833 define void @store_v4f32_with_folded_offset(<4 x float> %v, <4 x float>* %p) {
2834 ; CHECK-LABEL: store_v4f32_with_folded_offset:
2835 ; CHECK: .functype store_v4f32_with_folded_offset (v128, i32) -> ()
2836 ; CHECK-NEXT: # %bb.0:
2837 ; CHECK-NEXT: local.get 1
2838 ; CHECK-NEXT: local.get 0
2839 ; CHECK-NEXT: v128.store 16
2840 ; CHECK-NEXT: # fallthrough-return
2841 %q = ptrtoint <4 x float>* %p to i32
2842 %r = add nuw i32 %q, 16
2843 %s = inttoptr i32 %r to <4 x float>*
2844 store <4 x float> %v , <4 x float>* %s
2848 define void @store_v4f32_with_folded_gep_offset(<4 x float> %v, <4 x float>* %p) {
2849 ; CHECK-LABEL: store_v4f32_with_folded_gep_offset:
2850 ; CHECK: .functype store_v4f32_with_folded_gep_offset (v128, i32) -> ()
2851 ; CHECK-NEXT: # %bb.0:
2852 ; CHECK-NEXT: local.get 1
2853 ; CHECK-NEXT: local.get 0
2854 ; CHECK-NEXT: v128.store 16
2855 ; CHECK-NEXT: # fallthrough-return
2856 %s = getelementptr inbounds <4 x float>, <4 x float>* %p, i32 1
2857 store <4 x float> %v , <4 x float>* %s
2861 define void @store_v4f32_with_unfolded_gep_negative_offset(<4 x float> %v, <4 x float>* %p) {
2862 ; CHECK-LABEL: store_v4f32_with_unfolded_gep_negative_offset:
2863 ; CHECK: .functype store_v4f32_with_unfolded_gep_negative_offset (v128, i32) -> ()
2864 ; CHECK-NEXT: # %bb.0:
2865 ; CHECK-NEXT: local.get 1
2866 ; CHECK-NEXT: i32.const -16
2867 ; CHECK-NEXT: i32.add
2868 ; CHECK-NEXT: local.get 0
2869 ; CHECK-NEXT: v128.store 0
2870 ; CHECK-NEXT: # fallthrough-return
2871 %s = getelementptr inbounds <4 x float>, <4 x float>* %p, i32 -1
2872 store <4 x float> %v , <4 x float>* %s
2876 define void @store_v4f32_with_unfolded_offset(<4 x float> %v, <4 x float>* %p) {
2877 ; CHECK-LABEL: store_v4f32_with_unfolded_offset:
2878 ; CHECK: .functype store_v4f32_with_unfolded_offset (v128, i32) -> ()
2879 ; CHECK-NEXT: # %bb.0:
2880 ; CHECK-NEXT: local.get 1
2881 ; CHECK-NEXT: i32.const 16
2882 ; CHECK-NEXT: i32.add
2883 ; CHECK-NEXT: local.get 0
2884 ; CHECK-NEXT: v128.store 0
2885 ; CHECK-NEXT: # fallthrough-return
2886 %q = ptrtoint <4 x float>* %p to i32
2887 %r = add nsw i32 %q, 16
2888 %s = inttoptr i32 %r to <4 x float>*
2889 store <4 x float> %v , <4 x float>* %s
2893 define void @store_v4f32_with_unfolded_gep_offset(<4 x float> %v, <4 x float>* %p) {
2894 ; CHECK-LABEL: store_v4f32_with_unfolded_gep_offset:
2895 ; CHECK: .functype store_v4f32_with_unfolded_gep_offset (v128, i32) -> ()
2896 ; CHECK-NEXT: # %bb.0:
2897 ; CHECK-NEXT: local.get 1
2898 ; CHECK-NEXT: i32.const 16
2899 ; CHECK-NEXT: i32.add
2900 ; CHECK-NEXT: local.get 0
2901 ; CHECK-NEXT: v128.store 0
2902 ; CHECK-NEXT: # fallthrough-return
2903 %s = getelementptr <4 x float>, <4 x float>* %p, i32 1
2904 store <4 x float> %v , <4 x float>* %s
2908 define void @store_v4f32_to_numeric_address(<4 x float> %v) {
2909 ; CHECK-LABEL: store_v4f32_to_numeric_address:
2910 ; CHECK: .functype store_v4f32_to_numeric_address (v128) -> ()
2911 ; CHECK-NEXT: # %bb.0:
2912 ; CHECK-NEXT: i32.const 0
2913 ; CHECK-NEXT: local.get 0
2914 ; CHECK-NEXT: v128.store 32
2915 ; CHECK-NEXT: # fallthrough-return
2916 %s = inttoptr i32 32 to <4 x float>*
2917 store <4 x float> %v , <4 x float>* %s
2921 define void @store_v4f32_to_global_address(<4 x float> %v) {
2922 ; CHECK-LABEL: store_v4f32_to_global_address:
2923 ; CHECK: .functype store_v4f32_to_global_address (v128) -> ()
2924 ; CHECK-NEXT: # %bb.0:
2925 ; CHECK-NEXT: i32.const 0
2926 ; CHECK-NEXT: local.get 0
2927 ; CHECK-NEXT: v128.store gv_v4f32
2928 ; CHECK-NEXT: # fallthrough-return
2929 store <4 x float> %v , <4 x float>* @gv_v4f32
2933 ; ==============================================================================
2935 ; ==============================================================================
2936 define <2 x double> @load_v2f64(<2 x double>* %p) {
2937 ; CHECK-LABEL: load_v2f64:
2938 ; CHECK: .functype load_v2f64 (i32) -> (v128)
2939 ; CHECK-NEXT: # %bb.0:
2940 ; CHECK-NEXT: local.get 0
2941 ; CHECK-NEXT: v128.load 0
2942 ; CHECK-NEXT: # fallthrough-return
2943 %v = load <2 x double>, <2 x double>* %p
2947 define <2 x double> @load_splat_v2f64(double* %p) {
2948 ; CHECK-LABEL: load_splat_v2f64:
2949 ; CHECK: .functype load_splat_v2f64 (i32) -> (v128)
2950 ; CHECK-NEXT: # %bb.0:
2951 ; CHECK-NEXT: local.get 0
2952 ; CHECK-NEXT: v128.load64_splat 0
2953 ; CHECK-NEXT: # fallthrough-return
2954 %e = load double, double* %p
2955 %v1 = insertelement <2 x double> undef, double %e, i32 0
2956 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
2957 ret <2 x double> %v2
2960 define <2 x double> @load_v2f64_with_folded_offset(<2 x double>* %p) {
2961 ; CHECK-LABEL: load_v2f64_with_folded_offset:
2962 ; CHECK: .functype load_v2f64_with_folded_offset (i32) -> (v128)
2963 ; CHECK-NEXT: # %bb.0:
2964 ; CHECK-NEXT: local.get 0
2965 ; CHECK-NEXT: v128.load 16
2966 ; CHECK-NEXT: # fallthrough-return
2967 %q = ptrtoint <2 x double>* %p to i32
2968 %r = add nuw i32 %q, 16
2969 %s = inttoptr i32 %r to <2 x double>*
2970 %v = load <2 x double>, <2 x double>* %s
2974 define <2 x double> @load_splat_v2f64_with_folded_offset(double* %p) {
2975 ; CHECK-LABEL: load_splat_v2f64_with_folded_offset:
2976 ; CHECK: .functype load_splat_v2f64_with_folded_offset (i32) -> (v128)
2977 ; CHECK-NEXT: # %bb.0:
2978 ; CHECK-NEXT: local.get 0
2979 ; CHECK-NEXT: v128.load64_splat 16
2980 ; CHECK-NEXT: # fallthrough-return
2981 %q = ptrtoint double* %p to i32
2982 %r = add nuw i32 %q, 16
2983 %s = inttoptr i32 %r to double*
2984 %e = load double, double* %s
2985 %v1 = insertelement <2 x double> undef, double %e, i32 0
2986 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
2987 ret <2 x double> %v2
2990 define <2 x double> @load_v2f64_with_folded_gep_offset(<2 x double>* %p) {
2991 ; CHECK-LABEL: load_v2f64_with_folded_gep_offset:
2992 ; CHECK: .functype load_v2f64_with_folded_gep_offset (i32) -> (v128)
2993 ; CHECK-NEXT: # %bb.0:
2994 ; CHECK-NEXT: local.get 0
2995 ; CHECK-NEXT: v128.load 16
2996 ; CHECK-NEXT: # fallthrough-return
2997 %s = getelementptr inbounds <2 x double>, <2 x double>* %p, i32 1
2998 %v = load <2 x double>, <2 x double>* %s
3002 define <2 x double> @load_splat_v2f64_with_folded_gep_offset(double* %p) {
3003 ; CHECK-LABEL: load_splat_v2f64_with_folded_gep_offset:
3004 ; CHECK: .functype load_splat_v2f64_with_folded_gep_offset (i32) -> (v128)
3005 ; CHECK-NEXT: # %bb.0:
3006 ; CHECK-NEXT: local.get 0
3007 ; CHECK-NEXT: v128.load64_splat 8
3008 ; CHECK-NEXT: # fallthrough-return
3009 %s = getelementptr inbounds double, double* %p, i32 1
3010 %e = load double, double* %s
3011 %v1 = insertelement <2 x double> undef, double %e, i32 0
3012 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3013 ret <2 x double> %v2
3016 define <2 x double> @load_v2f64_with_unfolded_gep_negative_offset(<2 x double>* %p) {
3017 ; CHECK-LABEL: load_v2f64_with_unfolded_gep_negative_offset:
3018 ; CHECK: .functype load_v2f64_with_unfolded_gep_negative_offset (i32) -> (v128)
3019 ; CHECK-NEXT: # %bb.0:
3020 ; CHECK-NEXT: local.get 0
3021 ; CHECK-NEXT: i32.const -16
3022 ; CHECK-NEXT: i32.add
3023 ; CHECK-NEXT: v128.load 0
3024 ; CHECK-NEXT: # fallthrough-return
3025 %s = getelementptr inbounds <2 x double>, <2 x double>* %p, i32 -1
3026 %v = load <2 x double>, <2 x double>* %s
3030 define <2 x double> @load_splat_v2f64_with_unfolded_gep_negative_offset(double* %p) {
3031 ; CHECK-LABEL: load_splat_v2f64_with_unfolded_gep_negative_offset:
3032 ; CHECK: .functype load_splat_v2f64_with_unfolded_gep_negative_offset (i32) -> (v128)
3033 ; CHECK-NEXT: # %bb.0:
3034 ; CHECK-NEXT: local.get 0
3035 ; CHECK-NEXT: i32.const -8
3036 ; CHECK-NEXT: i32.add
3037 ; CHECK-NEXT: v128.load64_splat 0
3038 ; CHECK-NEXT: # fallthrough-return
3039 %s = getelementptr inbounds double, double* %p, i32 -1
3040 %e = load double, double* %s
3041 %v1 = insertelement <2 x double> undef, double %e, i32 0
3042 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3043 ret <2 x double> %v2
3046 define <2 x double> @load_v2f64_with_unfolded_offset(<2 x double>* %p) {
3047 ; CHECK-LABEL: load_v2f64_with_unfolded_offset:
3048 ; CHECK: .functype load_v2f64_with_unfolded_offset (i32) -> (v128)
3049 ; CHECK-NEXT: # %bb.0:
3050 ; CHECK-NEXT: local.get 0
3051 ; CHECK-NEXT: i32.const 16
3052 ; CHECK-NEXT: i32.add
3053 ; CHECK-NEXT: v128.load 0
3054 ; CHECK-NEXT: # fallthrough-return
3055 %q = ptrtoint <2 x double>* %p to i32
3056 %r = add nsw i32 %q, 16
3057 %s = inttoptr i32 %r to <2 x double>*
3058 %v = load <2 x double>, <2 x double>* %s
3062 define <2 x double> @load_splat_v2f64_with_unfolded_offset(double* %p) {
3063 ; CHECK-LABEL: load_splat_v2f64_with_unfolded_offset:
3064 ; CHECK: .functype load_splat_v2f64_with_unfolded_offset (i32) -> (v128)
3065 ; CHECK-NEXT: # %bb.0:
3066 ; CHECK-NEXT: local.get 0
3067 ; CHECK-NEXT: i32.const 16
3068 ; CHECK-NEXT: i32.add
3069 ; CHECK-NEXT: v128.load64_splat 0
3070 ; CHECK-NEXT: # fallthrough-return
3071 %q = ptrtoint double* %p to i32
3072 %r = add nsw i32 %q, 16
3073 %s = inttoptr i32 %r to double*
3074 %e = load double, double* %s
3075 %v1 = insertelement <2 x double> undef, double %e, i32 0
3076 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3077 ret <2 x double> %v2
3080 define <2 x double> @load_v2f64_with_unfolded_gep_offset(<2 x double>* %p) {
3081 ; CHECK-LABEL: load_v2f64_with_unfolded_gep_offset:
3082 ; CHECK: .functype load_v2f64_with_unfolded_gep_offset (i32) -> (v128)
3083 ; CHECK-NEXT: # %bb.0:
3084 ; CHECK-NEXT: local.get 0
3085 ; CHECK-NEXT: i32.const 16
3086 ; CHECK-NEXT: i32.add
3087 ; CHECK-NEXT: v128.load 0
3088 ; CHECK-NEXT: # fallthrough-return
3089 %s = getelementptr <2 x double>, <2 x double>* %p, i32 1
3090 %v = load <2 x double>, <2 x double>* %s
3094 define <2 x double> @load_splat_v2f64_with_unfolded_gep_offset(double* %p) {
3095 ; CHECK-LABEL: load_splat_v2f64_with_unfolded_gep_offset:
3096 ; CHECK: .functype load_splat_v2f64_with_unfolded_gep_offset (i32) -> (v128)
3097 ; CHECK-NEXT: # %bb.0:
3098 ; CHECK-NEXT: local.get 0
3099 ; CHECK-NEXT: i32.const 8
3100 ; CHECK-NEXT: i32.add
3101 ; CHECK-NEXT: v128.load64_splat 0
3102 ; CHECK-NEXT: # fallthrough-return
3103 %s = getelementptr double, double* %p, i32 1
3104 %e = load double, double* %s
3105 %v1 = insertelement <2 x double> undef, double %e, i32 0
3106 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3107 ret <2 x double> %v2
3110 define <2 x double> @load_v2f64_from_numeric_address() {
3111 ; CHECK-LABEL: load_v2f64_from_numeric_address:
3112 ; CHECK: .functype load_v2f64_from_numeric_address () -> (v128)
3113 ; CHECK-NEXT: # %bb.0:
3114 ; CHECK-NEXT: i32.const 0
3115 ; CHECK-NEXT: v128.load 32
3116 ; CHECK-NEXT: # fallthrough-return
3117 %s = inttoptr i32 32 to <2 x double>*
3118 %v = load <2 x double>, <2 x double>* %s
3122 define <2 x double> @load_splat_v2f64_from_numeric_address() {
3123 ; CHECK-LABEL: load_splat_v2f64_from_numeric_address:
3124 ; CHECK: .functype load_splat_v2f64_from_numeric_address () -> (v128)
3125 ; CHECK-NEXT: # %bb.0:
3126 ; CHECK-NEXT: i32.const 0
3127 ; CHECK-NEXT: v128.load64_splat 32
3128 ; CHECK-NEXT: # fallthrough-return
3129 %s = inttoptr i32 32 to double*
3130 %e = load double, double* %s
3131 %v1 = insertelement <2 x double> undef, double %e, i32 0
3132 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3133 ret <2 x double> %v2
3136 @gv_v2f64 = global <2 x double> <double 42., double 42.>
3137 define <2 x double> @load_v2f64_from_global_address() {
3138 ; CHECK-LABEL: load_v2f64_from_global_address:
3139 ; CHECK: .functype load_v2f64_from_global_address () -> (v128)
3140 ; CHECK-NEXT: # %bb.0:
3141 ; CHECK-NEXT: i32.const 0
3142 ; CHECK-NEXT: v128.load gv_v2f64
3143 ; CHECK-NEXT: # fallthrough-return
3144 %v = load <2 x double>, <2 x double>* @gv_v2f64
3148 @gv_f64 = global double 42.
3149 define <2 x double> @load_splat_v2f64_from_global_address() {
3150 ; CHECK-LABEL: load_splat_v2f64_from_global_address:
3151 ; CHECK: .functype load_splat_v2f64_from_global_address () -> (v128)
3152 ; CHECK-NEXT: # %bb.0:
3153 ; CHECK-NEXT: i32.const 0
3154 ; CHECK-NEXT: v128.load64_splat gv_f64
3155 ; CHECK-NEXT: # fallthrough-return
3156 %e = load double, double* @gv_f64
3157 %v1 = insertelement <2 x double> undef, double %e, i32 0
3158 %v2 = shufflevector <2 x double> %v1, <2 x double> undef, <2 x i32> zeroinitializer
3159 ret <2 x double> %v2
3162 define void @store_v2f64(<2 x double> %v, <2 x double>* %p) {
3163 ; CHECK-LABEL: store_v2f64:
3164 ; CHECK: .functype store_v2f64 (v128, i32) -> ()
3165 ; CHECK-NEXT: # %bb.0:
3166 ; CHECK-NEXT: local.get 1
3167 ; CHECK-NEXT: local.get 0
3168 ; CHECK-NEXT: v128.store 0
3169 ; CHECK-NEXT: # fallthrough-return
3170 store <2 x double> %v , <2 x double>* %p
3174 define void @store_v2f64_with_folded_offset(<2 x double> %v, <2 x double>* %p) {
3175 ; CHECK-LABEL: store_v2f64_with_folded_offset:
3176 ; CHECK: .functype store_v2f64_with_folded_offset (v128, i32) -> ()
3177 ; CHECK-NEXT: # %bb.0:
3178 ; CHECK-NEXT: local.get 1
3179 ; CHECK-NEXT: local.get 0
3180 ; CHECK-NEXT: v128.store 16
3181 ; CHECK-NEXT: # fallthrough-return
3182 %q = ptrtoint <2 x double>* %p to i32
3183 %r = add nuw i32 %q, 16
3184 %s = inttoptr i32 %r to <2 x double>*
3185 store <2 x double> %v , <2 x double>* %s
3189 define void @store_v2f64_with_folded_gep_offset(<2 x double> %v, <2 x double>* %p) {
3190 ; CHECK-LABEL: store_v2f64_with_folded_gep_offset:
3191 ; CHECK: .functype store_v2f64_with_folded_gep_offset (v128, i32) -> ()
3192 ; CHECK-NEXT: # %bb.0:
3193 ; CHECK-NEXT: local.get 1
3194 ; CHECK-NEXT: local.get 0
3195 ; CHECK-NEXT: v128.store 16
3196 ; CHECK-NEXT: # fallthrough-return
3197 %s = getelementptr inbounds <2 x double>, <2 x double>* %p, i32 1
3198 store <2 x double> %v , <2 x double>* %s
3202 define void @store_v2f64_with_unfolded_gep_negative_offset(<2 x double> %v, <2 x double>* %p) {
3203 ; CHECK-LABEL: store_v2f64_with_unfolded_gep_negative_offset:
3204 ; CHECK: .functype store_v2f64_with_unfolded_gep_negative_offset (v128, i32) -> ()
3205 ; CHECK-NEXT: # %bb.0:
3206 ; CHECK-NEXT: local.get 1
3207 ; CHECK-NEXT: i32.const -16
3208 ; CHECK-NEXT: i32.add
3209 ; CHECK-NEXT: local.get 0
3210 ; CHECK-NEXT: v128.store 0
3211 ; CHECK-NEXT: # fallthrough-return
3212 %s = getelementptr inbounds <2 x double>, <2 x double>* %p, i32 -1
3213 store <2 x double> %v , <2 x double>* %s
3217 define void @store_v2f64_with_unfolded_offset(<2 x double> %v, <2 x double>* %p) {
3218 ; CHECK-LABEL: store_v2f64_with_unfolded_offset:
3219 ; CHECK: .functype store_v2f64_with_unfolded_offset (v128, i32) -> ()
3220 ; CHECK-NEXT: # %bb.0:
3221 ; CHECK-NEXT: local.get 1
3222 ; CHECK-NEXT: i32.const 16
3223 ; CHECK-NEXT: i32.add
3224 ; CHECK-NEXT: local.get 0
3225 ; CHECK-NEXT: v128.store 0
3226 ; CHECK-NEXT: # fallthrough-return
3227 %q = ptrtoint <2 x double>* %p to i32
3228 %r = add nsw i32 %q, 16
3229 %s = inttoptr i32 %r to <2 x double>*
3230 store <2 x double> %v , <2 x double>* %s
3234 define void @store_v2f64_with_unfolded_gep_offset(<2 x double> %v, <2 x double>* %p) {
3235 ; CHECK-LABEL: store_v2f64_with_unfolded_gep_offset:
3236 ; CHECK: .functype store_v2f64_with_unfolded_gep_offset (v128, i32) -> ()
3237 ; CHECK-NEXT: # %bb.0:
3238 ; CHECK-NEXT: local.get 1
3239 ; CHECK-NEXT: i32.const 16
3240 ; CHECK-NEXT: i32.add
3241 ; CHECK-NEXT: local.get 0
3242 ; CHECK-NEXT: v128.store 0
3243 ; CHECK-NEXT: # fallthrough-return
3244 %s = getelementptr <2 x double>, <2 x double>* %p, i32 1
3245 store <2 x double> %v , <2 x double>* %s
3249 define void @store_v2f64_to_numeric_address(<2 x double> %v) {
3250 ; CHECK-LABEL: store_v2f64_to_numeric_address:
3251 ; CHECK: .functype store_v2f64_to_numeric_address (v128) -> ()
3252 ; CHECK-NEXT: # %bb.0:
3253 ; CHECK-NEXT: i32.const 0
3254 ; CHECK-NEXT: local.get 0
3255 ; CHECK-NEXT: v128.store 32
3256 ; CHECK-NEXT: # fallthrough-return
3257 %s = inttoptr i32 32 to <2 x double>*
3258 store <2 x double> %v , <2 x double>* %s
3262 define void @store_v2f64_to_global_address(<2 x double> %v) {
3263 ; CHECK-LABEL: store_v2f64_to_global_address:
3264 ; CHECK: .functype store_v2f64_to_global_address (v128) -> ()
3265 ; CHECK-NEXT: # %bb.0:
3266 ; CHECK-NEXT: i32.const 0
3267 ; CHECK-NEXT: local.get 0
3268 ; CHECK-NEXT: v128.store gv_v2f64
3269 ; CHECK-NEXT: # fallthrough-return
3270 store <2 x double> %v , <2 x double>* @gv_v2f64