1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=-wavefrontsize32,+wavefrontsize64 -verify-machineinstrs < %s | FileCheck %s --check-prefix=W64
4 declare <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16(<16 x half>, <16 x half>, <4 x float>)
5 declare <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16(<16 x i16>, <16 x i16>, <4 x float>)
6 declare <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16(<16 x half>, <16 x half>, <8 x half>, i1 immarg)
7 declare <8 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16(<16 x i16>, <16 x i16>, <8 x i16>, i1 immarg)
8 declare <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 immarg, <4 x i32>, i1 immarg, <4 x i32>, <4 x i32>, i1 immarg)
9 declare <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 immarg, <2 x i32>, i1 immarg, <2 x i32>, <4 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, <4 x float> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
24 ; W64-LABEL: test_wmma_f32_16x16x16_f16:
26 ; W64-NEXT: v_wmma_f32_16x16x16_f16 v[24:27], v[0:7], v[8:15], v[16:19]
27 ; W64-NEXT: v_wmma_f32_16x16x16_f16 v[16:19], v[8:15], v[8:15], v[16:19]
28 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
29 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
31 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
34 %res = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16(<16 x half> %A, <16 x half> %B, <4 x float> %C)
35 %res2 = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16(<16 x half> %B, <16 x half> %B, <4 x float> %C)
36 store <4 x float> %res, ptr addrspace(1) %out, align 16
37 store <4 x float> %res2, ptr addrspace(1) %out2, align 16
41 ; @llvm.amdgcn.wmma.f32.16x16x16.bf16
43 define amdgpu_ps void @test_wmma_f32_16x16x16_bf16(<16 x i16> %A, <16 x i16> %B, <4 x float> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
44 ; W64-LABEL: test_wmma_f32_16x16x16_bf16:
46 ; W64-NEXT: v_wmma_f32_16x16x16_bf16 v[24:27], v[0:7], v[8:15], v[16:19]
47 ; W64-NEXT: v_wmma_f32_16x16x16_bf16 v[16:19], v[8:15], v[8:15], v[16:19]
48 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
49 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
51 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
54 %res = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16(<16 x i16> %A, <16 x i16> %B, <4 x float> %C)
55 %res2 = call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16(<16 x i16> %B, <16 x i16> %B, <4 x float> %C)
56 store <4 x float> %res, ptr addrspace(1) %out, align 16
57 store <4 x float> %res2, ptr addrspace(1) %out2, align 16
61 ; @llvm.amdgcn.wmma.f16.16x16x16.f16
63 define amdgpu_ps void @test_wmma_f16_16x16x16_f16_lo(<16 x half> %A, <16 x half> %B, <8 x half> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
64 ; W64-LABEL: test_wmma_f16_16x16x16_f16_lo:
66 ; W64-NEXT: v_wmma_f16_16x16x16_f16 v[24:27], v[0:7], v[8:15], v[16:19]
67 ; W64-NEXT: v_wmma_f16_16x16x16_f16 v[16:19], v[8:15], v[8:15], v[16:19]
68 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
69 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
71 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
74 %res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16(<16 x half> %A, <16 x half> %B, <8 x half> %C, i1 0)
75 %res2 = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16(<16 x half> %B, <16 x half> %B, <8 x half> %C, i1 0)
76 store <8 x half> %res, ptr addrspace(1) %out, align 16
77 store <8 x half> %res2, ptr addrspace(1) %out2, align 16
81 define amdgpu_ps void @test_wmma_f16_16x16x16_f16_hi(<16 x half> %A, <16 x half> %B, <8 x half> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
82 ; W64-LABEL: test_wmma_f16_16x16x16_f16_hi:
84 ; W64-NEXT: v_wmma_f16_16x16x16_f16 v[24:27], v[0:7], v[8:15], v[16:19] op_sel:[0,0,1]
85 ; W64-NEXT: v_wmma_f16_16x16x16_f16 v[16:19], v[8:15], v[8:15], v[16:19] op_sel:[0,0,1]
86 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
87 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
89 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
92 %res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16(<16 x half> %A, <16 x half> %B, <8 x half> %C, i1 1)
93 %res2 = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16(<16 x half> %B, <16 x half> %B, <8 x half> %C, i1 1)
94 store <8 x half> %res, ptr addrspace(1) %out, align 16
95 store <8 x half> %res2, ptr addrspace(1) %out2, align 16
99 ; @llvm.amdgcn.wmma.bf16.16x16x16.bf16
101 define amdgpu_ps void @test_wmma_bf16_16x16x16_bf16_lo(<16 x i16> %A, <16 x i16> %B, <8 x i16> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
102 ; W64-LABEL: test_wmma_bf16_16x16x16_bf16_lo:
103 ; W64: ; %bb.0: ; %bb
104 ; W64-NEXT: v_wmma_bf16_16x16x16_bf16 v[24:27], v[0:7], v[8:15], v[16:19]
105 ; W64-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:19], v[8:15], v[8:15], v[16:19]
106 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
107 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
109 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
112 %res = call <8 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16(<16 x i16> %A, <16 x i16> %B, <8 x i16> %C, i1 0)
113 %res2 = call <8 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16(<16 x i16> %B, <16 x i16> %B, <8 x i16> %C, i1 0)
114 store <8 x i16> %res, ptr addrspace(1) %out, align 16
115 store <8 x i16> %res2, ptr addrspace(1) %out2, align 16
119 define amdgpu_ps void @test_wmma_bf16_16x16x16_bf16_hi(<16 x i16> %A, <16 x i16> %B, <8 x i16> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
120 ; W64-LABEL: test_wmma_bf16_16x16x16_bf16_hi:
121 ; W64: ; %bb.0: ; %bb
122 ; W64-NEXT: v_wmma_bf16_16x16x16_bf16 v[24:27], v[0:7], v[8:15], v[16:19] op_sel:[0,0,1]
123 ; W64-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:19], v[8:15], v[8:15], v[16:19] op_sel:[0,0,1]
124 ; W64-NEXT: global_store_b128 v[20:21], v[24:27], off
125 ; W64-NEXT: global_store_b128 v[22:23], v[16:19], off
127 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
130 %res = call <8 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16(<16 x i16> %A, <16 x i16> %B, <8 x i16> %C, i1 1)
131 %res2 = call <8 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16(<16 x i16> %B, <16 x i16> %B, <8 x i16> %C, i1 1)
132 store <8 x i16> %res, ptr addrspace(1) %out, align 16
133 store <8 x i16> %res2, ptr addrspace(1) %out2, align 16
137 ; @llvm.amdgcn.wmma.i32.16x16x16.iu8
139 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_unsigned(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
140 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned:
141 ; W64: ; %bb.0: ; %bb
142 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11]
143 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11]
144 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
145 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
147 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
150 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %A, i1 0, <4 x i32> %B, <4 x i32> %C, i1 0)
151 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %B, i1 0, <4 x i32> %B, <4 x i32> %C, i1 0)
152 store <4 x i32> %res, ptr addrspace(1) %out, align 16
153 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
158 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_signed(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
159 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_signed:
160 ; W64: ; %bb.0: ; %bb
161 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[0,1,0]
162 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[0,1,0]
163 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
164 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
166 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
169 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %A, i1 1, <4 x i32> %B, <4 x i32> %C, i1 0)
170 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %B, i1 1, <4 x i32> %B, <4 x i32> %C, i1 0)
171 store <4 x i32> %res, ptr addrspace(1) %out, align 16
172 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
176 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_unsigned(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
177 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned:
178 ; W64: ; %bb.0: ; %bb
179 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[1,0,0]
180 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[1,0,0]
181 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
182 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
184 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
187 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %A, i1 0, <4 x i32> %B, <4 x i32> %C, i1 0)
188 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %B, i1 0, <4 x i32> %B, <4 x i32> %C, i1 0)
189 store <4 x i32> %res, ptr addrspace(1) %out, align 16
190 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
194 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_signed(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
195 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed:
196 ; W64: ; %bb.0: ; %bb
197 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[1,1,0]
198 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[1,1,0]
199 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
200 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
202 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
205 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %A, i1 1, <4 x i32> %B, <4 x i32> %C, i1 0)
206 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %B, i1 1, <4 x i32> %B, <4 x i32> %C, i1 0)
207 store <4 x i32> %res, ptr addrspace(1) %out, align 16
208 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
212 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_unsigned_clamp(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
213 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned_clamp:
214 ; W64: ; %bb.0: ; %bb
215 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] clamp
216 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] clamp
217 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
218 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
220 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
223 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %A, i1 0, <4 x i32> %B, <4 x i32> %C, i1 1)
224 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %B, i1 0, <4 x i32> %B, <4 x i32> %C, i1 1)
225 store <4 x i32> %res, ptr addrspace(1) %out, align 16
226 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
230 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_unsigned_signed_clamp(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
231 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_signed_clamp:
232 ; W64: ; %bb.0: ; %bb
233 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[0,1,0] clamp
234 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[0,1,0] clamp
235 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
236 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
238 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
241 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %A, i1 1, <4 x i32> %B, <4 x i32> %C, i1 1)
242 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 0, <4 x i32> %B, i1 1, <4 x i32> %B, <4 x i32> %C, i1 1)
243 store <4 x i32> %res, ptr addrspace(1) %out, align 16
244 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
248 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_unsigned_clamp(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
249 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned_clamp:
250 ; W64: ; %bb.0: ; %bb
251 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[1,0,0] clamp
252 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[1,0,0] clamp
253 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
254 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
256 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
259 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %A, i1 0, <4 x i32> %B, <4 x i32> %C, i1 1)
260 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %B, i1 0, <4 x i32> %B, <4 x i32> %C, i1 1)
261 store <4 x i32> %res, ptr addrspace(1) %out, align 16
262 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
266 define amdgpu_ps void @test_wmma_i32_16x16x16_ui8_signed_signed_clamp(<4 x i32> %A, <4 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
267 ; W64-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed_clamp:
268 ; W64: ; %bb.0: ; %bb
269 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[16:19], v[0:3], v[4:7], v[8:11] neg_lo:[1,1,0] clamp
270 ; W64-NEXT: v_wmma_i32_16x16x16_iu8 v[8:11], v[4:7], v[4:7], v[8:11] neg_lo:[1,1,0] clamp
271 ; W64-NEXT: global_store_b128 v[12:13], v[16:19], off
272 ; W64-NEXT: global_store_b128 v[14:15], v[8:11], off
274 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
277 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %A, i1 1, <4 x i32> %B, <4 x i32> %C, i1 1)
278 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8(i1 1, <4 x i32> %B, i1 1, <4 x i32> %B, <4 x i32> %C, i1 1)
279 store <4 x i32> %res, ptr addrspace(1) %out, align 16
280 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
284 ; @llvm.amdgcn.wmma.i32.16x16x16.iu4
286 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_unsigned(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
287 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned:
288 ; W64: ; %bb.0: ; %bb
289 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7]
290 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7]
291 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
292 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
294 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
297 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %A, i1 0, <2 x i32> %B, <4 x i32> %C, i1 0)
298 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %B, i1 0, <2 x i32> %B, <4 x i32> %C, i1 0)
299 store <4 x i32> %res, ptr addrspace(1) %out, align 16
300 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
304 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_signed(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
305 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed:
306 ; W64: ; %bb.0: ; %bb
307 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[0,1,0]
308 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[0,1,0]
309 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
310 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
312 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
315 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %A, i1 1, <2 x i32> %B, <4 x i32> %C, i1 0)
316 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %B, i1 1, <2 x i32> %B, <4 x i32> %C, i1 0)
317 store <4 x i32> %res, ptr addrspace(1) %out, align 16
318 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
322 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_unsigned(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
323 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned:
324 ; W64: ; %bb.0: ; %bb
325 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[1,0,0]
326 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[1,0,0]
327 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
328 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
330 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
333 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %A, i1 0, <2 x i32> %B, <4 x i32> %C, i1 0)
334 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %B, i1 0, <2 x i32> %B, <4 x i32> %C, i1 0)
335 store <4 x i32> %res, ptr addrspace(1) %out, align 16
336 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
340 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_signed(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
341 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed:
342 ; W64: ; %bb.0: ; %bb
343 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[1,1,0]
344 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[1,1,0]
345 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
346 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
348 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
351 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %A, i1 1, <2 x i32> %B, <4 x i32> %C, i1 0)
352 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %B, i1 1, <2 x i32> %B, <4 x i32> %C, i1 0)
353 store <4 x i32> %res, ptr addrspace(1) %out, align 16
354 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
358 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_unsigned_clamp(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
359 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned_clamp:
360 ; W64: ; %bb.0: ; %bb
361 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] clamp
362 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] clamp
363 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
364 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
366 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
369 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %A, i1 0, <2 x i32> %B, <4 x i32> %C, i1 1)
370 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %B, i1 0, <2 x i32> %B, <4 x i32> %C, i1 1)
371 store <4 x i32> %res, ptr addrspace(1) %out, align 16
372 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
376 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_unsigned_signed_clamp(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
377 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed_clamp:
378 ; W64: ; %bb.0: ; %bb
379 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[0,1,0] clamp
380 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[0,1,0] clamp
381 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
382 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
384 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
387 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %A, i1 1, <2 x i32> %B, <4 x i32> %C, i1 1)
388 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 0, <2 x i32> %B, i1 1, <2 x i32> %B, <4 x i32> %C, i1 1)
389 store <4 x i32> %res, ptr addrspace(1) %out, align 16
390 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
394 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_unsigned_clamp(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
395 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned_clamp:
396 ; W64: ; %bb.0: ; %bb
397 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[1,0,0] clamp
398 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[1,0,0] clamp
399 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
400 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
402 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
405 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %A, i1 0, <2 x i32> %B, <4 x i32> %C, i1 1)
406 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %B, i1 0, <2 x i32> %B, <4 x i32> %C, i1 1)
407 store <4 x i32> %res, ptr addrspace(1) %out, align 16
408 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16
412 define amdgpu_ps void @test_wmma_i32_16x16x16_ui4_signed_signed_clamp(<2 x i32> %A, <2 x i32> %B, <4 x i32> %C, ptr addrspace(1) %out, ptr addrspace(1) %out2) {
413 ; W64-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed_clamp:
414 ; W64: ; %bb.0: ; %bb
415 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[12:15], v[0:1], v[2:3], v[4:7] neg_lo:[1,1,0] clamp
416 ; W64-NEXT: v_wmma_i32_16x16x16_iu4 v[4:7], v[2:3], v[2:3], v[4:7] neg_lo:[1,1,0] clamp
417 ; W64-NEXT: global_store_b128 v[8:9], v[12:15], off
418 ; W64-NEXT: global_store_b128 v[10:11], v[4:7], off
420 ; W64-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
423 %res = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %A, i1 1, <2 x i32> %B, <4 x i32> %C, i1 1)
424 %res2 = call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4(i1 1, <2 x i32> %B, i1 1, <2 x i32> %B, <4 x i32> %C, i1 1)
425 store <4 x i32> %res, ptr addrspace(1) %out, align 16
426 store <4 x i32> %res2, ptr addrspace(1) %out2, align 16