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> %ptrs, <vscale x 2 x i1> %masks) nounwind {
5 ; CHECK-LABEL: masked_scatter_nxv2i8:
7 ; CHECK-NEXT: st1b { z0.d }, p0, [z1.d]
9 call void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
13 define void @masked_scatter_nxv2i16(<vscale x 2 x i16> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
14 ; CHECK-LABEL: masked_scatter_nxv2i16:
16 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d]
18 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)
22 define void @masked_scatter_nxv2i32(<vscale x 2 x i32> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
23 ; CHECK-LABEL: masked_scatter_nxv2i32:
25 ; CHECK-NEXT: st1w { z0.d }, p0, [z1.d]
27 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)
31 define void @masked_scatter_nxv2i64(<vscale x 2 x i64> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
32 ; CHECK-LABEL: masked_scatter_nxv2i64:
34 ; CHECK-NEXT: st1d { z0.d }, p0, [z1.d]
36 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)
40 define void @masked_scatter_nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
41 ; CHECK-LABEL: masked_scatter_nxv2f16:
43 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d]
45 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)
49 define void @masked_scatter_nxv2bf16(<vscale x 2 x bfloat> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind #0 {
50 ; CHECK-LABEL: masked_scatter_nxv2bf16:
52 ; CHECK-NEXT: st1h { z0.d }, p0, [z1.d]
54 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)
58 define void @masked_scatter_nxv2f32(<vscale x 2 x float> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
59 ; CHECK-LABEL: masked_scatter_nxv2f32:
61 ; CHECK-NEXT: st1w { z0.d }, p0, [z1.d]
63 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)
67 define void @masked_scatter_nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) nounwind {
68 ; CHECK-LABEL: masked_scatter_nxv2f64:
70 ; CHECK-NEXT: st1d { z0.d }, p0, [z1.d]
72 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)
76 define void @masked_scatter_splat_constant_pointer (<vscale x 4 x i1> %pg) {
77 ; CHECK-LABEL: masked_scatter_splat_constant_pointer:
78 ; CHECK: // %bb.0: // %vector.body
79 ; CHECK-NEXT: mov z0.d, #0 // =0x0
80 ; CHECK-NEXT: punpklo p1.h, p0.b
81 ; CHECK-NEXT: punpkhi p0.h, p0.b
82 ; CHECK-NEXT: st1w { z0.d }, p1, [z0.d]
83 ; CHECK-NEXT: st1w { z0.d }, p0, [z0.d]
86 call void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32> undef,
87 <vscale x 4 x ptr> shufflevector (<vscale x 4 x ptr> insertelement (<vscale x 4 x ptr> poison, ptr null, i32 0), <vscale x 4 x ptr> poison, <vscale x 4 x i32> zeroinitializer),
89 <vscale x 4 x i1> %pg)
93 %i64_x3 = type { i64, i64, i64 }
94 define void @masked_scatter_non_power_of_two_based_scaling(<vscale x 2 x double> %data, ptr %base, <vscale x 2 x i64> %offsets, <vscale x 2 x i1> %mask) {
95 ; CHECK-LABEL: masked_scatter_non_power_of_two_based_scaling:
97 ; CHECK-NEXT: mul z1.d, z1.d, #24
98 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d]
100 %ptrs = getelementptr inbounds %i64_x3, ptr %base, <vscale x 2 x i64> %offsets
101 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)
105 %i64_x4 = type { i64, i64, i64, i64}
106 define void @masked_scatter_non_element_type_based_scaling(<vscale x 2 x double> %data, ptr %base, <vscale x 2 x i64> %offsets, <vscale x 2 x i1> %mask) {
107 ; CHECK-LABEL: masked_scatter_non_element_type_based_scaling:
109 ; CHECK-NEXT: lsl z1.d, z1.d, #5
110 ; CHECK-NEXT: st1d { z0.d }, p0, [x0, z1.d]
112 %ptrs = getelementptr inbounds %i64_x4, ptr %base, <vscale x 2 x i64> %offsets
113 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)
117 declare void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
118 declare void @llvm.masked.scatter.nxv2bf16(<vscale x 2 x bfloat>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
119 declare void @llvm.masked.scatter.nxv2f32(<vscale x 2 x float>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
120 declare void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
121 declare void @llvm.masked.scatter.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
122 declare void @llvm.masked.scatter.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
123 declare void @llvm.masked.scatter.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
124 declare void @llvm.masked.scatter.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x ptr>, i32, <vscale x 2 x i1>)
125 declare void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32>, <vscale x 4 x ptr>, i32, <vscale x 4 x i1>)
126 attributes #0 = { "target-features"="+sve,+bf16" }