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: mov z1.d, z0.d
37 ; CHECK-NEXT: sxtw z0.d, p0/m, z0.d
38 ; CHECK-NEXT: st1w { z1.d }, p0, [x0]
41 %0 = trunc <vscale x 2 x i64> %v to <vscale x 2 x i32>
42 store <vscale x 2 x i32> %0, <vscale x 2 x i32>* %P
43 %1 = load <vscale x 2 x i32>, <vscale x 2 x i32>* %P
44 %2 = sext <vscale x 2 x i32> %1 to <vscale x 2 x i64>
45 ret <vscale x 2 x i64> %2
48 define <2 x i64> @sti64ldfixedi64(<vscale x 2 x i64>* nocapture %P, <vscale x 2 x i64> %v) {
49 ; CHECK-LABEL: sti64ldfixedi64:
50 ; CHECK: // %bb.0: // %entry
51 ; CHECK-NEXT: ptrue p0.d
52 ; CHECK-NEXT: rdvl x8, #1
53 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
54 ; CHECK-NEXT: ldr q0, [x0, x8]
57 %arrayidx0 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
58 store <vscale x 2 x i64> %v, <vscale x 2 x i64>* %arrayidx0
59 %arrayidx1 = bitcast <vscale x 2 x i64>* %arrayidx0 to <2 x i64>*
60 %0 = load <2 x i64>, <2 x i64>* %arrayidx1
64 define <vscale x 4 x i32> @sti64ldi32(<vscale x 2 x i64>* nocapture %P, <vscale x 2 x i64> %v) {
65 ; CHECK-LABEL: sti64ldi32:
66 ; CHECK: // %bb.0: // %entry
67 ; CHECK-NEXT: ptrue p0.d
68 ; CHECK-NEXT: ptrue p1.s
69 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
70 ; CHECK-NEXT: ld1w { z0.s }, p1/z, [x0, #1, mul vl]
73 %0 = bitcast <vscale x 2 x i64>* %P to <vscale x 4 x i32>*
74 %arrayidx0 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %P, i64 1
75 store <vscale x 2 x i64> %v, <vscale x 2 x i64>* %arrayidx0
76 %arrayidx1 = getelementptr inbounds <vscale x 4 x i32>, <vscale x 4 x i32>* %0, i64 1
77 %1 = load <vscale x 4 x i32>, <vscale x 4 x i32>* %arrayidx1
78 ret <vscale x 4 x i32> %1
81 define <vscale x 2 x i64> @stf64ldi64(<vscale x 2 x double>* nocapture %P, <vscale x 2 x double> %v) {
82 ; CHECK-LABEL: stf64ldi64:
83 ; CHECK: // %bb.0: // %entry
84 ; CHECK-NEXT: ptrue p0.d
85 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, #1, mul vl]
86 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, #1, mul vl]
89 %0 = bitcast <vscale x 2 x double>* %P to <vscale x 2 x i64>*
90 %arrayidx0 = getelementptr inbounds <vscale x 2 x double>, <vscale x 2 x double>* %P, i64 1
91 store <vscale x 2 x double> %v, <vscale x 2 x double>* %arrayidx0
92 %arrayidx1 = getelementptr inbounds <vscale x 2 x i64>, <vscale x 2 x i64>* %0, i64 1
93 %1 = load <vscale x 2 x i64>, <vscale x 2 x i64>* %arrayidx1
94 ret <vscale x 2 x i64> %1