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 define void @masked_scatter_nxv2i8(<vscale x 2 x i8> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
5 ; CHECK-LABEL: masked_scatter_nxv2i8:
7 ; CHECK-NEXT: st1b { z0.d }, p0, [z1.d, #1]
9 %ptrs = getelementptr i8, <vscale x 2 x ptr> %bases, i32 1
10 call void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8> %data, <vscale x 2 x ptr> %ptrs, i32 1, <vscale x 2 x i1> %mask)
14 define void @masked_scatter_nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
15 ; CHECK-LABEL: masked_scatter_nxv2i16:
17 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d, #2]
19 %ptrs = getelementptr i16, <vscale x 2 x ptr> %bases, i32 1
20 call void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %ptrs, i32 2, <vscale x 2 x i1> %mask)
24 define void @masked_scatter_nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
25 ; CHECK-LABEL: masked_scatter_nxv2i32:
27 ; CHECK-NEXT: st1w { z0.d }, p0, [z1.d, #4]
29 %ptrs = getelementptr i32, <vscale x 2 x ptr> %bases, i32 1
30 call void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %ptrs, i32 4, <vscale x 2 x i1> %mask)
34 define void @masked_scatter_nxv2i64(<vscale x 2 x i64> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
35 ; CHECK-LABEL: masked_scatter_nxv2i64:
37 ; CHECK-NEXT: st1d { z0.d }, p0, [z1.d, #8]
39 %ptrs = getelementptr i64, <vscale x 2 x ptr> %bases, i32 1
40 call void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64> %data, <vscale x 2 x ptr> %ptrs, i32 8, <vscale x 2 x i1> %mask)
44 define void @masked_scatter_nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
45 ; CHECK-LABEL: masked_scatter_nxv2f16:
47 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d, #4]
49 %ptrs = getelementptr half, <vscale x 2 x ptr> %bases, i32 2
50 call void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, i32 2, <vscale x 2 x i1> %mask)
54 define void @masked_scatter_nxv2bf16(<vscale x 2 x bfloat> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) #0 {
55 ; CHECK-LABEL: masked_scatter_nxv2bf16:
57 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d, #4]
59 %ptrs = getelementptr bfloat, <vscale x 2 x ptr> %bases, i32 2
60 call void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat> %data, <vscale x 2 x ptr> %ptrs, i32 2, <vscale x 2 x i1> %mask)
64 define void @masked_scatter_nxv2f32(<vscale x 2 x float> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
65 ; CHECK-LABEL: masked_scatter_nxv2f32:
67 ; CHECK-NEXT: st1w { z0.d }, p0, [z1.d, #12]
69 %ptrs = getelementptr float, <vscale x 2 x ptr> %bases, i32 3
70 call void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float> %data, <vscale x 2 x ptr> %ptrs, i32 4, <vscale x 2 x i1> %mask)
74 define void @masked_scatter_nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
75 ; CHECK-LABEL: masked_scatter_nxv2f64:
77 ; CHECK-NEXT: st1d { z0.d }, p0, [z1.d, #32]
79 %ptrs = getelementptr double, <vscale x 2 x ptr> %bases, i32 4
80 call void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 8, <vscale x 2 x i1> %mask)
84 ; Test where the immediate is out of range
86 define void @masked_scatter_nxv2i8_range(<vscale x 2 x i8> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
87 ; CHECK-LABEL: masked_scatter_nxv2i8_range:
89 ; CHECK-NEXT: mov w8, #32
90 ; CHECK-NEXT: st1b { z0.d }, p0, [x8, z1.d]
92 %ptrs = getelementptr i8, <vscale x 2 x ptr> %bases, i32 32
93 call void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8> %data, <vscale x 2 x ptr> %ptrs, i32 1, <vscale x 2 x i1> %mask)
97 define void @masked_scatter_nxv2i16_range(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
98 ; CHECK-LABEL: masked_scatter_nxv2i16_range:
100 ; CHECK-NEXT: mov w8, #64
101 ; CHECK-NEXT: st1h { z0.d }, p0, [x8, z1.d]
103 %ptrs = getelementptr i16, <vscale x 2 x ptr> %bases, i32 32
104 call void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %ptrs, i32 2, <vscale x 2 x i1> %mask)
108 define void @masked_scatter_nxv2i32_range(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
109 ; CHECK-LABEL: masked_scatter_nxv2i32_range:
111 ; CHECK-NEXT: mov w8, #128
112 ; CHECK-NEXT: st1w { z0.d }, p0, [x8, z1.d]
114 %ptrs = getelementptr i32, <vscale x 2 x ptr> %bases, i32 32
115 call void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %ptrs, i32 1, <vscale x 2 x i1> %mask)
119 define void @masked_scatter_nxv2f64_range(<vscale x 2 x double> %data, <vscale x 2 x ptr> %bases, <vscale x 2 x i1> %mask) {
120 ; CHECK-LABEL: masked_scatter_nxv2f64_range:
122 ; CHECK-NEXT: mov w8, #256
123 ; CHECK-NEXT: st1d { z0.d }, p0, [x8, z1.d]
125 %ptrs = getelementptr double, <vscale x 2 x ptr> %bases, i32 32
126 call void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 8, <vscale x 2 x i1> %mask)
130 declare void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
131 declare void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
132 declare void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
133 declare void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
134 declare void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
135 declare void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
136 declare void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
137 declare void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
138 attributes #0 = { "target-features"="+sve,+bf16" }