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
3 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme < %s | FileCheck %s
6 ; Testing prfop encodings
8 define void @test_svprf_pldl1strm(<vscale x 16 x i1> %pg, ptr %base) {
9 ; CHECK-LABEL: test_svprf_pldl1strm:
10 ; CHECK: // %bb.0: // %entry
11 ; CHECK-NEXT: prfb pldl1strm, p0, [x0]
14 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 1)
18 define void @test_svprf_pldl2keep(<vscale x 16 x i1> %pg, ptr %base) {
19 ; CHECK-LABEL: test_svprf_pldl2keep:
20 ; CHECK: // %bb.0: // %entry
21 ; CHECK-NEXT: prfb pldl2keep, p0, [x0]
24 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 2)
28 define void @test_svprf_pldl2strm(<vscale x 16 x i1> %pg, ptr %base) {
29 ; CHECK-LABEL: test_svprf_pldl2strm:
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: prfb pldl2strm, p0, [x0]
34 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 3)
38 define void @test_svprf_pldl3keep(<vscale x 16 x i1> %pg, ptr %base) {
39 ; CHECK-LABEL: test_svprf_pldl3keep:
40 ; CHECK: // %bb.0: // %entry
41 ; CHECK-NEXT: prfb pldl3keep, p0, [x0]
44 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 4)
48 define void @test_svprf_pldl3strm(<vscale x 16 x i1> %pg, ptr %base) {
49 ; CHECK-LABEL: test_svprf_pldl3strm:
50 ; CHECK: // %bb.0: // %entry
51 ; CHECK-NEXT: prfb pldl3strm, p0, [x0]
54 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 5)
58 define void @test_svprf_pstl1keep(<vscale x 16 x i1> %pg, ptr %base) {
59 ; CHECK-LABEL: test_svprf_pstl1keep:
60 ; CHECK: // %bb.0: // %entry
61 ; CHECK-NEXT: prfb pstl1keep, p0, [x0]
64 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 8)
68 define void @test_svprf_pstl1strm(<vscale x 16 x i1> %pg, ptr %base) {
69 ; CHECK-LABEL: test_svprf_pstl1strm:
70 ; CHECK: // %bb.0: // %entry
71 ; CHECK-NEXT: prfb pstl1strm, p0, [x0]
74 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 9)
78 define void @test_svprf_pstl2keep(<vscale x 16 x i1> %pg, ptr %base) {
79 ; CHECK-LABEL: test_svprf_pstl2keep:
80 ; CHECK: // %bb.0: // %entry
81 ; CHECK-NEXT: prfb pstl2keep, p0, [x0]
84 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 10)
88 define void @test_svprf_pstl2strm(<vscale x 16 x i1> %pg, ptr %base) {
89 ; CHECK-LABEL: test_svprf_pstl2strm:
90 ; CHECK: // %bb.0: // %entry
91 ; CHECK-NEXT: prfb pstl2strm, p0, [x0]
94 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 11)
98 define void @test_svprf_pstl3keep(<vscale x 16 x i1> %pg, ptr %base) {
99 ; CHECK-LABEL: test_svprf_pstl3keep:
100 ; CHECK: // %bb.0: // %entry
101 ; CHECK-NEXT: prfb pstl3keep, p0, [x0]
104 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 12)
108 define void @test_svprf_pstl3strm(<vscale x 16 x i1> %pg, ptr %base) {
109 ; CHECK-LABEL: test_svprf_pstl3strm:
110 ; CHECK: // %bb.0: // %entry
111 ; CHECK-NEXT: prfb pstl3strm, p0, [x0]
114 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 13)
119 ; Testing imm limits of SI form
122 define void @test_svprf_vnum_under(<vscale x 16 x i1> %pg, <vscale x 16 x i8>* %base) {
123 ; CHECK-LABEL: test_svprf_vnum_under:
124 ; CHECK: // %bb.0: // %entry
125 ; CHECK-NEXT: rdvl x8, #1
126 ; CHECK-NEXT: mov x9, #-528
127 ; CHECK-NEXT: lsr x8, x8, #4
128 ; CHECK-NEXT: mul x8, x8, x9
129 ; CHECK-NEXT: prfb pstl3strm, p0, [x0, x8]
132 %gep = getelementptr inbounds <vscale x 16 x i8>, <vscale x 16 x i8>* %base, i64 -33, i64 0
133 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %gep, i32 13)
137 define void @test_svprf_vnum_min(<vscale x 16 x i1> %pg, <vscale x 16 x i8>* %base) {
138 ; CHECK-LABEL: test_svprf_vnum_min:
139 ; CHECK: // %bb.0: // %entry
140 ; CHECK-NEXT: prfb pstl3strm, p0, [x0, #-32, mul vl]
143 %gep = getelementptr inbounds <vscale x 16 x i8>, <vscale x 16 x i8>* %base, i64 -32, i64 0
144 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %gep, i32 13)
148 define void @test_svprf_vnum_over(<vscale x 16 x i1> %pg, <vscale x 16 x i8>* %base) {
149 ; CHECK-LABEL: test_svprf_vnum_over:
150 ; CHECK: // %bb.0: // %entry
151 ; CHECK-NEXT: rdvl x8, #1
152 ; CHECK-NEXT: mov w9, #512
153 ; CHECK-NEXT: lsr x8, x8, #4
154 ; CHECK-NEXT: mul x8, x8, x9
155 ; CHECK-NEXT: prfb pstl3strm, p0, [x0, x8]
158 %gep = getelementptr inbounds <vscale x 16 x i8>, <vscale x 16 x i8>* %base, i64 32, i64 0
159 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %gep, i32 13)
163 define void @test_svprf_vnum_max(<vscale x 16 x i1> %pg, <vscale x 16 x i8>* %base) {
164 ; CHECK-LABEL: test_svprf_vnum_max:
165 ; CHECK: // %bb.0: // %entry
166 ; CHECK-NEXT: prfb pstl3strm, p0, [x0, #31, mul vl]
169 %gep = getelementptr inbounds <vscale x 16 x i8>, <vscale x 16 x i8>* %base, i64 31, i64 0
170 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %gep, i32 13)
178 define void @test_svprfb(<vscale x 16 x i1> %pg, ptr %base) {
179 ; CHECK-LABEL: test_svprfb:
180 ; CHECK: // %bb.0: // %entry
181 ; CHECK-NEXT: prfb pldl1keep, p0, [x0]
184 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %base, i32 0)
188 define void @test_svprfh(<vscale x 8 x i1> %pg, ptr %base) {
189 ; CHECK-LABEL: test_svprfh:
190 ; CHECK: // %bb.0: // %entry
191 ; CHECK-NEXT: prfh pldl1keep, p0, [x0]
194 tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> %pg, ptr %base, i32 0)
198 define void @test_svprfw(<vscale x 4 x i1> %pg, ptr %base) {
199 ; CHECK-LABEL: test_svprfw:
200 ; CHECK: // %bb.0: // %entry
201 ; CHECK-NEXT: prfw pldl1keep, p0, [x0]
204 tail call void @llvm.aarch64.sve.prf.nxv4i1(<vscale x 4 x i1> %pg, ptr %base, i32 0)
208 define void @test_svprfd(<vscale x 2 x i1> %pg, ptr %base) {
209 ; CHECK-LABEL: test_svprfd:
210 ; CHECK: // %bb.0: // %entry
211 ; CHECK-NEXT: prfd pldl1keep, p0, [x0]
214 tail call void @llvm.aarch64.sve.prf.nxv2i1(<vscale x 2 x i1> %pg, ptr %base, i32 0)
219 ; scalar + imm contiguous
221 ; imm form of prfb is tested above
223 define void @test_svprfh_vnum(<vscale x 8 x i1> %pg, <vscale x 8 x i16>* %base) {
224 ; CHECK-LABEL: test_svprfh_vnum:
225 ; CHECK: // %bb.0: // %entry
226 ; CHECK-NEXT: prfh pstl3strm, p0, [x0, #31, mul vl]
229 %gep = getelementptr <vscale x 8 x i16>, <vscale x 8 x i16>* %base, i64 31
230 %addr = bitcast <vscale x 8 x i16>* %gep to ptr
231 tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> %pg, ptr %addr, i32 13)
235 define void @test_svprfw_vnum(<vscale x 4 x i1> %pg, <vscale x 4 x i32>* %base) {
236 ; CHECK-LABEL: test_svprfw_vnum:
237 ; CHECK: // %bb.0: // %entry
238 ; CHECK-NEXT: prfw pstl3strm, p0, [x0, #31, mul vl]
241 %gep = getelementptr <vscale x 4 x i32>, <vscale x 4 x i32>* %base, i64 31
242 %addr = bitcast <vscale x 4 x i32>* %gep to ptr
243 tail call void @llvm.aarch64.sve.prf.nxv4i1(<vscale x 4 x i1> %pg, ptr %addr, i32 13)
247 define void @test_svprfd_vnum(<vscale x 2 x i1> %pg, <vscale x 2 x i64>* %base) {
248 ; CHECK-LABEL: test_svprfd_vnum:
249 ; CHECK: // %bb.0: // %entry
250 ; CHECK-NEXT: prfd pstl3strm, p0, [x0, #31, mul vl]
253 %gep = getelementptr <vscale x 2 x i64>, <vscale x 2 x i64>* %base, i64 31
254 %addr = bitcast <vscale x 2 x i64>* %gep to ptr
255 tail call void @llvm.aarch64.sve.prf.nxv2i1(<vscale x 2 x i1> %pg, ptr %addr, i32 13)
260 ; scalar + scaled scalar contiguous
263 define void @test_svprfb_ss(<vscale x 16 x i1> %pg, ptr %base, i64 %offset) {
264 ; CHECK-LABEL: test_svprfb_ss:
265 ; CHECK: // %bb.0: // %entry
266 ; CHECK-NEXT: prfb pstl3strm, p0, [x0, x1]
269 %addr = getelementptr i8, ptr %base, i64 %offset
270 tail call void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1> %pg, ptr %addr, i32 13)
274 define void @test_svprfh_ss(<vscale x 8 x i1> %pg, ptr %base, i64 %offset) {
275 ; CHECK-LABEL: test_svprfh_ss:
276 ; CHECK: // %bb.0: // %entry
277 ; CHECK-NEXT: prfh pstl3strm, p0, [x0, x1, lsl #1]
280 %gep = getelementptr i16, ptr %base, i64 %offset
281 tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> %pg, ptr %gep, i32 13)
285 define void @test_svprfw_ss(<vscale x 4 x i1> %pg, ptr %base, i64 %offset) {
286 ; CHECK-LABEL: test_svprfw_ss:
287 ; CHECK: // %bb.0: // %entry
288 ; CHECK-NEXT: prfw pstl3strm, p0, [x0, x1, lsl #2]
291 %gep = getelementptr i32, ptr %base, i64 %offset
292 tail call void @llvm.aarch64.sve.prf.nxv4i1(<vscale x 4 x i1> %pg, ptr %gep, i32 13)
296 define void @test_svprfd_ss(<vscale x 2 x i1> %pg, ptr %base, i64 %offset) {
297 ; CHECK-LABEL: test_svprfd_ss:
298 ; CHECK: // %bb.0: // %entry
299 ; CHECK-NEXT: prfd pstl3strm, p0, [x0, x1, lsl #3]
302 %gep = getelementptr i64, ptr %base, i64 %offset
303 tail call void @llvm.aarch64.sve.prf.nxv2i1(<vscale x 2 x i1> %pg, ptr %gep, i32 13)
308 declare void @llvm.aarch64.sve.prf.nxv16i1(<vscale x 16 x i1>, ptr, i32)
309 declare void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1>, ptr, i32)
310 declare void @llvm.aarch64.sve.prf.nxv4i1(<vscale x 4 x i1>, ptr, i32)
311 declare void @llvm.aarch64.sve.prf.nxv2i1(<vscale x 2 x i1>, ptr, i32)