1 ; RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve --asm-verbose=false < %s | FileCheck %s
3 ; 2-lane non-temporal load/stores
5 define void @test_masked_ldst_sv2i64(ptr %base, <vscale x 2 x i1> %mask, i64 %offset) nounwind {
6 ; CHECK-LABEL: test_masked_ldst_sv2i64:
7 ; CHECK-NEXT: ldnt1d { z[[DATA:[0-9]+]].d }, p0/z, [x0, x1, lsl #3]
8 ; CHECK-NEXT: stnt1d { z[[DATA]].d }, p0, [x0, x1, lsl #3]
10 %gep = getelementptr i64, ptr %base, i64 %offset
11 %data = call <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.nxv2i64(<vscale x 2 x i1> %mask,
13 call void @llvm.aarch64.sve.stnt1.nxv2i64(<vscale x 2 x i64> %data,
14 <vscale x 2 x i1> %mask,
19 define void @test_masked_ldst_sv2f64(ptr %base, <vscale x 2 x i1> %mask, i64 %offset) nounwind {
20 ; CHECK-LABEL: test_masked_ldst_sv2f64:
21 ; CHECK-NEXT: ldnt1d { z[[DATA:[0-9]+]].d }, p0/z, [x0, x1, lsl #3]
22 ; CHECK-NEXT: stnt1d { z[[DATA]].d }, p0, [x0, x1, lsl #3]
24 %gep = getelementptr double, ptr %base, i64 %offset
25 %data = call <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.nxv2f64(<vscale x 2 x i1> %mask,
27 call void @llvm.aarch64.sve.stnt1.nxv2f64(<vscale x 2 x double> %data,
28 <vscale x 2 x i1> %mask,
33 ; 4-lane non-temporal load/stores.
35 define void @test_masked_ldst_sv4i32(ptr %base, <vscale x 4 x i1> %mask, i64 %offset) nounwind {
36 ; CHECK-LABEL: test_masked_ldst_sv4i32:
37 ; CHECK-NEXT: ldnt1w { z[[DATA:[0-9]+]].s }, p0/z, [x0, x1, lsl #2]
38 ; CHECK-NEXT: stnt1w { z[[DATA]].s }, p0, [x0, x1, lsl #2]
40 %gep = getelementptr i32, ptr %base, i64 %offset
41 %data = call <vscale x 4 x i32> @llvm.aarch64.sve.ldnt1.nxv4i32(<vscale x 4 x i1> %mask,
43 call void @llvm.aarch64.sve.stnt1.nxv4i32(<vscale x 4 x i32> %data,
44 <vscale x 4 x i1> %mask,
49 define void @test_masked_ldst_sv4f32(ptr %base, <vscale x 4 x i1> %mask, i64 %offset) nounwind {
50 ; CHECK-LABEL: test_masked_ldst_sv4f32:
51 ; CHECK-NEXT: ldnt1w { z[[DATA:[0-9]+]].s }, p0/z, [x0, x1, lsl #2]
52 ; CHECK-NEXT: stnt1w { z[[DATA]].s }, p0, [x0, x1, lsl #2]
54 %gep = getelementptr float, ptr %base, i64 %offset
55 %data = call <vscale x 4 x float> @llvm.aarch64.sve.ldnt1.nxv4f32(<vscale x 4 x i1> %mask,
57 call void @llvm.aarch64.sve.stnt1.nxv4f32(<vscale x 4 x float> %data,
58 <vscale x 4 x i1> %mask,
64 ; 8-lane non-temporal load/stores.
66 define void @test_masked_ldst_sv8i16(ptr %base, <vscale x 8 x i1> %mask, i64 %offset) nounwind {
67 ; CHECK-LABEL: test_masked_ldst_sv8i16:
68 ; CHECK-NEXT: ldnt1h { z[[DATA:[0-9]+]].h }, p0/z, [x0, x1, lsl #1]
69 ; CHECK-NEXT: stnt1h { z[[DATA]].h }, p0, [x0, x1, lsl #1]
71 %gep = getelementptr i16, ptr %base, i64 %offset
72 %data = call <vscale x 8 x i16> @llvm.aarch64.sve.ldnt1.nxv8i16(<vscale x 8 x i1> %mask,
74 call void @llvm.aarch64.sve.stnt1.nxv8i16(<vscale x 8 x i16> %data,
75 <vscale x 8 x i1> %mask,
80 define void @test_masked_ldst_sv8f16(ptr %base, <vscale x 8 x i1> %mask, i64 %offset) nounwind {
81 ; CHECK-LABEL: test_masked_ldst_sv8f16:
82 ; CHECK-NEXT: ldnt1h { z[[DATA:[0-9]+]].h }, p0/z, [x0, x1, lsl #1]
83 ; CHECK-NEXT: stnt1h { z[[DATA]].h }, p0, [x0, x1, lsl #1]
85 %gep = getelementptr half, ptr %base, i64 %offset
86 %data = call <vscale x 8 x half> @llvm.aarch64.sve.ldnt1.nxv8f16(<vscale x 8 x i1> %mask,
88 call void @llvm.aarch64.sve.stnt1.nxv8f16(<vscale x 8 x half> %data,
89 <vscale x 8 x i1> %mask,
94 define void @test_masked_ldst_sv8bf16(ptr %base, <vscale x 8 x i1> %mask, i64 %offset) nounwind #0 {
95 ; CHECK-LABEL: test_masked_ldst_sv8bf16:
96 ; CHECK-NEXT: ldnt1h { z[[DATA:[0-9]+]].h }, p0/z, [x0, x1, lsl #1]
97 ; CHECK-NEXT: stnt1h { z[[DATA]].h }, p0, [x0, x1, lsl #1]
99 %gep = getelementptr bfloat, ptr %base, i64 %offset
100 %data = call <vscale x 8 x bfloat> @llvm.aarch64.sve.ldnt1.nxv8bf16(<vscale x 8 x i1> %mask,
102 call void @llvm.aarch64.sve.stnt1.nxv8bf16(<vscale x 8 x bfloat> %data,
103 <vscale x 8 x i1> %mask,
108 ; 16-lane non-temporal load/stores.
110 define void @test_masked_ldst_sv16i8(ptr %base, <vscale x 16 x i1> %mask, i64 %offset) nounwind {
111 ; CHECK-LABEL: test_masked_ldst_sv16i8:
112 ; CHECK-NEXT: ldnt1b { z[[DATA:[0-9]+]].b }, p0/z, [x0, x1]
113 ; CHECK-NEXT: stnt1b { z[[DATA]].b }, p0, [x0, x1]
115 %gep = getelementptr i8, ptr %base, i64 %offset
116 %data = call <vscale x 16 x i8> @llvm.aarch64.sve.ldnt1.nxv16i8(<vscale x 16 x i1> %mask,
118 call void @llvm.aarch64.sve.stnt1.nxv16i8(<vscale x 16 x i8> %data,
119 <vscale x 16 x i1> %mask,
124 ; 2-element non-temporal loads.
125 declare <vscale x 2 x i64> @llvm.aarch64.sve.ldnt1.nxv2i64(<vscale x 2 x i1>, ptr)
126 declare <vscale x 2 x double> @llvm.aarch64.sve.ldnt1.nxv2f64(<vscale x 2 x i1>, ptr)
128 ; 4-element non-temporal loads.
129 declare <vscale x 4 x i32> @llvm.aarch64.sve.ldnt1.nxv4i32(<vscale x 4 x i1>, ptr)
130 declare <vscale x 4 x float> @llvm.aarch64.sve.ldnt1.nxv4f32(<vscale x 4 x i1>, ptr)
132 ; 8-element non-temporal loads.
133 declare <vscale x 8 x i16> @llvm.aarch64.sve.ldnt1.nxv8i16(<vscale x 8 x i1>, ptr)
134 declare <vscale x 8 x half> @llvm.aarch64.sve.ldnt1.nxv8f16(<vscale x 8 x i1>, ptr)
135 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.ldnt1.nxv8bf16(<vscale x 8 x i1>, ptr)
137 ; 16-element non-temporal loads.
138 declare <vscale x 16 x i8> @llvm.aarch64.sve.ldnt1.nxv16i8(<vscale x 16 x i1>, ptr)
140 ; 2-element non-temporal stores.
141 declare void @llvm.aarch64.sve.stnt1.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, ptr)
142 declare void @llvm.aarch64.sve.stnt1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, ptr)
144 ; 4-element non-temporal stores.
145 declare void @llvm.aarch64.sve.stnt1.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, ptr)
146 declare void @llvm.aarch64.sve.stnt1.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, ptr)
148 ; 8-element non-temporal stores.
149 declare void @llvm.aarch64.sve.stnt1.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, ptr)
150 declare void @llvm.aarch64.sve.stnt1.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, ptr)
151 declare void @llvm.aarch64.sve.stnt1.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x i1>, ptr)
153 ; 16-element non-temporal stores.
154 declare void @llvm.aarch64.sve.stnt1.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, ptr)
156 ; +bf16 is required for the bfloat version.
157 attributes #0 = { "target-features"="+sve,+bf16" }