1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
7 define <8 x i16> @load_zext_v8i8i16(ptr %ap) {
8 ; CHECK-LABEL: load_zext_v8i8i16:
10 ; CHECK-NEXT: ptrue p0.h, vl8
11 ; CHECK-NEXT: ld1b { z0.h }, p0/z, [x0]
12 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
14 %a = load <8 x i8>, ptr %ap
15 %val = zext <8 x i8> %a to <8 x i16>
19 define <4 x i32> @load_zext_v4i16i32(ptr %ap) {
20 ; CHECK-LABEL: load_zext_v4i16i32:
22 ; CHECK-NEXT: ptrue p0.s, vl4
23 ; CHECK-NEXT: ld1h { z0.s }, p0/z, [x0]
24 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
26 %a = load <4 x i16>, ptr %ap
27 %val = zext <4 x i16> %a to <4 x i32>
31 define <2 x i64> @load_zext_v2i32i64(ptr %ap) {
32 ; CHECK-LABEL: load_zext_v2i32i64:
34 ; CHECK-NEXT: ptrue p0.d, vl2
35 ; CHECK-NEXT: ld1w { z0.d }, p0/z, [x0]
36 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
38 %a = load <2 x i32>, ptr %ap
39 %val = zext <2 x i32> %a to <2 x i64>
43 define <2 x i256> @load_zext_v2i64i256(ptr %ap) {
44 ; CHECK-LABEL: load_zext_v2i64i256:
46 ; CHECK-NEXT: ldr q0, [x0]
47 ; CHECK-NEXT: mov x1, xzr
48 ; CHECK-NEXT: mov x2, xzr
49 ; CHECK-NEXT: mov x3, xzr
50 ; CHECK-NEXT: mov x5, xzr
51 ; CHECK-NEXT: mov x6, xzr
52 ; CHECK-NEXT: mov z1.d, z0.d[1]
53 ; CHECK-NEXT: fmov x0, d0
54 ; CHECK-NEXT: mov x7, xzr
55 ; CHECK-NEXT: fmov x4, d1
57 %a = load <2 x i64>, ptr %ap
58 %val = zext <2 x i64> %a to <2 x i256>
62 define <16 x i32> @load_sext_v16i8i32(ptr %ap) {
63 ; CHECK-LABEL: load_sext_v16i8i32:
65 ; CHECK-NEXT: ptrue p0.s, vl4
66 ; CHECK-NEXT: mov w8, #4 // =0x4
67 ; CHECK-NEXT: mov w9, #8 // =0x8
68 ; CHECK-NEXT: mov w10, #12 // =0xc
69 ; CHECK-NEXT: ld1sb { z1.s }, p0/z, [x0, x8]
70 ; CHECK-NEXT: ld1sb { z2.s }, p0/z, [x0, x9]
71 ; CHECK-NEXT: ld1sb { z3.s }, p0/z, [x0, x10]
72 ; CHECK-NEXT: ld1sb { z0.s }, p0/z, [x0]
73 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
74 ; CHECK-NEXT: // kill: def $q2 killed $q2 killed $z2
75 ; CHECK-NEXT: // kill: def $q3 killed $q3 killed $z3
76 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
78 %a = load <16 x i8>, ptr %ap
79 %val = sext <16 x i8> %a to <16 x i32>
83 define <8 x i32> @load_sext_v8i16i32(ptr %ap) {
84 ; CHECK-LABEL: load_sext_v8i16i32:
86 ; CHECK-NEXT: ptrue p0.s, vl4
87 ; CHECK-NEXT: mov x8, #4 // =0x4
88 ; CHECK-NEXT: ld1sh { z1.s }, p0/z, [x0, x8, lsl #1]
89 ; CHECK-NEXT: ld1sh { z0.s }, p0/z, [x0]
90 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
91 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
93 %a = load <8 x i16>, ptr %ap
94 %val = sext <8 x i16> %a to <8 x i32>
98 define <4 x i256> @load_sext_v4i32i256(ptr %ap) {
99 ; CHECK-LABEL: load_sext_v4i32i256:
101 ; CHECK-NEXT: ldr q0, [x0]
102 ; CHECK-NEXT: sunpklo z1.d, z0.s
103 ; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
104 ; CHECK-NEXT: sunpklo z0.d, z0.s
105 ; CHECK-NEXT: fmov x9, d1
106 ; CHECK-NEXT: mov z1.d, z1.d[1]
107 ; CHECK-NEXT: fmov x11, d0
108 ; CHECK-NEXT: mov z0.d, z0.d[1]
109 ; CHECK-NEXT: asr x10, x9, #63
110 ; CHECK-NEXT: stp x9, x10, [x8]
111 ; CHECK-NEXT: fmov x9, d1
112 ; CHECK-NEXT: asr x12, x11, #63
113 ; CHECK-NEXT: stp x10, x10, [x8, #16]
114 ; CHECK-NEXT: stp x11, x12, [x8, #64]
115 ; CHECK-NEXT: fmov x11, d0
116 ; CHECK-NEXT: asr x10, x9, #63
117 ; CHECK-NEXT: stp x12, x12, [x8, #80]
118 ; CHECK-NEXT: stp x10, x10, [x8, #48]
119 ; CHECK-NEXT: asr x12, x11, #63
120 ; CHECK-NEXT: stp x9, x10, [x8, #32]
121 ; CHECK-NEXT: stp x12, x12, [x8, #112]
122 ; CHECK-NEXT: stp x11, x12, [x8, #96]
124 %a = load <4 x i32>, ptr %ap
125 %val = sext <4 x i32> %a to <4 x i256>
129 define <2 x i256> @load_sext_v2i64i256(ptr %ap) {
130 ; CHECK-LABEL: load_sext_v2i64i256:
132 ; CHECK-NEXT: ldr q0, [x0]
133 ; CHECK-NEXT: fmov x8, d0
134 ; CHECK-NEXT: mov z1.d, z0.d[1]
135 ; CHECK-NEXT: asr x9, x8, #63
136 ; CHECK-NEXT: fmov x10, d1
137 ; CHECK-NEXT: stp x8, x9, [sp, #-32]!
138 ; CHECK-NEXT: .cfi_def_cfa_offset 32
139 ; CHECK-NEXT: asr x8, x10, #63
140 ; CHECK-NEXT: mov z0.d, x9
141 ; CHECK-NEXT: stp x10, x8, [sp, #16]
142 ; CHECK-NEXT: mov z1.d, x8
143 ; CHECK-NEXT: ldp q2, q4, [sp], #32
144 ; CHECK-NEXT: mov z3.d, z0.d[1]
145 ; CHECK-NEXT: mov z5.d, z1.d[1]
146 ; CHECK-NEXT: mov z6.d, z2.d[1]
147 ; CHECK-NEXT: fmov x2, d0
148 ; CHECK-NEXT: mov z0.d, z4.d[1]
149 ; CHECK-NEXT: fmov x6, d1
150 ; CHECK-NEXT: fmov x0, d2
151 ; CHECK-NEXT: fmov x4, d4
152 ; CHECK-NEXT: fmov x3, d3
153 ; CHECK-NEXT: fmov x7, d5
154 ; CHECK-NEXT: fmov x1, d6
155 ; CHECK-NEXT: fmov x5, d0
157 %a = load <2 x i64>, ptr %ap
158 %val = sext <2 x i64> %a to <2 x i256>
162 define <16 x i64> @load_zext_v16i16i64(ptr %ap) {
163 ; CHECK-LABEL: load_zext_v16i16i64:
165 ; CHECK-NEXT: ptrue p0.d, vl2
166 ; CHECK-NEXT: mov x8, #2 // =0x2
167 ; CHECK-NEXT: mov x9, #4 // =0x4
168 ; CHECK-NEXT: ld1h { z1.d }, p0/z, [x0, x8, lsl #1]
169 ; CHECK-NEXT: mov x8, #6 // =0x6
170 ; CHECK-NEXT: ld1h { z2.d }, p0/z, [x0, x9, lsl #1]
171 ; CHECK-NEXT: mov x9, #8 // =0x8
172 ; CHECK-NEXT: ld1h { z3.d }, p0/z, [x0, x8, lsl #1]
173 ; CHECK-NEXT: mov x8, #10 // =0xa
174 ; CHECK-NEXT: ld1h { z4.d }, p0/z, [x0, x9, lsl #1]
175 ; CHECK-NEXT: mov x9, #12 // =0xc
176 ; CHECK-NEXT: ld1h { z5.d }, p0/z, [x0, x8, lsl #1]
177 ; CHECK-NEXT: mov x8, #14 // =0xe
178 ; CHECK-NEXT: ld1h { z6.d }, p0/z, [x0, x9, lsl #1]
179 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
180 ; CHECK-NEXT: // kill: def $q2 killed $q2 killed $z2
181 ; CHECK-NEXT: // kill: def $q3 killed $q3 killed $z3
182 ; CHECK-NEXT: // kill: def $q4 killed $q4 killed $z4
183 ; CHECK-NEXT: // kill: def $q5 killed $q5 killed $z5
184 ; CHECK-NEXT: ld1h { z7.d }, p0/z, [x0, x8, lsl #1]
185 ; CHECK-NEXT: ld1h { z0.d }, p0/z, [x0]
186 ; CHECK-NEXT: // kill: def $q6 killed $q6 killed $z6
187 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
188 ; CHECK-NEXT: // kill: def $q7 killed $q7 killed $z7
190 %a = load <16 x i16>, ptr %ap
191 %val = zext <16 x i16> %a to <16 x i64>