1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,-wavefrontsize64 -verify-machineinstrs < %s | FileCheck %s --check-prefix=W32
4 declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v16f16(<16 x half>, <16 x half> , <8 x float>)
5 declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v16i16(<16 x i16>, <16 x i16> , <8 x float>)
6 declare <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half>, <16 x half> , <16 x half>, i1 immarg)
7 declare <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16>, <16 x i16> , <16 x i16>, i1 immarg)
8 declare <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 immarg, <4 x i32>, i1 immarg, <4 x i32> , <8 x i32>, i1 immarg)
9 declare <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 immarg, <2 x i32>, i1 immarg, <2 x i32> , <8 x i32>, i1 immarg)
11 ; The tests demonstrate that the following WMMA register constraints are satisfied.
14 ; A and B cannot overlap with D. C cannot partially overlap with D, but it is OK for them to be the same (which is a typical case).
17 ; - first wmma instruction: the dest register D is different than all the sources
18 ; - second wmma instruction: the dest register D and src2 (C) are the same
21 ; @llvm.amdgcn.wmma.f32.16x16x16.f16
23 define amdgpu_ps void @test_wmma_f32_16x16x16_f16(<16 x half> %A, <16 x half> %B, <8 x float> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
24 ; W32-LABEL: test_wmma_f32_16x16x16_f16:
26 ; W32-NEXT: v_wmma_f32_16x16x16_f16 v[28:35], v[0:7], v[8:15], v[16:23]
27 ; W32-NEXT: v_wmma_f32_16x16x16_f16 v[16:23], v[8:15], v[8:15], v[16:23]
28 ; W32-NEXT: s_clause 0x1
29 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
30 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
31 ; W32-NEXT: s_clause 0x1
32 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
33 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
35 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
38 %res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v16f16(<16 x half> %A, <16 x half> %B, <8 x float> %C)
39 %res2 = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v16f16(<16 x half> %B, <16 x half> %B, <8 x float> %C)
40 store <8 x float> %res, ptr addrspace(1) %out, align 32
41 store <8 x float> %res2, ptr addrspace(1) %out2, align 32
45 ; @llvm.amdgcn.wmma.f32.16x16x16.bf16
47 define amdgpu_ps void @test_wmma_f32_16x16x16_bf16(<16 x i16> %A, <16 x i16> %B, <8 x float> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
48 ; W32-LABEL: test_wmma_f32_16x16x16_bf16:
50 ; W32-NEXT: v_wmma_f32_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23]
51 ; W32-NEXT: v_wmma_f32_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23]
52 ; W32-NEXT: s_clause 0x1
53 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
54 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
55 ; W32-NEXT: s_clause 0x1
56 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
57 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
59 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
62 %res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v16i16(<16 x i16> %A, <16 x i16> %B, <8 x float> %C)
63 %res2 = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v16i16(<16 x i16> %B, <16 x i16> %B, <8 x float> %C)
64 store <8 x float> %res, ptr addrspace(1) %out, align 32
65 store <8 x float> %res2, ptr addrspace(1) %out2, align 32
69 ; @llvm.amdgcn.wmma.f16.16x16x16.f16
71 define amdgpu_ps void @test_wmma_f16_16x16x16_f16_lo(<16 x half> %A, <16 x half> %B, <16 x half> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
72 ; W32-LABEL: test_wmma_f16_16x16x16_f16_lo:
74 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[28:35], v[0:7], v[8:15], v[16:23]
75 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[16:23], v[8:15], v[8:15], v[16:23]
76 ; W32-NEXT: s_clause 0x1
77 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
78 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
79 ; W32-NEXT: s_clause 0x1
80 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
81 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
83 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
86 %res = call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half> %A, <16 x half> %B, <16 x half> %C, i1 0)
87 %res2 = call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half> %B, <16 x half> %B, <16 x half> %C, i1 0)
88 store <16 x half> %res, ptr addrspace(1) %out, align 32
89 store <16 x half> %res2, ptr addrspace(1) %out2, align 32
93 define amdgpu_ps void @test_wmma_f16_16x16x16_f16_hi(<16 x half> %A, <16 x half> %B, <16 x half> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
94 ; W32-LABEL: test_wmma_f16_16x16x16_f16_hi:
96 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[28:35], v[0:7], v[8:15], v[16:23] op_sel:[0,0,1]
97 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[16:23], v[8:15], v[8:15], v[16:23] op_sel:[0,0,1]
98 ; W32-NEXT: s_clause 0x1
99 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
100 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
101 ; W32-NEXT: s_clause 0x1
102 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
103 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
105 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
108 %res = call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half> %A, <16 x half> %B, <16 x half> %C, i1 1)
109 %res2 = call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half> %B, <16 x half> %B, <16 x half> %C, i1 1)
110 store <16 x half> %res, ptr addrspace(1) %out, align 32
111 store <16 x half> %res2, ptr addrspace(1) %out2, align 32
115 ; @llvm.amdgcn.wmma.bf16.16x16x16.bf16
117 define amdgpu_ps void @test_wmma_bf16_16x16x16_bf16_lo(<16 x i16> %A, <16 x i16> %B, <16 x i16> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
118 ; W32-LABEL: test_wmma_bf16_16x16x16_bf16_lo:
119 ; W32: ; %bb.0: ; %bb
120 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23]
121 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23]
122 ; W32-NEXT: s_clause 0x1
123 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
124 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
125 ; W32-NEXT: s_clause 0x1
126 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
127 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
129 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
132 %res = call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16> %A, <16 x i16> %B, <16 x i16> %C, i1 0)
133 %res2 = call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16> %B, <16 x i16> %B, <16 x i16> %C, i1 0)
134 store <16 x i16> %res, ptr addrspace(1) %out, align 32
135 store <16 x i16> %res2, ptr addrspace(1) %out2, align 32
139 define amdgpu_ps void @test_wmma_bf16_16x16x16_bf16_hi(<16 x i16> %A, <16 x i16> %B, <16 x i16> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
140 ; W32-LABEL: test_wmma_bf16_16x16x16_bf16_hi:
141 ; W32: ; %bb.0: ; %bb
142 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23] op_sel:[0,0,1]
143 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23] op_sel:[0,0,1]
144 ; W32-NEXT: s_clause 0x1
145 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
146 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
147 ; W32-NEXT: s_clause 0x1
148 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
149 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
151 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
154 %res = call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16> %A, <16 x i16> %B, <16 x i16> %C, i1 1)
155 %res2 = call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16> %B, <16 x i16> %B, <16 x i16> %C, i1 1)
156 store <16 x i16> %res, ptr addrspace(1) %out, align 32
157 store <16 x i16> %res2, ptr addrspace(1) %out2, align 32
161 ; @llvm.amdgcn.wmma.i32.16x16x16.iu8
163 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_unsigned(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
164 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned:
165 ; W32: ; %bb.0: ; %bb
166 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15]
167 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15]
168 ; W32-NEXT: s_clause 0x1
169 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
170 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
171 ; W32-NEXT: s_clause 0x1
172 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
173 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
175 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
178 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %A, i1 0, <4 x i32> %B, <8 x i32> %C, i1 0)
179 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %B, i1 0, <4 x i32> %B, <8 x i32> %C, i1 0)
180 store <8 x i32> %res, ptr addrspace(1) %out, align 32
181 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
185 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_signed(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
186 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_signed:
187 ; W32: ; %bb.0: ; %bb
188 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[0,1,0]
189 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[0,1,0]
190 ; W32-NEXT: s_clause 0x1
191 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
192 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
193 ; W32-NEXT: s_clause 0x1
194 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
195 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
197 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
200 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %A, i1 1, <4 x i32> %B, <8 x i32> %C, i1 0)
201 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %B, i1 1, <4 x i32> %B, <8 x i32> %C, i1 0)
202 store <8 x i32> %res, ptr addrspace(1) %out, align 32
203 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
207 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_unsigned(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
208 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned:
209 ; W32: ; %bb.0: ; %bb
210 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,0,0]
211 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,0,0]
212 ; W32-NEXT: s_clause 0x1
213 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
214 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
215 ; W32-NEXT: s_clause 0x1
216 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
217 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
219 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
222 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %A, i1 0, <4 x i32> %B, <8 x i32> %C, i1 0)
223 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %B, i1 0, <4 x i32> %B, <8 x i32> %C, i1 0)
224 store <8 x i32> %res, ptr addrspace(1) %out, align 32
225 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
229 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_signed(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
230 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed:
231 ; W32: ; %bb.0: ; %bb
232 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,1,0]
233 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,1,0]
234 ; W32-NEXT: s_clause 0x1
235 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
236 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
237 ; W32-NEXT: s_clause 0x1
238 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
239 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
241 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
244 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %A, i1 1, <4 x i32> %B, <8 x i32> %C, i1 0)
245 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %B, i1 1, <4 x i32> %B, <8 x i32> %C, i1 0)
246 store <8 x i32> %res, ptr addrspace(1) %out, align 32
247 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
251 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_unsigned_clamp(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
252 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned_clamp:
253 ; W32: ; %bb.0: ; %bb
254 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] clamp
255 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] clamp
256 ; W32-NEXT: s_clause 0x1
257 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
258 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
259 ; W32-NEXT: s_clause 0x1
260 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
261 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
263 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
266 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %A, i1 0, <4 x i32> %B, <8 x i32> %C, i1 1)
267 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %B, i1 0, <4 x i32> %B, <8 x i32> %C, i1 1)
268 store <8 x i32> %res, ptr addrspace(1) %out, align 32
269 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
273 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_signed_clamp(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
274 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_signed_clamp:
275 ; W32: ; %bb.0: ; %bb
276 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[0,1,0] clamp
277 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[0,1,0] clamp
278 ; W32-NEXT: s_clause 0x1
279 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
280 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
281 ; W32-NEXT: s_clause 0x1
282 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
283 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
285 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
288 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %A, i1 1, <4 x i32> %B, <8 x i32> %C, i1 1)
289 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 0, <4 x i32> %B, i1 1, <4 x i32> %B, <8 x i32> %C, i1 1)
290 store <8 x i32> %res, ptr addrspace(1) %out, align 32
291 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
295 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_unsigned_clamp(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
296 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned_clamp:
297 ; W32: ; %bb.0: ; %bb
298 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,0,0] clamp
299 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,0,0] clamp
300 ; W32-NEXT: s_clause 0x1
301 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
302 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
303 ; W32-NEXT: s_clause 0x1
304 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
305 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
307 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
310 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %A, i1 0, <4 x i32> %B, <8 x i32> %C, i1 1)
311 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %B, i1 0, <4 x i32> %B, <8 x i32> %C, i1 1)
312 store <8 x i32> %res, ptr addrspace(1) %out, align 32
313 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
317 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_signed_clamp(<4 x i32> %A, <4 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
318 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed_clamp:
319 ; W32: ; %bb.0: ; %bb
320 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,1,0] clamp
321 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,1,0] clamp
322 ; W32-NEXT: s_clause 0x1
323 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
324 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
325 ; W32-NEXT: s_clause 0x1
326 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
327 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
329 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
332 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %A, i1 1, <4 x i32> %B, <8 x i32> %C, i1 1)
333 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 1, <4 x i32> %B, i1 1, <4 x i32> %B, <8 x i32> %C, i1 1)
334 store <8 x i32> %res, ptr addrspace(1) %out, align 32
335 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
339 ; @llvm.amdgcn.wmma.i32.16x16x16.iu4
341 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_unsigned(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
342 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned:
343 ; W32: ; %bb.0: ; %bb
344 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11]
345 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11]
346 ; W32-NEXT: s_clause 0x1
347 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
348 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
349 ; W32-NEXT: s_clause 0x1
350 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
351 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
353 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
356 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %A, i1 0, <2 x i32> %B, <8 x i32> %C, i1 0)
357 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %B, i1 0, <2 x i32> %B, <8 x i32> %C, i1 0)
358 store <8 x i32> %res, ptr addrspace(1) %out, align 32
359 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
363 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_signed(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
364 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed:
365 ; W32: ; %bb.0: ; %bb
366 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[0,1,0]
367 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[0,1,0]
368 ; W32-NEXT: s_clause 0x1
369 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
370 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
371 ; W32-NEXT: s_clause 0x1
372 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
373 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
375 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
378 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %A, i1 1, <2 x i32> %B, <8 x i32> %C, i1 0)
379 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %B, i1 1, <2 x i32> %B, <8 x i32> %C, i1 0)
380 store <8 x i32> %res, ptr addrspace(1) %out, align 32
381 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
385 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_unsigned(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
386 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned:
387 ; W32: ; %bb.0: ; %bb
388 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,0,0]
389 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,0,0]
390 ; W32-NEXT: s_clause 0x1
391 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
392 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
393 ; W32-NEXT: s_clause 0x1
394 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
395 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
397 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
400 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %A, i1 0, <2 x i32> %B, <8 x i32> %C, i1 0)
401 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %B, i1 0, <2 x i32> %B, <8 x i32> %C, i1 0)
402 store <8 x i32> %res, ptr addrspace(1) %out, align 32
403 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
407 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_signed(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
408 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed:
409 ; W32: ; %bb.0: ; %bb
410 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,1,0]
411 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,1,0]
412 ; W32-NEXT: s_clause 0x1
413 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
414 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
415 ; W32-NEXT: s_clause 0x1
416 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
417 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
419 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
422 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %A, i1 1, <2 x i32> %B, <8 x i32> %C, i1 0)
423 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %B, i1 1, <2 x i32> %B, <8 x i32> %C, i1 0)
424 store <8 x i32> %res, ptr addrspace(1) %out, align 32
425 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
430 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_unsigned_clamp(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
431 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned_clamp:
432 ; W32: ; %bb.0: ; %bb
433 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] clamp
434 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] clamp
435 ; W32-NEXT: s_clause 0x1
436 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
437 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
438 ; W32-NEXT: s_clause 0x1
439 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
440 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
442 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
445 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %A, i1 0, <2 x i32> %B, <8 x i32> %C, i1 1)
446 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %B, i1 0, <2 x i32> %B, <8 x i32> %C, i1 1)
447 store <8 x i32> %res, ptr addrspace(1) %out, align 32
448 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
452 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_signed_clamp(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
453 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed_clamp:
454 ; W32: ; %bb.0: ; %bb
455 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[0,1,0] clamp
456 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[0,1,0] clamp
457 ; W32-NEXT: s_clause 0x1
458 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
459 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
460 ; W32-NEXT: s_clause 0x1
461 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
462 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
464 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
467 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %A, i1 1, <2 x i32> %B, <8 x i32> %C, i1 1)
468 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 0, <2 x i32> %B, i1 1, <2 x i32> %B, <8 x i32> %C, i1 1)
469 store <8 x i32> %res, ptr addrspace(1) %out, align 32
470 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
474 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_unsigned_clamp(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
475 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned_clamp:
476 ; W32: ; %bb.0: ; %bb
477 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,0,0] clamp
478 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,0,0] clamp
479 ; W32-NEXT: s_clause 0x1
480 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
481 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
482 ; W32-NEXT: s_clause 0x1
483 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
484 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
486 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
489 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %A, i1 0, <2 x i32> %B, <8 x i32> %C, i1 1)
490 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %B, i1 0, <2 x i32> %B, <8 x i32> %C, i1 1)
491 store <8 x i32> %res, ptr addrspace(1) %out, align 32
492 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
496 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_signed_clamp(<2 x i32> %A, <2 x i32> %B, <8 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
497 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed_clamp:
498 ; W32: ; %bb.0: ; %bb
499 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,1,0] clamp
500 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,1,0] clamp
501 ; W32-NEXT: s_clause 0x1
502 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
503 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
504 ; W32-NEXT: s_clause 0x1
505 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
506 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
508 ; W32-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
511 %res = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %A, i1 1, <2 x i32> %B, <8 x i32> %C, i1 1)
512 %res2 = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 1, <2 x i32> %B, i1 1, <2 x i32> %B, <8 x i32> %C, i1 1)
513 store <8 x i32> %res, ptr addrspace(1) %out, align 32
514 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32