1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1,+bf16 < %s | FileCheck %s
5 ; LD1Q: vector base + unscaled offset
6 ; e.g. ld1q { z0.q }, p0/z, [z0.d, x0]
8 define <vscale x 16 x i8> @ld1q_gather_u64base_i8(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
9 ; CHECK-LABEL: ld1q_gather_u64base_i8:
11 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
13 %load = call <vscale x 16 x i8> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv16i8.nxv2i64(<vscale x 1 x i1> %pg,
14 <vscale x 2 x i64> %base,
16 ret <vscale x 16 x i8> %load
19 define <vscale x 8 x i16> @ld1q_gather_u64base_i16(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
20 ; CHECK-LABEL: ld1q_gather_u64base_i16:
22 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
24 %load = call <vscale x 8 x i16> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8i16.nxv2i64(<vscale x 1 x i1> %pg,
25 <vscale x 2 x i64> %base,
27 ret <vscale x 8 x i16> %load
30 define <vscale x 4 x i32> @ld1q_gather_u64base_i32(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
31 ; CHECK-LABEL: ld1q_gather_u64base_i32:
33 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
35 %load = call <vscale x 4 x i32> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv4i32.nxv2i64(<vscale x 1 x i1> %pg,
36 <vscale x 2 x i64> %base,
38 ret <vscale x 4 x i32> %load
41 define <vscale x 2 x i64> @ld1q_gather_u64base_i64(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
42 ; CHECK-LABEL: ld1q_gather_u64base_i64:
44 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
46 %load = call <vscale x 2 x i64> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv2i64.nxv2i64(<vscale x 1 x i1> %pg,
47 <vscale x 2 x i64> %base,
49 ret <vscale x 2 x i64> %load
52 define <vscale x 8 x half> @ld1q_gather_u64base_f16(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
53 ; CHECK-LABEL: ld1q_gather_u64base_f16:
55 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
57 %load = call <vscale x 8 x half> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8f16.nxv2i64(<vscale x 1 x i1> %pg,
58 <vscale x 2 x i64> %base,
60 ret <vscale x 8 x half> %load
63 define <vscale x 4 x float> @ld1q_gather_u64base_f32(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
64 ; CHECK-LABEL: ld1q_gather_u64base_f32:
66 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
68 %load = call <vscale x 4 x float> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv4f32.nxv2i64(<vscale x 1 x i1> %pg,
69 <vscale x 2 x i64> %base,
71 ret <vscale x 4 x float> %load
75 define <vscale x 2 x double> @ld1q_gather_u64base_f64(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
76 ; CHECK-LABEL: ld1q_gather_u64base_f64:
78 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
80 %load = call <vscale x 2 x double> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv2f64.nxv2i64(<vscale x 1 x i1> %pg,
81 <vscale x 2 x i64> %base,
83 ret <vscale x 2 x double> %load
86 define <vscale x 8 x bfloat> @ld1q_gather_u64base_bf16(<vscale x 1 x i1> %pg, <vscale x 2 x i64> %base, i64 %offset) {
87 ; CHECK-LABEL: ld1q_gather_u64base_bf16:
89 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
91 %load = call <vscale x 8 x bfloat> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8bf16.nxv2i64(<vscale x 1 x i1> %pg,
92 <vscale x 2 x i64> %base,
94 ret <vscale x 8 x bfloat> %load
97 define <vscale x 16 x i8> @test_svdl1q_gather_u64offset_s8(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
98 ; CHECK-LABEL: test_svdl1q_gather_u64offset_s8:
99 ; CHECK: // %bb.0: // %entry
100 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
103 %0 = tail call <vscale x 16 x i8> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv16i8(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
104 ret <vscale x 16 x i8> %0
107 define <vscale x 16 x i8> @test_svdl1q_gather_u64offset_u8(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
108 ; CHECK-LABEL: test_svdl1q_gather_u64offset_u8:
109 ; CHECK: // %bb.0: // %entry
110 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
113 %0 = tail call <vscale x 16 x i8> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv16i8(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
114 ret <vscale x 16 x i8> %0
117 define <vscale x 8 x i16> @test_svdl1q_gather_u64offset_s16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
118 ; CHECK-LABEL: test_svdl1q_gather_u64offset_s16:
119 ; CHECK: // %bb.0: // %entry
120 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
123 %0 = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8i16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
124 ret <vscale x 8 x i16> %0
127 define <vscale x 8 x i16> @test_svdl1q_gather_u64offset_u16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
128 ; CHECK-LABEL: test_svdl1q_gather_u64offset_u16:
129 ; CHECK: // %bb.0: // %entry
130 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
133 %0 = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8i16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
134 ret <vscale x 8 x i16> %0
137 define <vscale x 4 x i32> @test_svdl1q_gather_u64offset_s32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
138 ; CHECK-LABEL: test_svdl1q_gather_u64offset_s32:
139 ; CHECK: // %bb.0: // %entry
140 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
143 %0 = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv4i32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
144 ret <vscale x 4 x i32> %0
147 define <vscale x 4 x i32> @test_svdl1q_gather_u64offset_u32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
148 ; CHECK-LABEL: test_svdl1q_gather_u64offset_u32:
149 ; CHECK: // %bb.0: // %entry
150 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
153 %0 = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv4i32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
154 ret <vscale x 4 x i32> %0
157 define <vscale x 2 x i64> @test_svdl1q_gather_u64offset_s64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
158 ; CHECK-LABEL: test_svdl1q_gather_u64offset_s64:
159 ; CHECK: // %bb.0: // %entry
160 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
163 %0 = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv2i64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
164 ret <vscale x 2 x i64> %0
167 define <vscale x 2 x i64> @test_svdl1q_gather_u64offset_u64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
168 ; CHECK-LABEL: test_svdl1q_gather_u64offset_u64:
169 ; CHECK: // %bb.0: // %entry
170 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
173 %0 = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv2i64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
174 ret <vscale x 2 x i64> %0
177 define <vscale x 8 x bfloat> @test_svdl1q_gather_u64offset_bf16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
178 ; CHECK-LABEL: test_svdl1q_gather_u64offset_bf16:
179 ; CHECK: // %bb.0: // %entry
180 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
183 %0 = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8bf16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
184 ret <vscale x 8 x bfloat> %0
187 define <vscale x 8 x half> @test_svdl1q_gather_u64offset_f16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
188 ; CHECK-LABEL: test_svdl1q_gather_u64offset_f16:
189 ; CHECK: // %bb.0: // %entry
190 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
193 %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8f16(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
194 ret <vscale x 8 x half> %0
197 define <vscale x 4 x float> @test_svdl1q_gather_u64offset_f32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
198 ; CHECK-LABEL: test_svdl1q_gather_u64offset_f32:
199 ; CHECK: // %bb.0: // %entry
200 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
203 %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv4f32(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
204 ret <vscale x 4 x float> %0
207 define <vscale x 2 x double> @test_svdl1q_gather_u64offset_f64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off) {
208 ; CHECK-LABEL: test_svdl1q_gather_u64offset_f64:
209 ; CHECK: // %bb.0: // %entry
210 ; CHECK-NEXT: ld1q { z0.q }, p0/z, [z0.d, x0]
213 %0 = tail call <vscale x 2 x double> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv2f64(<vscale x 1 x i1> %pg, ptr %base, <vscale x 2 x i64> %off)
214 ret <vscale x 2 x double> %0
217 declare <vscale x 16 x i8> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv16i8.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
218 declare <vscale x 8 x i16> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8i16.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
219 declare <vscale x 4 x i32> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv4i32.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
220 declare <vscale x 2 x i64> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv2i64.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
221 declare <vscale x 8 x half> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8f16.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
222 declare <vscale x 4 x float> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv4f32.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
223 declare <vscale x 2 x double> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv2f64.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
224 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.ld1q.gather.scalar.offset.nxv8bf16.nxv2i64(<vscale x 1 x i1>, <vscale x 2 x i64>, i64)
225 declare <vscale x 16 x i8> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv16i8(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
226 declare <vscale x 8 x i16> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8i16(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
227 declare <vscale x 4 x i32> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv4i32(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
228 declare <vscale x 2 x i64> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv2i64(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
229 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8bf16(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
230 declare <vscale x 8 x half> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv8f16(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
231 declare <vscale x 4 x float> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv4f32(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)
232 declare <vscale x 2 x double> @llvm.aarch64.sve.ld1q.gather.vector.offset.nxv2f64(<vscale x 1 x i1>, ptr, <vscale x 2 x i64>)