252
|
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
|
|
2 ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck -check-prefixes=GFX68,VERDE %s
|
|
3 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck -check-prefixes=GFX68,GFX8 %s
|
|
4 ; RUN: llc < %s -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs | FileCheck -check-prefixes=GFX11 %s
|
150
|
5
|
|
6 define amdgpu_ps void @buffer_store(<4 x i32> inreg, <4 x float>, <4 x float>, <4 x float>) {
|
252
|
7 ; GFX68-LABEL: buffer_store:
|
|
8 ; GFX68: ; %bb.0: ; %main_body
|
|
9 ; GFX68-NEXT: v_mov_b32_e32 v12, 0
|
|
10 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v12, s[0:3], 0 idxen
|
|
11 ; GFX68-NEXT: buffer_store_dwordx4 v[4:7], v12, s[0:3], 0 idxen glc
|
|
12 ; GFX68-NEXT: buffer_store_dwordx4 v[8:11], v12, s[0:3], 0 idxen slc
|
|
13 ; GFX68-NEXT: s_endpgm
|
|
14 ;
|
|
15 ; GFX11-LABEL: buffer_store:
|
|
16 ; GFX11: ; %bb.0: ; %main_body
|
|
17 ; GFX11-NEXT: v_mov_b32_e32 v12, 0
|
|
18 ; GFX11-NEXT: s_clause 0x2
|
|
19 ; GFX11-NEXT: buffer_store_b128 v[0:3], v12, s[0:3], 0 idxen
|
|
20 ; GFX11-NEXT: buffer_store_b128 v[4:7], v12, s[0:3], 0 idxen glc
|
|
21 ; GFX11-NEXT: buffer_store_b128 v[8:11], v12, s[0:3], 0 idxen slc
|
|
22 ; GFX11-NEXT: s_nop 0
|
|
23 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
24 ; GFX11-NEXT: s_endpgm
|
150
|
25 main_body:
|
|
26 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 0, i32 0, i32 0, i32 0)
|
|
27 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %2, <4 x i32> %0, i32 0, i32 0, i32 0, i32 1)
|
|
28 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %3, <4 x i32> %0, i32 0, i32 0, i32 0, i32 2)
|
|
29 ret void
|
|
30 }
|
|
31
|
|
32 define amdgpu_ps void @buffer_store_immoffs(<4 x i32> inreg, <4 x float>) {
|
252
|
33 ; GFX68-LABEL: buffer_store_immoffs:
|
|
34 ; GFX68: ; %bb.0: ; %main_body
|
|
35 ; GFX68-NEXT: v_mov_b32_e32 v4, 0
|
|
36 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 idxen offset:42
|
|
37 ; GFX68-NEXT: s_endpgm
|
|
38 ;
|
|
39 ; GFX11-LABEL: buffer_store_immoffs:
|
|
40 ; GFX11: ; %bb.0: ; %main_body
|
|
41 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
|
|
42 ; GFX11-NEXT: buffer_store_b128 v[0:3], v4, s[0:3], 0 idxen offset:42
|
|
43 ; GFX11-NEXT: s_nop 0
|
|
44 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
45 ; GFX11-NEXT: s_endpgm
|
150
|
46 main_body:
|
|
47 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 0, i32 42, i32 0, i32 0)
|
|
48 ret void
|
|
49 }
|
|
50
|
|
51 define amdgpu_ps void @buffer_store_idx(<4 x i32> inreg, <4 x float>, i32) {
|
252
|
52 ; GFX68-LABEL: buffer_store_idx:
|
|
53 ; GFX68: ; %bb.0: ; %main_body
|
|
54 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 idxen
|
|
55 ; GFX68-NEXT: s_endpgm
|
|
56 ;
|
|
57 ; GFX11-LABEL: buffer_store_idx:
|
|
58 ; GFX11: ; %bb.0: ; %main_body
|
|
59 ; GFX11-NEXT: buffer_store_b128 v[0:3], v4, s[0:3], 0 idxen
|
|
60 ; GFX11-NEXT: s_nop 0
|
|
61 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
62 ; GFX11-NEXT: s_endpgm
|
150
|
63 main_body:
|
|
64 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 %2, i32 0, i32 0, i32 0)
|
|
65 ret void
|
|
66 }
|
|
67
|
|
68 define amdgpu_ps void @buffer_store_ofs(<4 x i32> inreg, <4 x float>, i32) {
|
252
|
69 ; GFX68-LABEL: buffer_store_ofs:
|
|
70 ; GFX68: ; %bb.0: ; %main_body
|
|
71 ; GFX68-NEXT: s_mov_b32 s4, 0
|
|
72 ; GFX68-NEXT: v_mov_b32_e32 v5, v4
|
|
73 ; GFX68-NEXT: v_mov_b32_e32 v4, s4
|
|
74 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v[4:5], s[0:3], 0 idxen offen
|
|
75 ; GFX68-NEXT: s_endpgm
|
|
76 ;
|
|
77 ; GFX11-LABEL: buffer_store_ofs:
|
|
78 ; GFX11: ; %bb.0: ; %main_body
|
|
79 ; GFX11-NEXT: s_mov_b32 s4, 0
|
|
80 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
|
|
81 ; GFX11-NEXT: v_dual_mov_b32 v5, v4 :: v_dual_mov_b32 v4, s4
|
|
82 ; GFX11-NEXT: buffer_store_b128 v[0:3], v[4:5], s[0:3], 0 idxen offen
|
|
83 ; GFX11-NEXT: s_nop 0
|
|
84 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
85 ; GFX11-NEXT: s_endpgm
|
150
|
86 main_body:
|
|
87 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 0, i32 %2, i32 0, i32 0)
|
|
88 ret void
|
|
89 }
|
|
90
|
|
91 define amdgpu_ps void @buffer_store_both(<4 x i32> inreg, <4 x float>, i32, i32) {
|
252
|
92 ; GFX68-LABEL: buffer_store_both:
|
|
93 ; GFX68: ; %bb.0: ; %main_body
|
|
94 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v[4:5], s[0:3], 0 idxen offen
|
|
95 ; GFX68-NEXT: s_endpgm
|
|
96 ;
|
|
97 ; GFX11-LABEL: buffer_store_both:
|
|
98 ; GFX11: ; %bb.0: ; %main_body
|
|
99 ; GFX11-NEXT: buffer_store_b128 v[0:3], v[4:5], s[0:3], 0 idxen offen
|
|
100 ; GFX11-NEXT: s_nop 0
|
|
101 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
102 ; GFX11-NEXT: s_endpgm
|
150
|
103 main_body:
|
|
104 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 %2, i32 %3, i32 0, i32 0)
|
|
105 ret void
|
|
106 }
|
|
107
|
|
108 define amdgpu_ps void @buffer_store_both_reversed(<4 x i32> inreg, <4 x float>, i32, i32) {
|
252
|
109 ; GFX68-LABEL: buffer_store_both_reversed:
|
|
110 ; GFX68: ; %bb.0: ; %main_body
|
|
111 ; GFX68-NEXT: v_mov_b32_e32 v6, v4
|
|
112 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v[5:6], s[0:3], 0 idxen offen
|
|
113 ; GFX68-NEXT: s_endpgm
|
|
114 ;
|
|
115 ; GFX11-LABEL: buffer_store_both_reversed:
|
|
116 ; GFX11: ; %bb.0: ; %main_body
|
|
117 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
|
|
118 ; GFX11-NEXT: buffer_store_b128 v[0:3], v[5:6], s[0:3], 0 idxen offen
|
|
119 ; GFX11-NEXT: s_nop 0
|
|
120 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
121 ; GFX11-NEXT: s_endpgm
|
150
|
122 main_body:
|
|
123 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 %3, i32 %2, i32 0, i32 0)
|
|
124 ret void
|
|
125 }
|
|
126
|
|
127 ; Ideally, the register allocator would avoid the wait here
|
252
|
128 define amdgpu_ps void @buffer_store_wait(<4 x i32> inreg, <4 x float>, i32, i32, i32) {
|
|
129 ; VERDE-LABEL: buffer_store_wait:
|
|
130 ; VERDE: ; %bb.0: ; %main_body
|
|
131 ; VERDE-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 idxen
|
|
132 ; VERDE-NEXT: s_waitcnt expcnt(0)
|
|
133 ; VERDE-NEXT: buffer_load_dwordx4 v[0:3], v5, s[0:3], 0 idxen
|
|
134 ; VERDE-NEXT: s_waitcnt vmcnt(0)
|
|
135 ; VERDE-NEXT: buffer_store_dwordx4 v[0:3], v6, s[0:3], 0 idxen
|
|
136 ; VERDE-NEXT: s_endpgm
|
150
|
137 ;
|
252
|
138 ; GFX8-LABEL: buffer_store_wait:
|
|
139 ; GFX8: ; %bb.0: ; %main_body
|
|
140 ; GFX8-NEXT: buffer_store_dwordx4 v[0:3], v4, s[0:3], 0 idxen
|
|
141 ; GFX8-NEXT: buffer_load_dwordx4 v[0:3], v5, s[0:3], 0 idxen
|
|
142 ; GFX8-NEXT: s_waitcnt vmcnt(0)
|
|
143 ; GFX8-NEXT: buffer_store_dwordx4 v[0:3], v6, s[0:3], 0 idxen
|
|
144 ; GFX8-NEXT: s_endpgm
|
|
145 ;
|
|
146 ; GFX11-LABEL: buffer_store_wait:
|
|
147 ; GFX11: ; %bb.0: ; %main_body
|
|
148 ; GFX11-NEXT: buffer_store_b128 v[0:3], v4, s[0:3], 0 idxen
|
|
149 ; GFX11-NEXT: buffer_load_b128 v[0:3], v5, s[0:3], 0 idxen
|
|
150 ; GFX11-NEXT: s_waitcnt vmcnt(0)
|
|
151 ; GFX11-NEXT: buffer_store_b128 v[0:3], v6, s[0:3], 0 idxen
|
|
152 ; GFX11-NEXT: s_nop 0
|
|
153 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
154 ; GFX11-NEXT: s_endpgm
|
150
|
155 main_body:
|
|
156 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %1, <4 x i32> %0, i32 %2, i32 0, i32 0, i32 0)
|
|
157 %data = call <4 x float> @llvm.amdgcn.struct.buffer.load.v4f32(<4 x i32> %0, i32 %3, i32 0, i32 0, i32 0)
|
|
158 call void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float> %data, <4 x i32> %0, i32 %4, i32 0, i32 0, i32 0)
|
|
159 ret void
|
|
160 }
|
|
161
|
|
162 define amdgpu_ps void @buffer_store_x1(<4 x i32> inreg %rsrc, float %data, i32 %index) {
|
252
|
163 ; GFX68-LABEL: buffer_store_x1:
|
|
164 ; GFX68: ; %bb.0: ; %main_body
|
|
165 ; GFX68-NEXT: buffer_store_dword v0, v1, s[0:3], 0 idxen
|
|
166 ; GFX68-NEXT: s_endpgm
|
|
167 ;
|
|
168 ; GFX11-LABEL: buffer_store_x1:
|
|
169 ; GFX11: ; %bb.0: ; %main_body
|
|
170 ; GFX11-NEXT: buffer_store_b32 v0, v1, s[0:3], 0 idxen
|
|
171 ; GFX11-NEXT: s_nop 0
|
|
172 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
173 ; GFX11-NEXT: s_endpgm
|
150
|
174 main_body:
|
|
175 call void @llvm.amdgcn.struct.buffer.store.f32(float %data, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
176 ret void
|
|
177 }
|
|
178
|
|
179 define amdgpu_ps void @buffer_store_x2(<4 x i32> inreg %rsrc, <2 x float> %data, i32 %index) #0 {
|
252
|
180 ; GFX68-LABEL: buffer_store_x2:
|
|
181 ; GFX68: ; %bb.0: ; %main_body
|
|
182 ; GFX68-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 idxen
|
|
183 ; GFX68-NEXT: s_endpgm
|
|
184 ;
|
|
185 ; GFX11-LABEL: buffer_store_x2:
|
|
186 ; GFX11: ; %bb.0: ; %main_body
|
|
187 ; GFX11-NEXT: buffer_store_b64 v[0:1], v2, s[0:3], 0 idxen
|
|
188 ; GFX11-NEXT: s_nop 0
|
|
189 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
190 ; GFX11-NEXT: s_endpgm
|
150
|
191 main_body:
|
|
192 call void @llvm.amdgcn.struct.buffer.store.v2f32(<2 x float> %data, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
193 ret void
|
|
194 }
|
|
195
|
|
196 define amdgpu_ps void @buffer_store_int(<4 x i32> inreg, <4 x i32>, <2 x i32>, i32) {
|
252
|
197 ; GFX68-LABEL: buffer_store_int:
|
|
198 ; GFX68: ; %bb.0: ; %main_body
|
|
199 ; GFX68-NEXT: v_mov_b32_e32 v7, 0
|
|
200 ; GFX68-NEXT: buffer_store_dwordx4 v[0:3], v7, s[0:3], 0 idxen
|
|
201 ; GFX68-NEXT: buffer_store_dwordx2 v[4:5], v7, s[0:3], 0 idxen glc
|
|
202 ; GFX68-NEXT: buffer_store_dword v6, v7, s[0:3], 0 idxen slc
|
|
203 ; GFX68-NEXT: s_endpgm
|
|
204 ;
|
|
205 ; GFX11-LABEL: buffer_store_int:
|
|
206 ; GFX11: ; %bb.0: ; %main_body
|
|
207 ; GFX11-NEXT: v_mov_b32_e32 v7, 0
|
|
208 ; GFX11-NEXT: s_clause 0x2
|
|
209 ; GFX11-NEXT: buffer_store_b128 v[0:3], v7, s[0:3], 0 idxen
|
|
210 ; GFX11-NEXT: buffer_store_b64 v[4:5], v7, s[0:3], 0 idxen glc
|
|
211 ; GFX11-NEXT: buffer_store_b32 v6, v7, s[0:3], 0 idxen slc
|
|
212 ; GFX11-NEXT: s_nop 0
|
|
213 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
214 ; GFX11-NEXT: s_endpgm
|
150
|
215 main_body:
|
|
216 call void @llvm.amdgcn.struct.buffer.store.v4i32(<4 x i32> %1, <4 x i32> %0, i32 0, i32 0, i32 0, i32 0)
|
|
217 call void @llvm.amdgcn.struct.buffer.store.v2i32(<2 x i32> %2, <4 x i32> %0, i32 0, i32 0, i32 0, i32 1)
|
|
218 call void @llvm.amdgcn.struct.buffer.store.i32(i32 %3, <4 x i32> %0, i32 0, i32 0, i32 0, i32 2)
|
|
219 ret void
|
|
220 }
|
|
221
|
|
222 define amdgpu_ps void @struct_buffer_store_byte(<4 x i32> inreg %rsrc, float %v1, i32 %index) {
|
252
|
223 ; GFX68-LABEL: struct_buffer_store_byte:
|
|
224 ; GFX68: ; %bb.0: ; %main_body
|
|
225 ; GFX68-NEXT: v_cvt_u32_f32_e32 v0, v0
|
|
226 ; GFX68-NEXT: buffer_store_byte v0, v1, s[0:3], 0 idxen
|
|
227 ; GFX68-NEXT: s_endpgm
|
|
228 ;
|
|
229 ; GFX11-LABEL: struct_buffer_store_byte:
|
|
230 ; GFX11: ; %bb.0: ; %main_body
|
|
231 ; GFX11-NEXT: v_cvt_u32_f32_e32 v0, v0
|
|
232 ; GFX11-NEXT: buffer_store_b8 v0, v1, s[0:3], 0 idxen
|
|
233 ; GFX11-NEXT: s_nop 0
|
|
234 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
235 ; GFX11-NEXT: s_endpgm
|
150
|
236 main_body:
|
|
237 %v2 = fptoui float %v1 to i32
|
|
238 %v3 = trunc i32 %v2 to i8
|
|
239 call void @llvm.amdgcn.struct.buffer.store.i8(i8 %v3, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
240 ret void
|
|
241 }
|
|
242
|
|
243 define amdgpu_ps void @struct_buffer_store_f16(<4 x i32> inreg %rsrc, float %v1, i32 %index) {
|
252
|
244 ; GFX68-LABEL: struct_buffer_store_f16:
|
|
245 ; GFX68: ; %bb.0:
|
|
246 ; GFX68-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
247 ; GFX68-NEXT: buffer_store_short v0, v1, s[0:3], 0 idxen
|
|
248 ; GFX68-NEXT: s_endpgm
|
|
249 ;
|
|
250 ; GFX11-LABEL: struct_buffer_store_f16:
|
|
251 ; GFX11: ; %bb.0:
|
|
252 ; GFX11-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
253 ; GFX11-NEXT: buffer_store_b16 v0, v1, s[0:3], 0 idxen
|
|
254 ; GFX11-NEXT: s_nop 0
|
|
255 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
256 ; GFX11-NEXT: s_endpgm
|
150
|
257 %v2 = fptrunc float %v1 to half
|
|
258 call void @llvm.amdgcn.struct.buffer.store.f16(half %v2, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
259 ret void
|
|
260 }
|
|
261
|
|
262 define amdgpu_ps void @struct_buffer_store_v2f16(<4 x i32> inreg %rsrc, <2 x half> %v1, i32 %index) {
|
252
|
263 ; VERDE-LABEL: struct_buffer_store_v2f16:
|
|
264 ; VERDE: ; %bb.0:
|
|
265 ; VERDE-NEXT: v_cvt_f16_f32_e32 v1, v1
|
|
266 ; VERDE-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
267 ; VERDE-NEXT: v_lshlrev_b32_e32 v1, 16, v1
|
|
268 ; VERDE-NEXT: v_or_b32_e32 v0, v0, v1
|
|
269 ; VERDE-NEXT: buffer_store_dword v0, v2, s[0:3], 0 idxen
|
|
270 ; VERDE-NEXT: s_endpgm
|
|
271 ;
|
|
272 ; GFX8-LABEL: struct_buffer_store_v2f16:
|
|
273 ; GFX8: ; %bb.0:
|
|
274 ; GFX8-NEXT: buffer_store_dword v0, v1, s[0:3], 0 idxen
|
|
275 ; GFX8-NEXT: s_endpgm
|
|
276 ;
|
|
277 ; GFX11-LABEL: struct_buffer_store_v2f16:
|
|
278 ; GFX11: ; %bb.0:
|
|
279 ; GFX11-NEXT: buffer_store_b32 v0, v1, s[0:3], 0 idxen
|
|
280 ; GFX11-NEXT: s_nop 0
|
|
281 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
282 ; GFX11-NEXT: s_endpgm
|
150
|
283 call void @llvm.amdgcn.struct.buffer.store.v2f16(<2 x half> %v1, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
284 ret void
|
|
285 }
|
|
286
|
|
287 define amdgpu_ps void @struct_buffer_store_v4f16(<4 x i32> inreg %rsrc, <4 x half> %v1, i32 %index) {
|
252
|
288 ; VERDE-LABEL: struct_buffer_store_v4f16:
|
|
289 ; VERDE: ; %bb.0:
|
|
290 ; VERDE-NEXT: v_cvt_f16_f32_e32 v3, v3
|
|
291 ; VERDE-NEXT: v_cvt_f16_f32_e32 v2, v2
|
|
292 ; VERDE-NEXT: v_cvt_f16_f32_e32 v5, v1
|
|
293 ; VERDE-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
294 ; VERDE-NEXT: v_lshlrev_b32_e32 v1, 16, v3
|
|
295 ; VERDE-NEXT: v_or_b32_e32 v1, v2, v1
|
|
296 ; VERDE-NEXT: v_lshlrev_b32_e32 v2, 16, v5
|
|
297 ; VERDE-NEXT: v_or_b32_e32 v0, v0, v2
|
|
298 ; VERDE-NEXT: buffer_store_dwordx2 v[0:1], v4, s[0:3], 0 idxen
|
|
299 ; VERDE-NEXT: s_endpgm
|
|
300 ;
|
|
301 ; GFX8-LABEL: struct_buffer_store_v4f16:
|
|
302 ; GFX8: ; %bb.0:
|
|
303 ; GFX8-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 idxen
|
|
304 ; GFX8-NEXT: s_endpgm
|
|
305 ;
|
|
306 ; GFX11-LABEL: struct_buffer_store_v4f16:
|
|
307 ; GFX11: ; %bb.0:
|
|
308 ; GFX11-NEXT: buffer_store_b64 v[0:1], v2, s[0:3], 0 idxen
|
|
309 ; GFX11-NEXT: s_nop 0
|
|
310 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
311 ; GFX11-NEXT: s_endpgm
|
150
|
312 call void @llvm.amdgcn.struct.buffer.store.v4f16(<4 x half> %v1, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
313 ret void
|
|
314 }
|
|
315
|
|
316 define amdgpu_ps void @struct_buffer_store_i16(<4 x i32> inreg %rsrc, float %v1, i32 %index) {
|
252
|
317 ; GFX68-LABEL: struct_buffer_store_i16:
|
|
318 ; GFX68: ; %bb.0: ; %main_body
|
|
319 ; GFX68-NEXT: v_cvt_u32_f32_e32 v0, v0
|
|
320 ; GFX68-NEXT: buffer_store_short v0, v1, s[0:3], 0 idxen
|
|
321 ; GFX68-NEXT: s_endpgm
|
|
322 ;
|
|
323 ; GFX11-LABEL: struct_buffer_store_i16:
|
|
324 ; GFX11: ; %bb.0: ; %main_body
|
|
325 ; GFX11-NEXT: v_cvt_u32_f32_e32 v0, v0
|
|
326 ; GFX11-NEXT: buffer_store_b16 v0, v1, s[0:3], 0 idxen
|
|
327 ; GFX11-NEXT: s_nop 0
|
|
328 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
329 ; GFX11-NEXT: s_endpgm
|
150
|
330 main_body:
|
|
331 %v2 = fptoui float %v1 to i32
|
|
332 %v3 = trunc i32 %v2 to i16
|
|
333 call void @llvm.amdgcn.struct.buffer.store.i16(i16 %v3, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
334 ret void
|
|
335 }
|
|
336
|
|
337 define amdgpu_ps void @struct_buffer_store_vif16(<4 x i32> inreg %rsrc, <2 x i16> %v1, i32 %index) {
|
252
|
338 ; VERDE-LABEL: struct_buffer_store_vif16:
|
|
339 ; VERDE: ; %bb.0:
|
|
340 ; VERDE-NEXT: v_lshlrev_b32_e32 v1, 16, v1
|
|
341 ; VERDE-NEXT: v_and_b32_e32 v0, 0xffff, v0
|
|
342 ; VERDE-NEXT: v_or_b32_e32 v0, v0, v1
|
|
343 ; VERDE-NEXT: buffer_store_dword v0, v2, s[0:3], 0 idxen
|
|
344 ; VERDE-NEXT: s_endpgm
|
|
345 ;
|
|
346 ; GFX8-LABEL: struct_buffer_store_vif16:
|
|
347 ; GFX8: ; %bb.0:
|
|
348 ; GFX8-NEXT: buffer_store_dword v0, v1, s[0:3], 0 idxen
|
|
349 ; GFX8-NEXT: s_endpgm
|
|
350 ;
|
|
351 ; GFX11-LABEL: struct_buffer_store_vif16:
|
|
352 ; GFX11: ; %bb.0:
|
|
353 ; GFX11-NEXT: buffer_store_b32 v0, v1, s[0:3], 0 idxen
|
|
354 ; GFX11-NEXT: s_nop 0
|
|
355 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
356 ; GFX11-NEXT: s_endpgm
|
150
|
357 call void @llvm.amdgcn.struct.buffer.store.v2i16(<2 x i16> %v1, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
358 ret void
|
|
359 }
|
|
360
|
|
361 define amdgpu_ps void @struct_buffer_store_v4i16(<4 x i32> inreg %rsrc, <4 x i16> %v1, i32 %index) {
|
252
|
362 ; VERDE-LABEL: struct_buffer_store_v4i16:
|
|
363 ; VERDE: ; %bb.0:
|
|
364 ; VERDE-NEXT: v_lshlrev_b32_e32 v3, 16, v3
|
|
365 ; VERDE-NEXT: v_and_b32_e32 v2, 0xffff, v2
|
|
366 ; VERDE-NEXT: v_lshlrev_b32_e32 v1, 16, v1
|
|
367 ; VERDE-NEXT: v_and_b32_e32 v0, 0xffff, v0
|
|
368 ; VERDE-NEXT: v_or_b32_e32 v2, v2, v3
|
|
369 ; VERDE-NEXT: v_or_b32_e32 v1, v0, v1
|
|
370 ; VERDE-NEXT: buffer_store_dwordx2 v[1:2], v4, s[0:3], 0 idxen
|
|
371 ; VERDE-NEXT: s_endpgm
|
|
372 ;
|
|
373 ; GFX8-LABEL: struct_buffer_store_v4i16:
|
|
374 ; GFX8: ; %bb.0:
|
|
375 ; GFX8-NEXT: buffer_store_dwordx2 v[0:1], v2, s[0:3], 0 idxen
|
|
376 ; GFX8-NEXT: s_endpgm
|
|
377 ;
|
|
378 ; GFX11-LABEL: struct_buffer_store_v4i16:
|
|
379 ; GFX11: ; %bb.0:
|
|
380 ; GFX11-NEXT: buffer_store_b64 v[0:1], v2, s[0:3], 0 idxen
|
|
381 ; GFX11-NEXT: s_nop 0
|
|
382 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
|
|
383 ; GFX11-NEXT: s_endpgm
|
150
|
384 call void @llvm.amdgcn.struct.buffer.store.v4i16(<4 x i16> %v1, <4 x i32> %rsrc, i32 %index, i32 0, i32 0, i32 0)
|
|
385 ret void
|
|
386 }
|
|
387
|
|
388 declare void @llvm.amdgcn.struct.buffer.store.f32(float, <4 x i32>, i32, i32, i32, i32) #0
|
|
389 declare void @llvm.amdgcn.struct.buffer.store.v2f32(<2 x float>, <4 x i32>, i32, i32, i32, i32) #0
|
|
390 declare void @llvm.amdgcn.struct.buffer.store.v4f32(<4 x float>, <4 x i32>, i32, i32, i32, i32) #0
|
|
391 declare void @llvm.amdgcn.struct.buffer.store.i32(i32, <4 x i32>, i32, i32, i32, i32) #0
|
|
392 declare void @llvm.amdgcn.struct.buffer.store.v2i32(<2 x i32>, <4 x i32>, i32, i32, i32, i32) #0
|
|
393 declare void @llvm.amdgcn.struct.buffer.store.v4i32(<4 x i32>, <4 x i32>, i32, i32, i32, i32) #0
|
|
394 declare <4 x float> @llvm.amdgcn.struct.buffer.load.v4f32(<4 x i32>, i32, i32, i32, i32) #1
|
|
395 declare void @llvm.amdgcn.struct.buffer.store.i8(i8, <4 x i32>, i32, i32, i32, i32) #0
|
|
396 declare void @llvm.amdgcn.struct.buffer.store.i16(i16, <4 x i32>, i32, i32, i32, i32) #0
|
|
397 declare void @llvm.amdgcn.struct.buffer.store.v2i16(<2 x i16>, <4 x i32>, i32, i32, i32, i32) #0
|
|
398 declare void @llvm.amdgcn.struct.buffer.store.v4i16(<4 x i16>, <4 x i32>, i32, i32, i32, i32) #0
|
|
399 declare void @llvm.amdgcn.struct.buffer.store.f16(half, <4 x i32>, i32, i32, i32, i32) #0
|
|
400 declare void @llvm.amdgcn.struct.buffer.store.v2f16(<2 x half>, <4 x i32>, i32, i32, i32, i32) #0
|
|
401 declare void @llvm.amdgcn.struct.buffer.store.v4f16(<4 x half>, <4 x i32>, i32, i32, i32, i32) #0
|
|
402
|
|
403 attributes #0 = { nounwind }
|
|
404 attributes #1 = { nounwind readonly }
|