1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32 -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
36 %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)
37 %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)
38 store <8 x float> %res, ptr addrspace(1) %out, align 32
39 store <8 x float> %res2, ptr addrspace(1) %out2, align 32
43 ; @llvm.amdgcn.wmma.f32.16x16x16.bf16
45 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) {
46 ; W32-LABEL: test_wmma_f32_16x16x16_bf16:
48 ; W32-NEXT: v_wmma_f32_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23]
49 ; W32-NEXT: v_wmma_f32_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23]
50 ; W32-NEXT: s_clause 0x1
51 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
52 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
53 ; W32-NEXT: s_clause 0x1
54 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
55 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
58 %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)
59 %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)
60 store <8 x float> %res, ptr addrspace(1) %out, align 32
61 store <8 x float> %res2, ptr addrspace(1) %out2, align 32
65 ; @llvm.amdgcn.wmma.f16.16x16x16.f16
67 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) {
68 ; W32-LABEL: test_wmma_f16_16x16x16_f16_lo:
70 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[28:35], v[0:7], v[8:15], v[16:23]
71 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[16:23], v[8:15], v[8:15], v[16:23]
72 ; W32-NEXT: s_clause 0x1
73 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
74 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
75 ; W32-NEXT: s_clause 0x1
76 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
77 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
80 %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)
81 %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)
82 store <16 x half> %res, ptr addrspace(1) %out, align 32
83 store <16 x half> %res2, ptr addrspace(1) %out2, align 32
87 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) {
88 ; W32-LABEL: test_wmma_f16_16x16x16_f16_hi:
90 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[28:35], v[0:7], v[8:15], v[16:23] op_sel:[0,0,1]
91 ; W32-NEXT: v_wmma_f16_16x16x16_f16 v[16:23], v[8:15], v[8:15], v[16:23] op_sel:[0,0,1]
92 ; W32-NEXT: s_clause 0x1
93 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
94 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
95 ; W32-NEXT: s_clause 0x1
96 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
97 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
100 %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)
101 %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)
102 store <16 x half> %res, ptr addrspace(1) %out, align 32
103 store <16 x half> %res2, ptr addrspace(1) %out2, align 32
107 ; @llvm.amdgcn.wmma.bf16.16x16x16.bf16
109 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) {
110 ; W32-LABEL: test_wmma_bf16_16x16x16_bf16_lo:
111 ; W32: ; %bb.0: ; %bb
112 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23]
113 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23]
114 ; W32-NEXT: s_clause 0x1
115 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
116 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
117 ; W32-NEXT: s_clause 0x1
118 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
119 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
122 %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)
123 %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)
124 store <16 x i16> %res, ptr addrspace(1) %out, align 32
125 store <16 x i16> %res2, ptr addrspace(1) %out2, align 32
129 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) {
130 ; W32-LABEL: test_wmma_bf16_16x16x16_bf16_hi:
131 ; W32: ; %bb.0: ; %bb
132 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[28:35], v[0:7], v[8:15], v[16:23] op_sel:[0,0,1]
133 ; W32-NEXT: v_wmma_bf16_16x16x16_bf16 v[16:23], v[8:15], v[8:15], v[16:23] op_sel:[0,0,1]
134 ; W32-NEXT: s_clause 0x1
135 ; W32-NEXT: global_store_b128 v[24:25], v[32:35], off offset:16
136 ; W32-NEXT: global_store_b128 v[24:25], v[28:31], off
137 ; W32-NEXT: s_clause 0x1
138 ; W32-NEXT: global_store_b128 v[26:27], v[20:23], off offset:16
139 ; W32-NEXT: global_store_b128 v[26:27], v[16:19], off
142 %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)
143 %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)
144 store <16 x i16> %res, ptr addrspace(1) %out, align 32
145 store <16 x i16> %res2, ptr addrspace(1) %out2, align 32
149 ; @llvm.amdgcn.wmma.i32.16x16x16.iu8
151 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) {
152 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned:
153 ; W32: ; %bb.0: ; %bb
154 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15]
155 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15]
156 ; W32-NEXT: s_clause 0x1
157 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
158 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
159 ; W32-NEXT: s_clause 0x1
160 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
161 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
164 %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)
165 %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)
166 store <8 x i32> %res, ptr addrspace(1) %out, align 32
167 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
171 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) {
172 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_signed:
173 ; W32: ; %bb.0: ; %bb
174 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[0,1,0]
175 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[0,1,0]
176 ; W32-NEXT: s_clause 0x1
177 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
178 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
179 ; W32-NEXT: s_clause 0x1
180 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
181 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
184 %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)
185 %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)
186 store <8 x i32> %res, ptr addrspace(1) %out, align 32
187 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
191 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) {
192 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned:
193 ; W32: ; %bb.0: ; %bb
194 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,0,0]
195 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,0,0]
196 ; W32-NEXT: s_clause 0x1
197 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
198 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
199 ; W32-NEXT: s_clause 0x1
200 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
201 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
204 %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)
205 %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)
206 store <8 x i32> %res, ptr addrspace(1) %out, align 32
207 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
211 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) {
212 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed:
213 ; W32: ; %bb.0: ; %bb
214 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] neg_lo:[1,1,0]
215 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] neg_lo:[1,1,0]
216 ; W32-NEXT: s_clause 0x1
217 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
218 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
219 ; W32-NEXT: s_clause 0x1
220 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
221 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
224 %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)
225 %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)
226 store <8 x i32> %res, ptr addrspace(1) %out, align 32
227 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
231 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) {
232 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_unsigned_unsigned_clamp:
233 ; W32: ; %bb.0: ; %bb
234 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[20:27], v[0:3], v[4:7], v[8:15] clamp
235 ; W32-NEXT: v_wmma_i32_16x16x16_iu8 v[8:15], v[4:7], v[4:7], v[8:15] clamp
236 ; W32-NEXT: s_clause 0x1
237 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
238 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
239 ; W32-NEXT: s_clause 0x1
240 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
241 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
244 %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)
245 %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)
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_signed_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_signed_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] neg_lo:[0,1,0] clamp
255 ; 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
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
264 %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)
265 %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)
266 store <8 x i32> %res, ptr addrspace(1) %out, align 32
267 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
271 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) {
272 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_unsigned_clamp:
273 ; W32: ; %bb.0: ; %bb
274 ; 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
275 ; 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
276 ; W32-NEXT: s_clause 0x1
277 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
278 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
279 ; W32-NEXT: s_clause 0x1
280 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
281 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
284 %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)
285 %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)
286 store <8 x i32> %res, ptr addrspace(1) %out, align 32
287 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
291 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) {
292 ; W32-LABEL: test_wmma_i32_16x16x16_ui8_signed_signed_clamp:
293 ; W32: ; %bb.0: ; %bb
294 ; 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
295 ; 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
296 ; W32-NEXT: s_clause 0x1
297 ; W32-NEXT: global_store_b128 v[16:17], v[24:27], off offset:16
298 ; W32-NEXT: global_store_b128 v[16:17], v[20:23], off
299 ; W32-NEXT: s_clause 0x1
300 ; W32-NEXT: global_store_b128 v[18:19], v[12:15], off offset:16
301 ; W32-NEXT: global_store_b128 v[18:19], v[8:11], off
304 %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)
305 %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)
306 store <8 x i32> %res, ptr addrspace(1) %out, align 32
307 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
311 ; @llvm.amdgcn.wmma.i32.16x16x16.iu4
313 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) {
314 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned:
315 ; W32: ; %bb.0: ; %bb
316 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11]
317 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11]
318 ; W32-NEXT: s_clause 0x1
319 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
320 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
321 ; W32-NEXT: s_clause 0x1
322 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
323 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
326 %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)
327 %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)
328 store <8 x i32> %res, ptr addrspace(1) %out, align 32
329 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
333 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) {
334 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed:
335 ; W32: ; %bb.0: ; %bb
336 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[0,1,0]
337 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[0,1,0]
338 ; W32-NEXT: s_clause 0x1
339 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
340 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
341 ; W32-NEXT: s_clause 0x1
342 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
343 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
346 %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)
347 %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)
348 store <8 x i32> %res, ptr addrspace(1) %out, align 32
349 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
353 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) {
354 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned:
355 ; W32: ; %bb.0: ; %bb
356 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,0,0]
357 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,0,0]
358 ; W32-NEXT: s_clause 0x1
359 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
360 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
361 ; W32-NEXT: s_clause 0x1
362 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
363 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
366 %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)
367 %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)
368 store <8 x i32> %res, ptr addrspace(1) %out, align 32
369 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
373 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) {
374 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed:
375 ; W32: ; %bb.0: ; %bb
376 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] neg_lo:[1,1,0]
377 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] neg_lo:[1,1,0]
378 ; W32-NEXT: s_clause 0x1
379 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
380 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
381 ; W32-NEXT: s_clause 0x1
382 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
383 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
386 %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)
387 %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)
388 store <8 x i32> %res, ptr addrspace(1) %out, align 32
389 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
394 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) {
395 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_unsigned_clamp:
396 ; W32: ; %bb.0: ; %bb
397 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[16:23], v[0:1], v[2:3], v[4:11] clamp
398 ; W32-NEXT: v_wmma_i32_16x16x16_iu4 v[4:11], v[2:3], v[2:3], v[4:11] clamp
399 ; W32-NEXT: s_clause 0x1
400 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
401 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
402 ; W32-NEXT: s_clause 0x1
403 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
404 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
407 %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)
408 %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)
409 store <8 x i32> %res, ptr addrspace(1) %out, align 32
410 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
414 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) {
415 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_unsigned_signed_clamp:
416 ; W32: ; %bb.0: ; %bb
417 ; 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
418 ; 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
419 ; W32-NEXT: s_clause 0x1
420 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
421 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
422 ; W32-NEXT: s_clause 0x1
423 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
424 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
427 %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)
428 %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)
429 store <8 x i32> %res, ptr addrspace(1) %out, align 32
430 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
434 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) {
435 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_unsigned_clamp:
436 ; W32: ; %bb.0: ; %bb
437 ; 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
438 ; 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
439 ; W32-NEXT: s_clause 0x1
440 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
441 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
442 ; W32-NEXT: s_clause 0x1
443 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
444 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
447 %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)
448 %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)
449 store <8 x i32> %res, ptr addrspace(1) %out, align 32
450 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32
454 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) {
455 ; W32-LABEL: test_wmma_i32_16x16x16_ui4_signed_signed_clamp:
456 ; W32: ; %bb.0: ; %bb
457 ; 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
458 ; 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
459 ; W32-NEXT: s_clause 0x1
460 ; W32-NEXT: global_store_b128 v[12:13], v[20:23], off offset:16
461 ; W32-NEXT: global_store_b128 v[12:13], v[16:19], off
462 ; W32-NEXT: s_clause 0x1
463 ; W32-NEXT: global_store_b128 v[14:15], v[8:11], off offset:16
464 ; W32-NEXT: global_store_b128 v[14:15], v[4:7], off
467 %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)
468 %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)
469 store <8 x i32> %res, ptr addrspace(1) %out, align 32
470 store <8 x i32> %res2, ptr addrspace(1) %out2, align 32