1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
4 define <vscale x 2 x i64> @sti64ldi64(<vscale x 2 x i64>* nocapture %P, <vscale x 2 x i64> %v) {
5 ; CHECK-LABEL: sti64ldi64:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: ptrue p0.d
8 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
11 %arrayidx0 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
12 store <vscale x 2 x i64> %v, <vscale x 2 x i64>* %arrayidx0
13 %arrayidx1 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
14 %0 = load <vscale x 2 x i64>, <vscale x 2 x i64>* %arrayidx1
15 ret <vscale x 2 x i64> %0
18 define <vscale x 2 x double> @stf64ldf64(<vscale x 2 x double>* nocapture %P, <vscale x 2 x double> %v) {
19 ; CHECK-LABEL: stf64ldf64:
20 ; CHECK: // %bb.0: // %entry
21 ; CHECK-NEXT: ptrue p0.d
22 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
25 %arrayidx0 = getelementptr inbounds <vscale x 2 x double>, <vscale x 2 x double>* %P, i64 1
26 store <vscale x 2 x double> %v, <vscale x 2 x double>* %arrayidx0
27 %arrayidx1 = getelementptr inbounds <vscale x 2 x double>, <vscale x 2 x double>* %P, i64 1
28 %0 = load <vscale x 2 x double>, <vscale x 2 x double>* %arrayidx1
29 ret <vscale x 2 x double> %0
32 define <vscale x 2 x i64> @sti32ldi32ext(<vscale x 2 x i32>* nocapture %P, <vscale x 2 x i64> %v) {
33 ; CHECK-LABEL: sti32ldi32ext:
34 ; CHECK: // %bb.0: // %entry
35 ; CHECK-NEXT: ptrue p0.d
36 ; CHECK-NEXT: movprfx z1, z0
37 ; CHECK-NEXT: sxtw z1.d, p0/m, z0.d
38 ; CHECK-NEXT: st1w { z0.d }, p0, [x0]
39 ; CHECK-NEXT: mov z0.d, z1.d
42 %0 = trunc <vscale x 2 x i64> %v to <vscale x 2 x i32>
43 store <vscale x 2 x i32> %0, <vscale x 2 x i32>* %P
44 %1 = load <vscale x 2 x i32>, <vscale x 2 x i32>* %P
45 %2 = sext <vscale x 2 x i32> %1 to <vscale x 2 x i64>
46 ret <vscale x 2 x i64> %2
49 define <2 x i64> @sti64ldfixedi64(<vscale x 2 x i64>* nocapture %P, <vscale x 2 x i64> %v) {
50 ; CHECK-LABEL: sti64ldfixedi64:
51 ; CHECK: // %bb.0: // %entry
52 ; CHECK-NEXT: ptrue p0.d
53 ; CHECK-NEXT: rdvl x8, #1
54 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
55 ; CHECK-NEXT: ldr q0, [x0, x8]
58 %arrayidx0 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
59 store <vscale x 2 x i64> %v, <vscale x 2 x i64>* %arrayidx0
60 %arrayidx1 = bitcast <vscale x 2 x i64>* %arrayidx0 to <2 x i64>*
61 %0 = load <2 x i64>, <2 x i64>* %arrayidx1
65 define <vscale x 4 x i32> @sti64ldi32(<vscale x 2 x i64>* nocapture %P, <vscale x 2 x i64> %v) {
66 ; CHECK-LABEL: sti64ldi32:
67 ; CHECK: // %bb.0: // %entry
68 ; CHECK-NEXT: ptrue p0.d
69 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
70 ; CHECK-NEXT: ptrue p0.s
71 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0, #1, mul vl]
74 %0 = bitcast <vscale x 2 x i64>* %P to <vscale x 4 x i32>*
75 %arrayidx0 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
76 store <vscale x 2 x i64> %v, <vscale x 2 x i64>* %arrayidx0
77 %arrayidx1 = getelementptr inbounds <vscale x 4 x i32>, <vscale x 4 x i32>* %0, i64 1
78 %1 = load <vscale x 4 x i32>, <vscale x 4 x i32>* %arrayidx1
79 ret <vscale x 4 x i32> %1
82 define <vscale x 2 x i64> @stf64ldi64(<vscale x 2 x double>* nocapture %P, <vscale x 2 x double> %v) {
83 ; CHECK-LABEL: stf64ldi64:
84 ; CHECK: // %bb.0: // %entry
85 ; CHECK-NEXT: ptrue p0.d
86 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
87 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, #1, mul vl]
90 %0 = bitcast <vscale x 2 x double>* %P to <vscale x 2 x i64>*
91 %arrayidx0 = getelementptr inbounds <vscale x 2 x double>, <vscale x 2 x double>* %P, i64 1
92 store <vscale x 2 x double> %v, <vscale x 2 x double>* %arrayidx0
93 %arrayidx1 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %0, i64 1
94 %1 = load <vscale x 2 x i64>, <vscale x 2 x i64>* %arrayidx1
95 ret <vscale x 2 x i64> %1