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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 ; scaled unpacked 32-bit offsets
6 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 define void @masked_scatter_nxv2i16_sext(<vscale x 2 x i16> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
9 ; CHECK-LABEL: masked_scatter_nxv2i16_sext:
11 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, sxtw #1]
13 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
14 %ptrs = getelementptr i16, ptr %base, <vscale x 2 x i64> %ext
15 call void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
19 define void @masked_scatter_nxv2i32_sext(<vscale x 2 x i32> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
20 ; CHECK-LABEL: masked_scatter_nxv2i32_sext:
22 ; CHECK-NEXT: st1w { z0.d }, p0, [x0, z1.d, sxtw #2]
24 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
25 %ptrs = getelementptr i32, ptr %base, <vscale x 2 x i64> %ext
26 call void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
30 define void @masked_scatter_nxv2i64_sext(<vscale x 2 x i64> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
31 ; CHECK-LABEL: masked_scatter_nxv2i64_sext:
33 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d, sxtw #3]
35 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
36 %ptrs = getelementptr i64, ptr %base, <vscale x 2 x i64> %ext
37 call void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
41 define void @masked_scatter_nxv2f16_sext(<vscale x 2 x half> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
42 ; CHECK-LABEL: masked_scatter_nxv2f16_sext:
44 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, sxtw #1]
46 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
47 %ptrs = getelementptr half, ptr %base, <vscale x 2 x i64> %ext
48 call void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
52 define void @masked_scatter_nxv2bf16_sext(<vscale x 2 x bfloat> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind #0 {
53 ; CHECK-LABEL: masked_scatter_nxv2bf16_sext:
55 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, sxtw #1]
57 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
58 %ptrs = getelementptr bfloat, ptr %base, <vscale x 2 x i64> %ext
59 call void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
63 define void @masked_scatter_nxv2f32_sext(<vscale x 2 x float> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
64 ; CHECK-LABEL: masked_scatter_nxv2f32_sext:
66 ; CHECK-NEXT: st1w { z0.d }, p0, [x0, z1.d, sxtw #2]
68 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
69 %ptrs = getelementptr float, ptr %base, <vscale x 2 x i64> %ext
70 call void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
74 define void @masked_scatter_nxv2f64_sext(<vscale x 2 x double> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
75 ; CHECK-LABEL: masked_scatter_nxv2f64_sext:
77 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d, sxtw #3]
79 %ext = sext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
80 %ptrs = getelementptr double, ptr %base, <vscale x 2 x i64> %ext
81 call void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
85 define void @masked_scatter_nxv2i16_zext(<vscale x 2 x i16> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
86 ; CHECK-LABEL: masked_scatter_nxv2i16_zext:
88 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, uxtw #1]
90 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
91 %ptrs = getelementptr i16, ptr %base, <vscale x 2 x i64> %ext
92 call void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
96 define void @masked_scatter_nxv2i32_zext(<vscale x 2 x i32> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
97 ; CHECK-LABEL: masked_scatter_nxv2i32_zext:
99 ; CHECK-NEXT: st1w { z0.d }, p0, [x0, z1.d, uxtw #2]
101 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
102 %ptrs = getelementptr i32, ptr %base, <vscale x 2 x i64> %ext
103 call void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
107 define void @masked_scatter_nxv2i64_zext(<vscale x 2 x i64> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
108 ; CHECK-LABEL: masked_scatter_nxv2i64_zext:
110 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d, uxtw #3]
112 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
113 %ptrs = getelementptr i64, ptr %base, <vscale x 2 x i64> %ext
114 call void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
118 define void @masked_scatter_nxv2f16_zext(<vscale x 2 x half> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
119 ; CHECK-LABEL: masked_scatter_nxv2f16_zext:
121 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, uxtw #1]
123 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
124 %ptrs = getelementptr half, ptr %base, <vscale x 2 x i64> %ext
125 call void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
129 define void @masked_scatter_nxv2bf16_zext(<vscale x 2 x bfloat> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind #0 {
130 ; CHECK-LABEL: masked_scatter_nxv2bf16_zext:
132 ; CHECK-NEXT: st1h { z0.d }, p0, [x0, z1.d, uxtw #1]
134 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
135 %ptrs = getelementptr bfloat, ptr %base, <vscale x 2 x i64> %ext
136 call void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
140 define void @masked_scatter_nxv2f32_zext(<vscale x 2 x float> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
141 ; CHECK-LABEL: masked_scatter_nxv2f32_zext:
143 ; CHECK-NEXT: st1w { z0.d }, p0, [x0, z1.d, uxtw #2]
145 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
146 %ptrs = getelementptr float, ptr %base, <vscale x 2 x i64> %ext
147 call void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
151 define void @masked_scatter_nxv2f64_zext(<vscale x 2 x double> %data, ptr %base, <vscale x 2 x i32> %indexes, <vscale x 2 x i1> %masks) nounwind {
152 ; CHECK-LABEL: masked_scatter_nxv2f64_zext:
154 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d, uxtw #3]
156 %ext = zext <vscale x 2 x i32> %indexes to <vscale x 2 x i64>
157 %ptrs = getelementptr double, ptr %base, <vscale x 2 x i64> %ext
158 call void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
162 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
163 ; scaled packed 32-bit offset
164 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
166 define void @masked_scatter_nxv4i16_sext(<vscale x 4 x i16> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
167 ; CHECK-LABEL: masked_scatter_nxv4i16_sext:
169 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, sxtw #1]
171 %ext = sext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
172 %ptrs = getelementptr i16, ptr %base, <vscale x 4 x i64> %ext
173 call void @llvm.masked.scatter.nxv4i16(<vscale x 4 x i16> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
177 define void @masked_scatter_nxv4i32_sext(<vscale x 4 x i32> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
178 ; CHECK-LABEL: masked_scatter_nxv4i32_sext:
180 ; CHECK-NEXT: st1w { z0.s }, p0, [x0, z1.s, sxtw #2]
182 %ext = sext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
183 %ptrs = getelementptr i32, ptr %base, <vscale x 4 x i64> %ext
184 call void @llvm.masked.scatter.nxv4i32(<vscale x 4 x i32> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
188 define void @masked_scatter_nxv4f16_sext(<vscale x 4 x half> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
189 ; CHECK-LABEL: masked_scatter_nxv4f16_sext:
191 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, sxtw #1]
193 %ext = sext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
194 %ptrs = getelementptr half, ptr %base, <vscale x 4 x i64> %ext
195 call void @llvm.masked.scatter.nxv4f16(<vscale x 4 x half> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
199 define void @masked_scatter_nxv4bf16_sext(<vscale x 4 x bfloat> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind #0 {
200 ; CHECK-LABEL: masked_scatter_nxv4bf16_sext:
202 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, sxtw #1]
204 %ext = sext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
205 %ptrs = getelementptr bfloat, ptr %base, <vscale x 4 x i64> %ext
206 call void @llvm.masked.scatter.nxv4bf16(<vscale x 4 x bfloat> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
210 define void @masked_scatter_nxv4f32_sext(<vscale x 4 x float> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind #0 {
211 ; CHECK-LABEL: masked_scatter_nxv4f32_sext:
213 ; CHECK-NEXT: st1w { z0.s }, p0, [x0, z1.s, sxtw #2]
215 %ext = sext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
216 %ptrs = getelementptr float, ptr %base, <vscale x 4 x i64> %ext
217 call void @llvm.masked.scatter.nxv4f32(<vscale x 4 x float> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
221 define void @masked_scatter_nxv4i16_zext(<vscale x 4 x i16> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
222 ; CHECK-LABEL: masked_scatter_nxv4i16_zext:
224 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, uxtw #1]
226 %ext = zext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
227 %ptrs = getelementptr i16, ptr %base, <vscale x 4 x i64> %ext
228 call void @llvm.masked.scatter.nxv4i16(<vscale x 4 x i16> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
232 define void @masked_scatter_nxv4i32_zext(<vscale x 4 x i32> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
233 ; CHECK-LABEL: masked_scatter_nxv4i32_zext:
235 ; CHECK-NEXT: st1w { z0.s }, p0, [x0, z1.s, uxtw #2]
237 %ext = zext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
238 %ptrs = getelementptr i32, ptr %base, <vscale x 4 x i64> %ext
239 call void @llvm.masked.scatter.nxv4i32(<vscale x 4 x i32> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
243 define void @masked_scatter_nxv4f16_zext(<vscale x 4 x half> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind {
244 ; CHECK-LABEL: masked_scatter_nxv4f16_zext:
246 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, uxtw #1]
248 %ext = zext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
249 %ptrs = getelementptr half, ptr %base, <vscale x 4 x i64> %ext
250 call void @llvm.masked.scatter.nxv4f16(<vscale x 4 x half> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
254 define void @masked_scatter_nxv4bf16_zext(<vscale x 4 x bfloat> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind #0 {
255 ; CHECK-LABEL: masked_scatter_nxv4bf16_zext:
257 ; CHECK-NEXT: st1h { z0.s }, p0, [x0, z1.s, uxtw #1]
259 %ext = zext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
260 %ptrs = getelementptr bfloat, ptr %base, <vscale x 4 x i64> %ext
261 call void @llvm.masked.scatter.nxv4bf16(<vscale x 4 x bfloat> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
265 define void @masked_scatter_nxv4f32_zext(<vscale x 4 x float> %data, ptr %base, <vscale x 4 x i32> %indexes, <vscale x 4 x i1> %masks) nounwind #0 {
266 ; CHECK-LABEL: masked_scatter_nxv4f32_zext:
268 ; CHECK-NEXT: st1w { z0.s }, p0, [x0, z1.s, uxtw #2]
270 %ext = zext <vscale x 4 x i32> %indexes to <vscale x 4 x i64>
271 %ptrs = getelementptr float, ptr %base, <vscale x 4 x i64> %ext
272 call void @llvm.masked.scatter.nxv4f32(<vscale x 4 x float> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
276 declare void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
277 declare void @llvm.masked.scatter.nxv4f16(<vscale x 4 x half>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
278 declare void @llvm.masked.scatter.nxv4bf16(<vscale x 4 x bfloat>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
279 declare void @llvm.masked.scatter.nxv4f32(<vscale x 4 x float>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
280 declare void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
281 declare void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
282 declare void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
283 declare void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
284 declare void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
285 declare void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
286 declare void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
287 declare void @llvm.masked.scatter.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
288 declare void @llvm.masked.scatter.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
289 declare void @llvm.masked.scatter.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
290 attributes #0 = { "target-features"="+sve,+bf16" }