1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx700 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX7 %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX8 %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9 %s
5 ; RUN: llc -mtriple=amdgcn -mcpu=gfx906 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9-DL %s
6 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1011 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10-DL-XNACK %s
7 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1012 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10-DL-XNACK %s
8 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10-DL-NOXNACK %s
9 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1031 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10-DL-NOXNACK %s
11 define amdgpu_kernel void @idot8_acc32(ptr addrspace(1) %src1,
12 ; GFX7-LABEL: idot8_acc32:
13 ; GFX7: ; %bb.0: ; %entry
14 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
15 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
16 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
17 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
18 ; GFX7-NEXT: s_mov_b32 s14, -1
19 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
20 ; GFX7-NEXT: s_add_u32 s12, s12, s3
21 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
22 ; GFX7-NEXT: s_mov_b32 s10, 0
23 ; GFX7-NEXT: s_mov_b32 s11, s3
24 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
25 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
26 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
27 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
28 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
29 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
30 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
31 ; GFX7-NEXT: s_load_dword s4, s[0:1], 0x0
32 ; GFX7-NEXT: s_mov_b32 s2, -1
33 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
34 ; GFX7-NEXT: s_waitcnt vmcnt(1)
35 ; GFX7-NEXT: v_bfe_i32 v1, v2, 0, 4
36 ; GFX7-NEXT: v_bfe_i32 v3, v2, 4, 4
37 ; GFX7-NEXT: s_waitcnt vmcnt(0)
38 ; GFX7-NEXT: v_bfe_i32 v9, v0, 0, 4
39 ; GFX7-NEXT: v_bfe_i32 v10, v0, 4, 4
40 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
41 ; GFX7-NEXT: v_mad_i32_i24 v1, v1, v9, s4
42 ; GFX7-NEXT: v_bfe_i32 v4, v2, 8, 4
43 ; GFX7-NEXT: v_bfe_i32 v11, v0, 8, 4
44 ; GFX7-NEXT: v_mad_i32_i24 v1, v3, v10, v1
45 ; GFX7-NEXT: v_bfe_i32 v5, v2, 12, 4
46 ; GFX7-NEXT: v_bfe_i32 v12, v0, 12, 4
47 ; GFX7-NEXT: v_mad_i32_i24 v1, v4, v11, v1
48 ; GFX7-NEXT: v_bfe_i32 v6, v2, 16, 4
49 ; GFX7-NEXT: v_bfe_i32 v13, v0, 16, 4
50 ; GFX7-NEXT: v_mad_i32_i24 v1, v5, v12, v1
51 ; GFX7-NEXT: v_bfe_i32 v7, v2, 20, 4
52 ; GFX7-NEXT: v_bfe_i32 v14, v0, 20, 4
53 ; GFX7-NEXT: v_mad_i32_i24 v1, v6, v13, v1
54 ; GFX7-NEXT: v_bfe_i32 v8, v2, 24, 4
55 ; GFX7-NEXT: v_bfe_i32 v15, v0, 24, 4
56 ; GFX7-NEXT: v_mad_i32_i24 v1, v7, v14, v1
57 ; GFX7-NEXT: v_ashrrev_i32_e32 v2, 28, v2
58 ; GFX7-NEXT: v_ashrrev_i32_e32 v0, 28, v0
59 ; GFX7-NEXT: v_mad_i32_i24 v1, v8, v15, v1
60 ; GFX7-NEXT: v_mad_i32_i24 v0, v2, v0, v1
61 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
64 ; GFX8-LABEL: idot8_acc32:
65 ; GFX8: ; %bb.0: ; %entry
66 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
67 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
68 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
69 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
70 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
71 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
72 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
73 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
74 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
75 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
76 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
77 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
78 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
79 ; GFX8-NEXT: flat_load_dword v0, v[0:1]
80 ; GFX8-NEXT: s_load_dword s2, s[0:1], 0x0
81 ; GFX8-NEXT: s_mov_b32 s10, -1
82 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
83 ; GFX8-NEXT: s_add_u32 s8, s8, s3
84 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
85 ; GFX8-NEXT: s_waitcnt vmcnt(1)
86 ; GFX8-NEXT: v_bfe_i32 v1, v3, 0, 4
87 ; GFX8-NEXT: v_bfe_i32 v4, v3, 4, 4
88 ; GFX8-NEXT: v_bfe_i32 v6, v3, 8, 4
89 ; GFX8-NEXT: v_bfe_i32 v8, v3, 12, 4
90 ; GFX8-NEXT: v_bfe_i32 v10, v3, 16, 4
91 ; GFX8-NEXT: v_bfe_i32 v12, v3, 20, 4
92 ; GFX8-NEXT: s_waitcnt vmcnt(0)
93 ; GFX8-NEXT: v_bfe_i32 v2, v0, 0, 4
94 ; GFX8-NEXT: v_bfe_i32 v5, v0, 4, 4
95 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
96 ; GFX8-NEXT: v_mad_i32_i24 v1, v1, v2, s2
97 ; GFX8-NEXT: v_bfe_i32 v7, v0, 8, 4
98 ; GFX8-NEXT: v_mad_i32_i24 v1, v4, v5, v1
99 ; GFX8-NEXT: v_bfe_i32 v9, v0, 12, 4
100 ; GFX8-NEXT: v_mad_i32_i24 v1, v6, v7, v1
101 ; GFX8-NEXT: v_bfe_i32 v11, v0, 16, 4
102 ; GFX8-NEXT: v_mad_i32_i24 v1, v8, v9, v1
103 ; GFX8-NEXT: v_bfe_i32 v13, v0, 20, 4
104 ; GFX8-NEXT: v_mad_i32_i24 v1, v10, v11, v1
105 ; GFX8-NEXT: v_bfe_i32 v14, v3, 24, 4
106 ; GFX8-NEXT: v_bfe_i32 v15, v0, 24, 4
107 ; GFX8-NEXT: v_mad_i32_i24 v1, v12, v13, v1
108 ; GFX8-NEXT: v_ashrrev_i32_e32 v3, 28, v3
109 ; GFX8-NEXT: v_ashrrev_i32_e32 v0, 28, v0
110 ; GFX8-NEXT: v_mad_i32_i24 v1, v14, v15, v1
111 ; GFX8-NEXT: v_mad_i32_i24 v2, v3, v0, v1
112 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
113 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
114 ; GFX8-NEXT: flat_store_dword v[0:1], v2
115 ; GFX8-NEXT: s_endpgm
117 ; GFX9-LABEL: idot8_acc32:
118 ; GFX9: ; %bb.0: ; %entry
119 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
120 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
121 ; GFX9-NEXT: s_mov_b32 s10, -1
122 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
123 ; GFX9-NEXT: s_add_u32 s8, s8, s3
124 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
125 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
126 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
127 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
128 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
129 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
130 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
131 ; GFX9-NEXT: s_load_dword s0, s[2:3], 0x0
132 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
133 ; GFX9-NEXT: s_waitcnt vmcnt(1)
134 ; GFX9-NEXT: v_bfe_i32 v3, v1, 0, 4
135 ; GFX9-NEXT: s_waitcnt vmcnt(0)
136 ; GFX9-NEXT: v_bfe_i32 v4, v2, 0, 4
137 ; GFX9-NEXT: v_bfe_i32 v5, v1, 4, 4
138 ; GFX9-NEXT: v_bfe_i32 v6, v2, 4, 4
139 ; GFX9-NEXT: v_bfe_i32 v7, v1, 8, 4
140 ; GFX9-NEXT: v_bfe_i32 v8, v2, 8, 4
141 ; GFX9-NEXT: v_bfe_i32 v9, v1, 12, 4
142 ; GFX9-NEXT: v_bfe_i32 v10, v2, 12, 4
143 ; GFX9-NEXT: v_bfe_i32 v11, v1, 16, 4
144 ; GFX9-NEXT: v_bfe_i32 v12, v2, 16, 4
145 ; GFX9-NEXT: v_bfe_i32 v13, v1, 20, 4
146 ; GFX9-NEXT: v_bfe_i32 v14, v2, 20, 4
147 ; GFX9-NEXT: v_bfe_i32 v15, v1, 24, 4
148 ; GFX9-NEXT: v_bfe_i32 v16, v2, 24, 4
149 ; GFX9-NEXT: v_ashrrev_i32_e32 v1, 28, v1
150 ; GFX9-NEXT: v_ashrrev_i32_e32 v2, 28, v2
151 ; GFX9-NEXT: v_mul_i32_i24_e32 v3, v3, v4
152 ; GFX9-NEXT: v_mul_i32_i24_e32 v4, v5, v6
153 ; GFX9-NEXT: v_mul_i32_i24_e32 v5, v7, v8
154 ; GFX9-NEXT: v_mul_i32_i24_e32 v6, v9, v10
155 ; GFX9-NEXT: v_mul_i32_i24_e32 v1, v1, v2
156 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
157 ; GFX9-NEXT: v_add3_u32 v2, v3, s0, v4
158 ; GFX9-NEXT: v_mul_i32_i24_e32 v7, v11, v12
159 ; GFX9-NEXT: v_mul_i32_i24_e32 v8, v13, v14
160 ; GFX9-NEXT: v_add3_u32 v2, v2, v5, v6
161 ; GFX9-NEXT: v_mul_i32_i24_e32 v9, v15, v16
162 ; GFX9-NEXT: v_add3_u32 v2, v2, v7, v8
163 ; GFX9-NEXT: v_add3_u32 v1, v2, v9, v1
164 ; GFX9-NEXT: global_store_dword v0, v1, s[2:3]
165 ; GFX9-NEXT: s_endpgm
167 ; GFX9-DL-LABEL: idot8_acc32:
168 ; GFX9-DL: ; %bb.0: ; %entry
169 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
170 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
171 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
172 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
173 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
174 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
175 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
176 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
177 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
178 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
179 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
180 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
181 ; GFX9-DL-NEXT: s_load_dword s0, s[2:3], 0x0
182 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
183 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
184 ; GFX9-DL-NEXT: v_dot8_i32_i4 v1, v1, v2, s0
185 ; GFX9-DL-NEXT: global_store_dword v0, v1, s[2:3]
186 ; GFX9-DL-NEXT: s_endpgm
188 ; GFX10-DL-XNACK-LABEL: idot8_acc32:
189 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
190 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
191 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
192 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
193 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
194 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
195 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
196 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
197 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
198 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
199 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
200 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
201 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
202 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
203 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v0, 0
204 ; GFX10-DL-XNACK-NEXT: s_load_dword s2, s[0:1], 0x0
205 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
206 ; GFX10-DL-XNACK-NEXT: v_dot8_i32_i4 v1, v1, v2, s2
207 ; GFX10-DL-XNACK-NEXT: global_store_dword v0, v1, s[0:1]
208 ; GFX10-DL-XNACK-NEXT: s_endpgm
210 ; GFX10-DL-NOXNACK-LABEL: idot8_acc32:
211 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
212 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
213 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
214 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
215 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
216 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
217 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
218 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
219 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
220 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
221 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
222 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
223 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
224 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
225 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
226 ; GFX10-DL-NOXNACK-NEXT: s_load_dword s2, s[0:1], 0x0
227 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
228 ; GFX10-DL-NOXNACK-NEXT: v_dot8_i32_i4 v0, v1, v0, s2
229 ; GFX10-DL-NOXNACK-NEXT: global_store_dword v2, v0, s[0:1]
230 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
231 ptr addrspace(1) %src2,
232 ptr addrspace(1) nocapture %dst) {
234 %idx = call i32 @llvm.amdgcn.workitem.id.x()
235 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
236 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
237 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
238 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
240 %v1e0 = extractelement <8 x i4> %vec1, i64 0
241 %cv1e0 = sext i4 %v1e0 to i32
242 %v2e0 = extractelement <8 x i4> %vec2, i64 0
243 %cv2e0 = sext i4 %v2e0 to i32
244 %mul0 = mul nuw nsw i32 %cv1e0, %cv2e0
246 %v1e1 = extractelement <8 x i4> %vec1, i64 1
247 %cv1e1 = sext i4 %v1e1 to i32
248 %v2e1 = extractelement <8 x i4> %vec2, i64 1
249 %cv2e1 = sext i4 %v2e1 to i32
250 %mul1 = mul nuw nsw i32 %cv1e1, %cv2e1
252 %v1e2 = extractelement <8 x i4> %vec1, i64 2
253 %cv1e2 = sext i4 %v1e2 to i32
254 %v2e2 = extractelement <8 x i4> %vec2, i64 2
255 %cv2e2 = sext i4 %v2e2 to i32
256 %mul2 = mul nuw nsw i32 %cv1e2, %cv2e2
258 %v1e3 = extractelement <8 x i4> %vec1, i64 3
259 %cv1e3 = sext i4 %v1e3 to i32
260 %v2e3 = extractelement <8 x i4> %vec2, i64 3
261 %cv2e3 = sext i4 %v2e3 to i32
262 %mul3 = mul nuw nsw i32 %cv1e3, %cv2e3
264 %v1e4 = extractelement <8 x i4> %vec1, i64 4
265 %cv1e4 = sext i4 %v1e4 to i32
266 %v2e4 = extractelement <8 x i4> %vec2, i64 4
267 %cv2e4 = sext i4 %v2e4 to i32
268 %mul4 = mul nuw nsw i32 %cv1e4, %cv2e4
270 %v1e5 = extractelement <8 x i4> %vec1, i64 5
271 %cv1e5 = sext i4 %v1e5 to i32
272 %v2e5 = extractelement <8 x i4> %vec2, i64 5
273 %cv2e5 = sext i4 %v2e5 to i32
274 %mul5 = mul nuw nsw i32 %cv1e5, %cv2e5
276 %v1e6 = extractelement <8 x i4> %vec1, i64 6
277 %cv1e6 = sext i4 %v1e6 to i32
278 %v2e6 = extractelement <8 x i4> %vec2, i64 6
279 %cv2e6 = sext i4 %v2e6 to i32
280 %mul6 = mul nuw nsw i32 %cv1e6, %cv2e6
282 %v1e7 = extractelement <8 x i4> %vec1, i64 7
283 %cv1e7 = sext i4 %v1e7 to i32
284 %v2e7 = extractelement <8 x i4> %vec2, i64 7
285 %cv2e7 = sext i4 %v2e7 to i32
286 %mul7 = mul nuw nsw i32 %cv1e7, %cv2e7
288 %acc = load i32, ptr addrspace(1) %dst, align 4
289 %add1 = add i32 %mul0, %acc
290 %add2 = add i32 %add1, %mul1
291 %add3 = add i32 %add2, %mul2
292 %add4 = add i32 %add3, %mul3
293 %add5 = add i32 %add4, %mul4
294 %add6 = add i32 %add5, %mul5
295 %add7 = add i32 %add6, %mul6
296 %add8 = add i32 %add7, %mul7
298 store i32 %add8, ptr addrspace(1) %dst, align 4
302 ; TODO: Once the unnecessary zero extentions of the elements are removed;
303 ; pattern recognizer will kick in.
304 define amdgpu_kernel void @idot8_acc16(ptr addrspace(1) %src1,
305 ; GFX7-LABEL: idot8_acc16:
306 ; GFX7: ; %bb.0: ; %entry
307 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
308 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
309 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
310 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
311 ; GFX7-NEXT: s_mov_b32 s14, -1
312 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
313 ; GFX7-NEXT: s_add_u32 s12, s12, s3
314 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
315 ; GFX7-NEXT: s_mov_b32 s10, 0
316 ; GFX7-NEXT: s_mov_b32 s11, s3
317 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
318 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
319 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
320 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
321 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
322 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
323 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
324 ; GFX7-NEXT: s_mov_b32 s2, -1
325 ; GFX7-NEXT: buffer_load_ushort v1, off, s[0:3], 0
326 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
327 ; GFX7-NEXT: s_waitcnt vmcnt(2)
328 ; GFX7-NEXT: v_bfe_i32 v3, v2, 0, 4
329 ; GFX7-NEXT: v_bfe_i32 v4, v2, 4, 4
330 ; GFX7-NEXT: s_waitcnt vmcnt(1)
331 ; GFX7-NEXT: v_bfe_i32 v10, v0, 0, 4
332 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff, v3
333 ; GFX7-NEXT: v_bfe_i32 v11, v0, 4, 4
334 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff, v10
335 ; GFX7-NEXT: v_bfe_i32 v5, v2, 8, 4
336 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff, v4
337 ; GFX7-NEXT: v_bfe_i32 v12, v0, 8, 4
338 ; GFX7-NEXT: v_and_b32_e32 v11, 0xffff, v11
339 ; GFX7-NEXT: s_waitcnt vmcnt(0)
340 ; GFX7-NEXT: v_mad_u32_u24 v1, v3, v10, v1
341 ; GFX7-NEXT: v_bfe_i32 v6, v2, 12, 4
342 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff, v5
343 ; GFX7-NEXT: v_bfe_i32 v13, v0, 12, 4
344 ; GFX7-NEXT: v_and_b32_e32 v12, 0xffff, v12
345 ; GFX7-NEXT: v_mad_u32_u24 v1, v4, v11, v1
346 ; GFX7-NEXT: v_bfe_i32 v7, v2, 16, 4
347 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff, v6
348 ; GFX7-NEXT: v_bfe_i32 v14, v0, 16, 4
349 ; GFX7-NEXT: v_and_b32_e32 v13, 0xffff, v13
350 ; GFX7-NEXT: v_mad_u32_u24 v1, v5, v12, v1
351 ; GFX7-NEXT: v_bfe_i32 v8, v2, 20, 4
352 ; GFX7-NEXT: v_and_b32_e32 v7, 0xffff, v7
353 ; GFX7-NEXT: v_bfe_i32 v15, v0, 20, 4
354 ; GFX7-NEXT: v_and_b32_e32 v14, 0xffff, v14
355 ; GFX7-NEXT: v_mad_u32_u24 v1, v6, v13, v1
356 ; GFX7-NEXT: v_bfe_i32 v9, v2, 24, 4
357 ; GFX7-NEXT: v_and_b32_e32 v8, 0xffff, v8
358 ; GFX7-NEXT: v_bfe_i32 v16, v0, 24, 4
359 ; GFX7-NEXT: v_and_b32_e32 v15, 0xffff, v15
360 ; GFX7-NEXT: v_mad_u32_u24 v1, v7, v14, v1
361 ; GFX7-NEXT: v_ashrrev_i32_e32 v2, 28, v2
362 ; GFX7-NEXT: v_and_b32_e32 v9, 0xffff, v9
363 ; GFX7-NEXT: v_ashrrev_i32_e32 v0, 28, v0
364 ; GFX7-NEXT: v_and_b32_e32 v16, 0xffff, v16
365 ; GFX7-NEXT: v_mad_u32_u24 v1, v8, v15, v1
366 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff, v2
367 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff, v0
368 ; GFX7-NEXT: v_mad_u32_u24 v1, v9, v16, v1
369 ; GFX7-NEXT: v_mad_u32_u24 v0, v2, v0, v1
370 ; GFX7-NEXT: buffer_store_short v0, off, s[0:3], 0
371 ; GFX7-NEXT: s_endpgm
373 ; GFX8-LABEL: idot8_acc16:
374 ; GFX8: ; %bb.0: ; %entry
375 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
376 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
377 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
378 ; GFX8-NEXT: v_mov_b32_e32 v5, 12
379 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
380 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
381 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
382 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
383 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
384 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
385 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
386 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
387 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
388 ; GFX8-NEXT: flat_load_dword v2, v[0:1]
389 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
390 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
391 ; GFX8-NEXT: flat_load_ushort v4, v[0:1]
392 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
393 ; GFX8-NEXT: s_mov_b32 s10, -1
394 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
395 ; GFX8-NEXT: s_add_u32 s8, s8, s3
396 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
397 ; GFX8-NEXT: s_waitcnt vmcnt(2)
398 ; GFX8-NEXT: v_lshrrev_b32_e32 v10, 4, v3
399 ; GFX8-NEXT: v_lshlrev_b16_e32 v16, 12, v3
400 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, 28, v3
401 ; GFX8-NEXT: v_lshrrev_b32_e32 v7, 20, v3
402 ; GFX8-NEXT: v_lshrrev_b32_e32 v8, 12, v3
403 ; GFX8-NEXT: v_lshrrev_b32_e32 v9, 8, v3
404 ; GFX8-NEXT: s_waitcnt vmcnt(1)
405 ; GFX8-NEXT: v_lshrrev_b32_e32 v15, 4, v2
406 ; GFX8-NEXT: v_lshlrev_b16_e32 v17, 12, v2
407 ; GFX8-NEXT: v_lshrrev_b32_e32 v11, 28, v2
408 ; GFX8-NEXT: v_lshrrev_b32_e32 v12, 20, v2
409 ; GFX8-NEXT: v_lshrrev_b32_e32 v13, 12, v2
410 ; GFX8-NEXT: v_lshrrev_b32_e32 v14, 8, v2
411 ; GFX8-NEXT: v_lshlrev_b16_sdwa v18, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
412 ; GFX8-NEXT: v_lshlrev_b16_sdwa v19, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
413 ; GFX8-NEXT: v_lshlrev_b16_sdwa v3, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
414 ; GFX8-NEXT: v_lshlrev_b16_sdwa v2, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
415 ; GFX8-NEXT: v_ashrrev_i16_e32 v5, 12, v16
416 ; GFX8-NEXT: v_ashrrev_i16_e32 v16, 12, v17
417 ; GFX8-NEXT: v_lshlrev_b16_e32 v10, 12, v10
418 ; GFX8-NEXT: v_lshlrev_b16_e32 v15, 12, v15
419 ; GFX8-NEXT: v_lshlrev_b16_e32 v9, 12, v9
420 ; GFX8-NEXT: v_lshlrev_b16_e32 v14, 12, v14
421 ; GFX8-NEXT: v_ashrrev_i16_e32 v10, 12, v10
422 ; GFX8-NEXT: v_ashrrev_i16_e32 v15, 12, v15
423 ; GFX8-NEXT: s_waitcnt vmcnt(0)
424 ; GFX8-NEXT: v_mad_u16 v4, v5, v16, v4
425 ; GFX8-NEXT: v_lshlrev_b16_e32 v8, 12, v8
426 ; GFX8-NEXT: v_lshlrev_b16_e32 v13, 12, v13
427 ; GFX8-NEXT: v_ashrrev_i16_e32 v9, 12, v9
428 ; GFX8-NEXT: v_ashrrev_i16_e32 v14, 12, v14
429 ; GFX8-NEXT: v_mad_u16 v4, v10, v15, v4
430 ; GFX8-NEXT: v_ashrrev_i16_e32 v8, 12, v8
431 ; GFX8-NEXT: v_ashrrev_i16_e32 v13, 12, v13
432 ; GFX8-NEXT: v_mad_u16 v4, v9, v14, v4
433 ; GFX8-NEXT: v_ashrrev_i16_e32 v17, 12, v18
434 ; GFX8-NEXT: v_ashrrev_i16_e32 v18, 12, v19
435 ; GFX8-NEXT: v_lshlrev_b16_e32 v7, 12, v7
436 ; GFX8-NEXT: v_lshlrev_b16_e32 v12, 12, v12
437 ; GFX8-NEXT: v_mad_u16 v4, v8, v13, v4
438 ; GFX8-NEXT: v_ashrrev_i16_e32 v7, 12, v7
439 ; GFX8-NEXT: v_ashrrev_i16_e32 v12, 12, v12
440 ; GFX8-NEXT: v_mad_u16 v4, v17, v18, v4
441 ; GFX8-NEXT: v_ashrrev_i16_e32 v3, 12, v3
442 ; GFX8-NEXT: v_ashrrev_i16_e32 v2, 12, v2
443 ; GFX8-NEXT: v_lshlrev_b16_e32 v6, 12, v6
444 ; GFX8-NEXT: v_lshlrev_b16_e32 v11, 12, v11
445 ; GFX8-NEXT: v_mad_u16 v4, v7, v12, v4
446 ; GFX8-NEXT: v_ashrrev_i16_e32 v6, 12, v6
447 ; GFX8-NEXT: v_ashrrev_i16_e32 v11, 12, v11
448 ; GFX8-NEXT: v_mad_u16 v2, v3, v2, v4
449 ; GFX8-NEXT: v_mad_u16 v2, v6, v11, v2
450 ; GFX8-NEXT: flat_store_short v[0:1], v2
451 ; GFX8-NEXT: s_endpgm
453 ; GFX9-LABEL: idot8_acc16:
454 ; GFX9: ; %bb.0: ; %entry
455 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
456 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
457 ; GFX9-NEXT: s_mov_b32 s10, -1
458 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
459 ; GFX9-NEXT: s_add_u32 s8, s8, s3
460 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
461 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
462 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
463 ; GFX9-NEXT: v_mov_b32_e32 v4, 12
464 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
465 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
466 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
467 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
468 ; GFX9-NEXT: global_load_ushort v3, v0, s[2:3]
469 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
470 ; GFX9-NEXT: s_waitcnt vmcnt(2)
471 ; GFX9-NEXT: v_lshrrev_b32_e32 v9, 4, v1
472 ; GFX9-NEXT: s_waitcnt vmcnt(1)
473 ; GFX9-NEXT: v_lshrrev_b32_e32 v14, 4, v2
474 ; GFX9-NEXT: v_lshlrev_b16_e32 v15, 12, v1
475 ; GFX9-NEXT: v_lshlrev_b16_e32 v16, 12, v2
476 ; GFX9-NEXT: v_lshrrev_b32_e32 v5, 28, v1
477 ; GFX9-NEXT: v_lshrrev_b32_e32 v6, 20, v1
478 ; GFX9-NEXT: v_lshrrev_b32_e32 v7, 12, v1
479 ; GFX9-NEXT: v_lshrrev_b32_e32 v8, 8, v1
480 ; GFX9-NEXT: v_lshrrev_b32_e32 v10, 28, v2
481 ; GFX9-NEXT: v_lshrrev_b32_e32 v11, 20, v2
482 ; GFX9-NEXT: v_lshrrev_b32_e32 v12, 12, v2
483 ; GFX9-NEXT: v_lshrrev_b32_e32 v13, 8, v2
484 ; GFX9-NEXT: v_lshlrev_b16_sdwa v17, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
485 ; GFX9-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
486 ; GFX9-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
487 ; GFX9-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
488 ; GFX9-NEXT: v_ashrrev_i16_e32 v4, 12, v15
489 ; GFX9-NEXT: v_ashrrev_i16_e32 v15, 12, v16
490 ; GFX9-NEXT: v_lshlrev_b16_e32 v9, 12, v9
491 ; GFX9-NEXT: v_lshlrev_b16_e32 v14, 12, v14
492 ; GFX9-NEXT: v_lshlrev_b16_e32 v8, 12, v8
493 ; GFX9-NEXT: v_lshlrev_b16_e32 v13, 12, v13
494 ; GFX9-NEXT: v_ashrrev_i16_e32 v9, 12, v9
495 ; GFX9-NEXT: v_ashrrev_i16_e32 v14, 12, v14
496 ; GFX9-NEXT: s_waitcnt vmcnt(0)
497 ; GFX9-NEXT: v_mad_legacy_u16 v3, v4, v15, v3
498 ; GFX9-NEXT: v_lshlrev_b16_e32 v7, 12, v7
499 ; GFX9-NEXT: v_lshlrev_b16_e32 v12, 12, v12
500 ; GFX9-NEXT: v_ashrrev_i16_e32 v8, 12, v8
501 ; GFX9-NEXT: v_ashrrev_i16_e32 v13, 12, v13
502 ; GFX9-NEXT: v_mad_legacy_u16 v3, v9, v14, v3
503 ; GFX9-NEXT: v_ashrrev_i16_e32 v7, 12, v7
504 ; GFX9-NEXT: v_ashrrev_i16_e32 v12, 12, v12
505 ; GFX9-NEXT: v_mad_legacy_u16 v3, v8, v13, v3
506 ; GFX9-NEXT: v_ashrrev_i16_e32 v16, 12, v17
507 ; GFX9-NEXT: v_ashrrev_i16_e32 v17, 12, v18
508 ; GFX9-NEXT: v_lshlrev_b16_e32 v6, 12, v6
509 ; GFX9-NEXT: v_lshlrev_b16_e32 v11, 12, v11
510 ; GFX9-NEXT: v_mad_legacy_u16 v3, v7, v12, v3
511 ; GFX9-NEXT: v_ashrrev_i16_e32 v6, 12, v6
512 ; GFX9-NEXT: v_ashrrev_i16_e32 v11, 12, v11
513 ; GFX9-NEXT: v_mad_legacy_u16 v3, v16, v17, v3
514 ; GFX9-NEXT: v_ashrrev_i16_e32 v1, 12, v1
515 ; GFX9-NEXT: v_ashrrev_i16_e32 v2, 12, v2
516 ; GFX9-NEXT: v_lshlrev_b16_e32 v5, 12, v5
517 ; GFX9-NEXT: v_lshlrev_b16_e32 v10, 12, v10
518 ; GFX9-NEXT: v_mad_legacy_u16 v3, v6, v11, v3
519 ; GFX9-NEXT: v_ashrrev_i16_e32 v5, 12, v5
520 ; GFX9-NEXT: v_ashrrev_i16_e32 v10, 12, v10
521 ; GFX9-NEXT: v_mad_legacy_u16 v1, v1, v2, v3
522 ; GFX9-NEXT: v_mad_legacy_u16 v1, v5, v10, v1
523 ; GFX9-NEXT: global_store_short v0, v1, s[2:3]
524 ; GFX9-NEXT: s_endpgm
526 ; GFX9-DL-LABEL: idot8_acc16:
527 ; GFX9-DL: ; %bb.0: ; %entry
528 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
529 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
530 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
531 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
532 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
533 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
534 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
535 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
536 ; GFX9-DL-NEXT: v_mov_b32_e32 v4, 12
537 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
538 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
539 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
540 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
541 ; GFX9-DL-NEXT: global_load_ushort v3, v0, s[2:3]
542 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
543 ; GFX9-DL-NEXT: s_waitcnt vmcnt(2)
544 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v9, 4, v1
545 ; GFX9-DL-NEXT: s_waitcnt vmcnt(1)
546 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v14, 4, v2
547 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v15, 12, v1
548 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v16, 12, v2
549 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v5, 28, v1
550 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v6, 20, v1
551 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v7, 12, v1
552 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v8, 8, v1
553 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v10, 28, v2
554 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v11, 20, v2
555 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v12, 12, v2
556 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v13, 8, v2
557 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v17, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
558 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
559 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
560 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
561 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v4, 12, v15
562 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v15, 12, v16
563 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v9, 12, v9
564 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v14, 12, v14
565 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v8, 12, v8
566 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v13, 12, v13
567 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v9, 12, v9
568 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v14, 12, v14
569 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0)
570 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v4, v15, v3
571 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v7, 12, v7
572 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v12, 12, v12
573 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v8, 12, v8
574 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v13, 12, v13
575 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v9, v14, v3
576 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v7, 12, v7
577 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v12, 12, v12
578 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v8, v13, v3
579 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v16, 12, v17
580 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v17, 12, v18
581 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v6, 12, v6
582 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v11, 12, v11
583 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v7, v12, v3
584 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v6, 12, v6
585 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v11, 12, v11
586 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v16, v17, v3
587 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v1, 12, v1
588 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v2, 12, v2
589 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v5, 12, v5
590 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v10, 12, v10
591 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v6, v11, v3
592 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v5, 12, v5
593 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v10, 12, v10
594 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v1, v2, v3
595 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v5, v10, v1
596 ; GFX9-DL-NEXT: global_store_short v0, v1, s[2:3]
597 ; GFX9-DL-NEXT: s_endpgm
599 ; GFX10-DL-XNACK-LABEL: idot8_acc16:
600 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
601 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
602 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
603 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
604 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
605 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
606 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
607 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
608 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
609 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
610 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
611 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
612 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
613 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
614 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v0, 0
615 ; GFX10-DL-XNACK-NEXT: global_load_ushort v3, v0, s[0:1]
616 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(2)
617 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v4, 28, v1
618 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v5, 24, v1
619 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v6, 20, v1
620 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v1
621 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
622 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
623 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
624 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v1, 12, v1
625 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(1)
626 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v16, 4, v2
627 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v17, 12, v2
628 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v11, 28, v2
629 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v12, 24, v2
630 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v13, 20, v2
631 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v14, 16, v2
632 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v2
633 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v2, 8, v2
634 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v1, 12, v1
635 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v10
636 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v16, 12, v16
637 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v17, 12, v17
638 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v9
639 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v2, 12, v2
640 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v10, 12, v10
641 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v16, 12, v16
642 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0)
643 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v1, v17, v3
644 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v9
645 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v2
646 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v8
647 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v15
648 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v10, v16, v1
649 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v7
650 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v14
651 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v8, 12, v8
652 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v9, 12, v9
653 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v3, v2, v1
654 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v7
655 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v10
656 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v6, 12, v6
657 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v13
658 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v8, v9, v1
659 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v5
660 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v12
661 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v6, 12, v6
662 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v7, 12, v7
663 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v2, v3, v1
664 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v5
665 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v8
666 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v4, 12, v4
667 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v11
668 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v6, v7, v1
669 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v4, 12, v4
670 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v5, 12, v5
671 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v2, v3, v1
672 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v4, v5, v1
673 ; GFX10-DL-XNACK-NEXT: global_store_short v0, v1, s[0:1]
674 ; GFX10-DL-XNACK-NEXT: s_endpgm
676 ; GFX10-DL-NOXNACK-LABEL: idot8_acc16:
677 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
678 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
679 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
680 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
681 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
682 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
683 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
684 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
685 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
686 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
687 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
688 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
689 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
690 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
691 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
692 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
693 ; GFX10-DL-NOXNACK-NEXT: global_load_ushort v3, v2, s[0:1]
694 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(2)
695 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v4, 28, v1
696 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v5, 24, v1
697 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v6, 20, v1
698 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v1
699 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
700 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
701 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
702 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v1, 12, v1
703 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(1)
704 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v16, 4, v0
705 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v17, 12, v0
706 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v11, 28, v0
707 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v12, 24, v0
708 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v13, 20, v0
709 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v14, 16, v0
710 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v0
711 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v0, 8, v0
712 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v1
713 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v10
714 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v16, 12, v16
715 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v17, 12, v17
716 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v9
717 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v0, 12, v0
718 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v10, 12, v10
719 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v16, 12, v16
720 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0)
721 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v1, v1, v17, v3
722 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v9
723 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v0, 12, v0
724 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v8
725 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v15
726 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v1, v10, v16, v1
727 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v7
728 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v14
729 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v8, 12, v8
730 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v9, 12, v9
731 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v3, v0, v1
732 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v7
733 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v10
734 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v6, 12, v6
735 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v13
736 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v8, v9, v0
737 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v5
738 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v12
739 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v6, 12, v6
740 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v7, 12, v7
741 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v1, v3, v0
742 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v5
743 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v8
744 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v4, 12, v4
745 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v11
746 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v6, v7, v0
747 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v4, 12, v4
748 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v5, 12, v5
749 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v1, v3, v0
750 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v4, v5, v0
751 ; GFX10-DL-NOXNACK-NEXT: global_store_short v2, v0, s[0:1]
752 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
753 ptr addrspace(1) %src2,
754 ptr addrspace(1) nocapture %dst) {
756 %idx = call i32 @llvm.amdgcn.workitem.id.x()
757 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
758 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
759 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
760 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
762 %v1e0 = extractelement <8 x i4> %vec1, i64 0
763 %cv1e0 = sext i4 %v1e0 to i16
764 %v2e0 = extractelement <8 x i4> %vec2, i64 0
765 %cv2e0 = sext i4 %v2e0 to i16
766 %mul0 = mul nuw nsw i16 %cv1e0, %cv2e0
768 %v1e1 = extractelement <8 x i4> %vec1, i64 1
769 %cv1e1 = sext i4 %v1e1 to i16
770 %v2e1 = extractelement <8 x i4> %vec2, i64 1
771 %cv2e1 = sext i4 %v2e1 to i16
772 %mul1 = mul nuw nsw i16 %cv1e1, %cv2e1
774 %v1e2 = extractelement <8 x i4> %vec1, i64 2
775 %cv1e2 = sext i4 %v1e2 to i16
776 %v2e2 = extractelement <8 x i4> %vec2, i64 2
777 %cv2e2 = sext i4 %v2e2 to i16
778 %mul2 = mul nuw nsw i16 %cv1e2, %cv2e2
780 %v1e3 = extractelement <8 x i4> %vec1, i64 3
781 %cv1e3 = sext i4 %v1e3 to i16
782 %v2e3 = extractelement <8 x i4> %vec2, i64 3
783 %cv2e3 = sext i4 %v2e3 to i16
784 %mul3 = mul nuw nsw i16 %cv1e3, %cv2e3
786 %v1e4 = extractelement <8 x i4> %vec1, i64 4
787 %cv1e4 = sext i4 %v1e4 to i16
788 %v2e4 = extractelement <8 x i4> %vec2, i64 4
789 %cv2e4 = sext i4 %v2e4 to i16
790 %mul4 = mul nuw nsw i16 %cv1e4, %cv2e4
792 %v1e5 = extractelement <8 x i4> %vec1, i64 5
793 %cv1e5 = sext i4 %v1e5 to i16
794 %v2e5 = extractelement <8 x i4> %vec2, i64 5
795 %cv2e5 = sext i4 %v2e5 to i16
796 %mul5 = mul nuw nsw i16 %cv1e5, %cv2e5
798 %v1e6 = extractelement <8 x i4> %vec1, i64 6
799 %cv1e6 = sext i4 %v1e6 to i16
800 %v2e6 = extractelement <8 x i4> %vec2, i64 6
801 %cv2e6 = sext i4 %v2e6 to i16
802 %mul6 = mul nuw nsw i16 %cv1e6, %cv2e6
804 %v1e7 = extractelement <8 x i4> %vec1, i64 7
805 %cv1e7 = sext i4 %v1e7 to i16
806 %v2e7 = extractelement <8 x i4> %vec2, i64 7
807 %cv2e7 = sext i4 %v2e7 to i16
808 %mul7 = mul nuw nsw i16 %cv1e7, %cv2e7
810 %acc = load i16, ptr addrspace(1) %dst, align 4
811 %add1 = add i16 %mul0, %acc
812 %add2 = add i16 %add1, %mul1
813 %add3 = add i16 %add2, %mul2
814 %add4 = add i16 %add3, %mul3
815 %add5 = add i16 %add4, %mul4
816 %add6 = add i16 %add5, %mul5
817 %add7 = add i16 %add6, %mul6
818 %add8 = add i16 %add7, %mul7
820 store i16 %add8, ptr addrspace(1) %dst, align 4
824 ; TODO: Support this pattern.
825 define amdgpu_kernel void @idot8_acc8(ptr addrspace(1) %src1,
826 ; GFX7-LABEL: idot8_acc8:
827 ; GFX7: ; %bb.0: ; %entry
828 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
829 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
830 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
831 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
832 ; GFX7-NEXT: s_mov_b32 s14, -1
833 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
834 ; GFX7-NEXT: s_add_u32 s12, s12, s3
835 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
836 ; GFX7-NEXT: s_mov_b32 s10, 0
837 ; GFX7-NEXT: s_mov_b32 s11, s3
838 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
839 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
840 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
841 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
842 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
843 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
844 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
845 ; GFX7-NEXT: s_mov_b32 s2, -1
846 ; GFX7-NEXT: buffer_load_ubyte v1, off, s[0:3], 0
847 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
848 ; GFX7-NEXT: s_waitcnt vmcnt(2)
849 ; GFX7-NEXT: v_bfe_i32 v3, v2, 0, 4
850 ; GFX7-NEXT: v_bfe_i32 v4, v2, 4, 4
851 ; GFX7-NEXT: s_waitcnt vmcnt(1)
852 ; GFX7-NEXT: v_bfe_i32 v10, v0, 0, 4
853 ; GFX7-NEXT: v_and_b32_e32 v3, 0xff, v3
854 ; GFX7-NEXT: v_bfe_i32 v11, v0, 4, 4
855 ; GFX7-NEXT: v_and_b32_e32 v10, 0xff, v10
856 ; GFX7-NEXT: v_bfe_i32 v5, v2, 8, 4
857 ; GFX7-NEXT: v_and_b32_e32 v4, 0xff, v4
858 ; GFX7-NEXT: v_bfe_i32 v12, v0, 8, 4
859 ; GFX7-NEXT: v_and_b32_e32 v11, 0xff, v11
860 ; GFX7-NEXT: s_waitcnt vmcnt(0)
861 ; GFX7-NEXT: v_mad_u32_u24 v1, v3, v10, v1
862 ; GFX7-NEXT: v_bfe_i32 v6, v2, 12, 4
863 ; GFX7-NEXT: v_and_b32_e32 v5, 0xff, v5
864 ; GFX7-NEXT: v_bfe_i32 v13, v0, 12, 4
865 ; GFX7-NEXT: v_and_b32_e32 v12, 0xff, v12
866 ; GFX7-NEXT: v_mad_u32_u24 v1, v4, v11, v1
867 ; GFX7-NEXT: v_bfe_i32 v7, v2, 16, 4
868 ; GFX7-NEXT: v_and_b32_e32 v6, 0xff, v6
869 ; GFX7-NEXT: v_bfe_i32 v14, v0, 16, 4
870 ; GFX7-NEXT: v_and_b32_e32 v13, 0xff, v13
871 ; GFX7-NEXT: v_mad_u32_u24 v1, v5, v12, v1
872 ; GFX7-NEXT: v_bfe_i32 v8, v2, 20, 4
873 ; GFX7-NEXT: v_and_b32_e32 v7, 0xff, v7
874 ; GFX7-NEXT: v_bfe_i32 v15, v0, 20, 4
875 ; GFX7-NEXT: v_and_b32_e32 v14, 0xff, v14
876 ; GFX7-NEXT: v_mad_u32_u24 v1, v6, v13, v1
877 ; GFX7-NEXT: v_bfe_i32 v9, v2, 24, 4
878 ; GFX7-NEXT: v_and_b32_e32 v8, 0xff, v8
879 ; GFX7-NEXT: v_bfe_i32 v16, v0, 24, 4
880 ; GFX7-NEXT: v_and_b32_e32 v15, 0xff, v15
881 ; GFX7-NEXT: v_mad_u32_u24 v1, v7, v14, v1
882 ; GFX7-NEXT: v_ashrrev_i32_e32 v2, 28, v2
883 ; GFX7-NEXT: v_and_b32_e32 v9, 0xff, v9
884 ; GFX7-NEXT: v_ashrrev_i32_e32 v0, 28, v0
885 ; GFX7-NEXT: v_and_b32_e32 v16, 0xff, v16
886 ; GFX7-NEXT: v_mad_u32_u24 v1, v8, v15, v1
887 ; GFX7-NEXT: v_and_b32_e32 v2, 0xff, v2
888 ; GFX7-NEXT: v_and_b32_e32 v0, 0xff, v0
889 ; GFX7-NEXT: v_mad_u32_u24 v1, v9, v16, v1
890 ; GFX7-NEXT: v_mad_u32_u24 v0, v2, v0, v1
891 ; GFX7-NEXT: buffer_store_byte v0, off, s[0:3], 0
892 ; GFX7-NEXT: s_endpgm
894 ; GFX8-LABEL: idot8_acc8:
895 ; GFX8: ; %bb.0: ; %entry
896 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
897 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
898 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
899 ; GFX8-NEXT: v_mov_b32_e32 v5, 12
900 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
901 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
902 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
903 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
904 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
905 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
906 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
907 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
908 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
909 ; GFX8-NEXT: flat_load_dword v2, v[0:1]
910 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
911 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
912 ; GFX8-NEXT: flat_load_ubyte v4, v[0:1]
913 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
914 ; GFX8-NEXT: s_mov_b32 s10, -1
915 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
916 ; GFX8-NEXT: s_add_u32 s8, s8, s3
917 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
918 ; GFX8-NEXT: s_waitcnt vmcnt(2)
919 ; GFX8-NEXT: v_lshrrev_b32_e32 v10, 4, v3
920 ; GFX8-NEXT: v_lshlrev_b16_e32 v16, 12, v3
921 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, 28, v3
922 ; GFX8-NEXT: v_lshrrev_b32_e32 v7, 20, v3
923 ; GFX8-NEXT: v_lshrrev_b32_e32 v8, 12, v3
924 ; GFX8-NEXT: v_lshrrev_b32_e32 v9, 8, v3
925 ; GFX8-NEXT: s_waitcnt vmcnt(1)
926 ; GFX8-NEXT: v_lshrrev_b32_e32 v15, 4, v2
927 ; GFX8-NEXT: v_lshlrev_b16_e32 v17, 12, v2
928 ; GFX8-NEXT: v_lshrrev_b32_e32 v11, 28, v2
929 ; GFX8-NEXT: v_lshrrev_b32_e32 v12, 20, v2
930 ; GFX8-NEXT: v_lshrrev_b32_e32 v13, 12, v2
931 ; GFX8-NEXT: v_lshrrev_b32_e32 v14, 8, v2
932 ; GFX8-NEXT: v_lshlrev_b16_sdwa v18, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
933 ; GFX8-NEXT: v_lshlrev_b16_sdwa v19, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
934 ; GFX8-NEXT: v_lshlrev_b16_sdwa v3, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
935 ; GFX8-NEXT: v_lshlrev_b16_sdwa v2, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
936 ; GFX8-NEXT: v_ashrrev_i16_e32 v5, 12, v16
937 ; GFX8-NEXT: v_ashrrev_i16_e32 v16, 12, v17
938 ; GFX8-NEXT: v_lshlrev_b16_e32 v10, 12, v10
939 ; GFX8-NEXT: v_lshlrev_b16_e32 v15, 12, v15
940 ; GFX8-NEXT: v_lshlrev_b16_e32 v9, 12, v9
941 ; GFX8-NEXT: v_lshlrev_b16_e32 v14, 12, v14
942 ; GFX8-NEXT: v_ashrrev_i16_e32 v10, 12, v10
943 ; GFX8-NEXT: v_ashrrev_i16_e32 v15, 12, v15
944 ; GFX8-NEXT: s_waitcnt vmcnt(0)
945 ; GFX8-NEXT: v_mad_u16 v4, v5, v16, v4
946 ; GFX8-NEXT: v_lshlrev_b16_e32 v8, 12, v8
947 ; GFX8-NEXT: v_lshlrev_b16_e32 v13, 12, v13
948 ; GFX8-NEXT: v_ashrrev_i16_e32 v9, 12, v9
949 ; GFX8-NEXT: v_ashrrev_i16_e32 v14, 12, v14
950 ; GFX8-NEXT: v_mad_u16 v4, v10, v15, v4
951 ; GFX8-NEXT: v_ashrrev_i16_e32 v8, 12, v8
952 ; GFX8-NEXT: v_ashrrev_i16_e32 v13, 12, v13
953 ; GFX8-NEXT: v_mad_u16 v4, v9, v14, v4
954 ; GFX8-NEXT: v_ashrrev_i16_e32 v17, 12, v18
955 ; GFX8-NEXT: v_ashrrev_i16_e32 v18, 12, v19
956 ; GFX8-NEXT: v_lshlrev_b16_e32 v7, 12, v7
957 ; GFX8-NEXT: v_lshlrev_b16_e32 v12, 12, v12
958 ; GFX8-NEXT: v_mad_u16 v4, v8, v13, v4
959 ; GFX8-NEXT: v_ashrrev_i16_e32 v7, 12, v7
960 ; GFX8-NEXT: v_ashrrev_i16_e32 v12, 12, v12
961 ; GFX8-NEXT: v_mad_u16 v4, v17, v18, v4
962 ; GFX8-NEXT: v_ashrrev_i16_e32 v3, 12, v3
963 ; GFX8-NEXT: v_ashrrev_i16_e32 v2, 12, v2
964 ; GFX8-NEXT: v_lshlrev_b16_e32 v6, 12, v6
965 ; GFX8-NEXT: v_lshlrev_b16_e32 v11, 12, v11
966 ; GFX8-NEXT: v_mad_u16 v4, v7, v12, v4
967 ; GFX8-NEXT: v_ashrrev_i16_e32 v6, 12, v6
968 ; GFX8-NEXT: v_ashrrev_i16_e32 v11, 12, v11
969 ; GFX8-NEXT: v_mad_u16 v2, v3, v2, v4
970 ; GFX8-NEXT: v_mad_u16 v2, v6, v11, v2
971 ; GFX8-NEXT: flat_store_byte v[0:1], v2
972 ; GFX8-NEXT: s_endpgm
974 ; GFX9-LABEL: idot8_acc8:
975 ; GFX9: ; %bb.0: ; %entry
976 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
977 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
978 ; GFX9-NEXT: s_mov_b32 s10, -1
979 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
980 ; GFX9-NEXT: s_add_u32 s8, s8, s3
981 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
982 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
983 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
984 ; GFX9-NEXT: v_mov_b32_e32 v4, 12
985 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
986 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
987 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
988 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
989 ; GFX9-NEXT: global_load_ubyte v3, v0, s[2:3]
990 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
991 ; GFX9-NEXT: s_waitcnt vmcnt(2)
992 ; GFX9-NEXT: v_lshrrev_b32_e32 v9, 4, v1
993 ; GFX9-NEXT: s_waitcnt vmcnt(1)
994 ; GFX9-NEXT: v_lshrrev_b32_e32 v14, 4, v2
995 ; GFX9-NEXT: v_lshlrev_b16_e32 v15, 12, v1
996 ; GFX9-NEXT: v_lshlrev_b16_e32 v16, 12, v2
997 ; GFX9-NEXT: v_lshrrev_b32_e32 v5, 28, v1
998 ; GFX9-NEXT: v_lshrrev_b32_e32 v6, 20, v1
999 ; GFX9-NEXT: v_lshrrev_b32_e32 v7, 12, v1
1000 ; GFX9-NEXT: v_lshrrev_b32_e32 v8, 8, v1
1001 ; GFX9-NEXT: v_lshrrev_b32_e32 v10, 28, v2
1002 ; GFX9-NEXT: v_lshrrev_b32_e32 v11, 20, v2
1003 ; GFX9-NEXT: v_lshrrev_b32_e32 v12, 12, v2
1004 ; GFX9-NEXT: v_lshrrev_b32_e32 v13, 8, v2
1005 ; GFX9-NEXT: v_lshlrev_b16_sdwa v17, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
1006 ; GFX9-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
1007 ; GFX9-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
1008 ; GFX9-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
1009 ; GFX9-NEXT: v_ashrrev_i16_e32 v4, 12, v15
1010 ; GFX9-NEXT: v_ashrrev_i16_e32 v15, 12, v16
1011 ; GFX9-NEXT: v_lshlrev_b16_e32 v9, 12, v9
1012 ; GFX9-NEXT: v_lshlrev_b16_e32 v14, 12, v14
1013 ; GFX9-NEXT: v_lshlrev_b16_e32 v8, 12, v8
1014 ; GFX9-NEXT: v_lshlrev_b16_e32 v13, 12, v13
1015 ; GFX9-NEXT: v_ashrrev_i16_e32 v9, 12, v9
1016 ; GFX9-NEXT: v_ashrrev_i16_e32 v14, 12, v14
1017 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1018 ; GFX9-NEXT: v_mad_legacy_u16 v3, v4, v15, v3
1019 ; GFX9-NEXT: v_lshlrev_b16_e32 v7, 12, v7
1020 ; GFX9-NEXT: v_lshlrev_b16_e32 v12, 12, v12
1021 ; GFX9-NEXT: v_ashrrev_i16_e32 v8, 12, v8
1022 ; GFX9-NEXT: v_ashrrev_i16_e32 v13, 12, v13
1023 ; GFX9-NEXT: v_mad_legacy_u16 v3, v9, v14, v3
1024 ; GFX9-NEXT: v_ashrrev_i16_e32 v7, 12, v7
1025 ; GFX9-NEXT: v_ashrrev_i16_e32 v12, 12, v12
1026 ; GFX9-NEXT: v_mad_legacy_u16 v3, v8, v13, v3
1027 ; GFX9-NEXT: v_ashrrev_i16_e32 v16, 12, v17
1028 ; GFX9-NEXT: v_ashrrev_i16_e32 v17, 12, v18
1029 ; GFX9-NEXT: v_lshlrev_b16_e32 v6, 12, v6
1030 ; GFX9-NEXT: v_lshlrev_b16_e32 v11, 12, v11
1031 ; GFX9-NEXT: v_mad_legacy_u16 v3, v7, v12, v3
1032 ; GFX9-NEXT: v_ashrrev_i16_e32 v6, 12, v6
1033 ; GFX9-NEXT: v_ashrrev_i16_e32 v11, 12, v11
1034 ; GFX9-NEXT: v_mad_legacy_u16 v3, v16, v17, v3
1035 ; GFX9-NEXT: v_ashrrev_i16_e32 v1, 12, v1
1036 ; GFX9-NEXT: v_ashrrev_i16_e32 v2, 12, v2
1037 ; GFX9-NEXT: v_lshlrev_b16_e32 v5, 12, v5
1038 ; GFX9-NEXT: v_lshlrev_b16_e32 v10, 12, v10
1039 ; GFX9-NEXT: v_mad_legacy_u16 v3, v6, v11, v3
1040 ; GFX9-NEXT: v_ashrrev_i16_e32 v5, 12, v5
1041 ; GFX9-NEXT: v_ashrrev_i16_e32 v10, 12, v10
1042 ; GFX9-NEXT: v_mad_legacy_u16 v1, v1, v2, v3
1043 ; GFX9-NEXT: v_mad_legacy_u16 v1, v5, v10, v1
1044 ; GFX9-NEXT: global_store_byte v0, v1, s[2:3]
1045 ; GFX9-NEXT: s_endpgm
1047 ; GFX9-DL-LABEL: idot8_acc8:
1048 ; GFX9-DL: ; %bb.0: ; %entry
1049 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1050 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1051 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
1052 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
1053 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
1054 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1055 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
1056 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1057 ; GFX9-DL-NEXT: v_mov_b32_e32 v4, 12
1058 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
1059 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
1060 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
1061 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
1062 ; GFX9-DL-NEXT: global_load_ubyte v3, v0, s[2:3]
1063 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
1064 ; GFX9-DL-NEXT: s_waitcnt vmcnt(2)
1065 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v9, 4, v1
1066 ; GFX9-DL-NEXT: s_waitcnt vmcnt(1)
1067 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v14, 4, v2
1068 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v15, 12, v1
1069 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v16, 12, v2
1070 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v5, 28, v1
1071 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v6, 20, v1
1072 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v7, 12, v1
1073 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v8, 8, v1
1074 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v10, 28, v2
1075 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v11, 20, v2
1076 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v12, 12, v2
1077 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v13, 8, v2
1078 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v17, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
1079 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
1080 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
1081 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
1082 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v4, 12, v15
1083 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v15, 12, v16
1084 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v9, 12, v9
1085 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v14, 12, v14
1086 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v8, 12, v8
1087 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v13, 12, v13
1088 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v9, 12, v9
1089 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v14, 12, v14
1090 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0)
1091 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v4, v15, v3
1092 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v7, 12, v7
1093 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v12, 12, v12
1094 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v8, 12, v8
1095 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v13, 12, v13
1096 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v9, v14, v3
1097 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v7, 12, v7
1098 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v12, 12, v12
1099 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v8, v13, v3
1100 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v16, 12, v17
1101 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v17, 12, v18
1102 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v6, 12, v6
1103 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v11, 12, v11
1104 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v7, v12, v3
1105 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v6, 12, v6
1106 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v11, 12, v11
1107 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v16, v17, v3
1108 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v1, 12, v1
1109 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v2, 12, v2
1110 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v5, 12, v5
1111 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v10, 12, v10
1112 ; GFX9-DL-NEXT: v_mad_legacy_u16 v3, v6, v11, v3
1113 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v5, 12, v5
1114 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v10, 12, v10
1115 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v1, v2, v3
1116 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v5, v10, v1
1117 ; GFX9-DL-NEXT: global_store_byte v0, v1, s[2:3]
1118 ; GFX9-DL-NEXT: s_endpgm
1120 ; GFX10-DL-XNACK-LABEL: idot8_acc8:
1121 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
1122 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1123 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1124 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1125 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1126 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1127 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
1128 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
1129 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
1130 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
1131 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
1132 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
1133 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
1134 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
1135 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v0, 0
1136 ; GFX10-DL-XNACK-NEXT: global_load_ubyte v3, v0, s[0:1]
1137 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(2)
1138 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v4, 28, v1
1139 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v5, 24, v1
1140 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v6, 20, v1
1141 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v1
1142 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
1143 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
1144 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
1145 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v1, 12, v1
1146 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(1)
1147 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v16, 4, v2
1148 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v17, 12, v2
1149 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v11, 28, v2
1150 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v12, 24, v2
1151 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v13, 20, v2
1152 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v14, 16, v2
1153 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v2
1154 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v2, 8, v2
1155 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v1, 12, v1
1156 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v10
1157 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v16, 12, v16
1158 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v17, 12, v17
1159 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v9
1160 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v2, 12, v2
1161 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v10, 12, v10
1162 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v16, 12, v16
1163 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0)
1164 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v1, v17, v3
1165 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v9
1166 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v2
1167 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v8
1168 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v15
1169 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v10, v16, v1
1170 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v7
1171 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v14
1172 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v8, 12, v8
1173 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v9, 12, v9
1174 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v3, v2, v1
1175 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v7
1176 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v10
1177 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v6, 12, v6
1178 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v13
1179 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v8, v9, v1
1180 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v5
1181 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v12
1182 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v6, 12, v6
1183 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v7, 12, v7
1184 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v2, v3, v1
1185 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v5
1186 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v3, 12, v8
1187 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v4, 12, v4
1188 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v11
1189 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v6, v7, v1
1190 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v4, 12, v4
1191 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v5, 12, v5
1192 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v2, v3, v1
1193 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v1, v4, v5, v1
1194 ; GFX10-DL-XNACK-NEXT: global_store_byte v0, v1, s[0:1]
1195 ; GFX10-DL-XNACK-NEXT: s_endpgm
1197 ; GFX10-DL-NOXNACK-LABEL: idot8_acc8:
1198 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
1199 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
1200 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1201 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1202 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1203 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
1204 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1205 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1206 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
1207 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
1208 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
1209 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
1210 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
1211 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
1212 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
1213 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
1214 ; GFX10-DL-NOXNACK-NEXT: global_load_ubyte v3, v2, s[0:1]
1215 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(2)
1216 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v4, 28, v1
1217 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v5, 24, v1
1218 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v6, 20, v1
1219 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v1
1220 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
1221 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
1222 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
1223 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v1, 12, v1
1224 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(1)
1225 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v16, 4, v0
1226 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v17, 12, v0
1227 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v11, 28, v0
1228 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v12, 24, v0
1229 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v13, 20, v0
1230 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v14, 16, v0
1231 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v0
1232 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v0, 8, v0
1233 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v1
1234 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v10
1235 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v16, 12, v16
1236 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v17, 12, v17
1237 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v9
1238 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v0, 12, v0
1239 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v10, 12, v10
1240 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v16, 12, v16
1241 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0)
1242 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v1, v1, v17, v3
1243 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v9
1244 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v0, 12, v0
1245 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v8
1246 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v15
1247 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v1, v10, v16, v1
1248 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v7
1249 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v14
1250 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v8, 12, v8
1251 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v9, 12, v9
1252 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v3, v0, v1
1253 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v7
1254 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v10
1255 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v6, 12, v6
1256 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v13
1257 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v8, v9, v0
1258 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v5
1259 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v12
1260 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v6, 12, v6
1261 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v7, 12, v7
1262 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v1, v3, v0
1263 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v5
1264 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v8
1265 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v4, 12, v4
1266 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v11
1267 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v6, v7, v0
1268 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v4, 12, v4
1269 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v5, 12, v5
1270 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v1, v3, v0
1271 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v4, v5, v0
1272 ; GFX10-DL-NOXNACK-NEXT: global_store_byte v2, v0, s[0:1]
1273 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
1274 ptr addrspace(1) %src2,
1275 ptr addrspace(1) nocapture %dst) {
1277 %idx = call i32 @llvm.amdgcn.workitem.id.x()
1278 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
1279 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
1280 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
1281 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
1283 %v1e0 = extractelement <8 x i4> %vec1, i64 0
1284 %cv1e0 = sext i4 %v1e0 to i8
1285 %v2e0 = extractelement <8 x i4> %vec2, i64 0
1286 %cv2e0 = sext i4 %v2e0 to i8
1287 %mul0 = mul nuw nsw i8 %cv1e0, %cv2e0
1289 %v1e1 = extractelement <8 x i4> %vec1, i64 1
1290 %cv1e1 = sext i4 %v1e1 to i8
1291 %v2e1 = extractelement <8 x i4> %vec2, i64 1
1292 %cv2e1 = sext i4 %v2e1 to i8
1293 %mul1 = mul nuw nsw i8 %cv1e1, %cv2e1
1295 %v1e2 = extractelement <8 x i4> %vec1, i64 2
1296 %cv1e2 = sext i4 %v1e2 to i8
1297 %v2e2 = extractelement <8 x i4> %vec2, i64 2
1298 %cv2e2 = sext i4 %v2e2 to i8
1299 %mul2 = mul nuw nsw i8 %cv1e2, %cv2e2
1301 %v1e3 = extractelement <8 x i4> %vec1, i64 3
1302 %cv1e3 = sext i4 %v1e3 to i8
1303 %v2e3 = extractelement <8 x i4> %vec2, i64 3
1304 %cv2e3 = sext i4 %v2e3 to i8
1305 %mul3 = mul nuw nsw i8 %cv1e3, %cv2e3
1307 %v1e4 = extractelement <8 x i4> %vec1, i64 4
1308 %cv1e4 = sext i4 %v1e4 to i8
1309 %v2e4 = extractelement <8 x i4> %vec2, i64 4
1310 %cv2e4 = sext i4 %v2e4 to i8
1311 %mul4 = mul nuw nsw i8 %cv1e4, %cv2e4
1313 %v1e5 = extractelement <8 x i4> %vec1, i64 5
1314 %cv1e5 = sext i4 %v1e5 to i8
1315 %v2e5 = extractelement <8 x i4> %vec2, i64 5
1316 %cv2e5 = sext i4 %v2e5 to i8
1317 %mul5 = mul nuw nsw i8 %cv1e5, %cv2e5
1319 %v1e6 = extractelement <8 x i4> %vec1, i64 6
1320 %cv1e6 = sext i4 %v1e6 to i8
1321 %v2e6 = extractelement <8 x i4> %vec2, i64 6
1322 %cv2e6 = sext i4 %v2e6 to i8
1323 %mul6 = mul nuw nsw i8 %cv1e6, %cv2e6
1325 %v1e7 = extractelement <8 x i4> %vec1, i64 7
1326 %cv1e7 = sext i4 %v1e7 to i8
1327 %v2e7 = extractelement <8 x i4> %vec2, i64 7
1328 %cv2e7 = sext i4 %v2e7 to i8
1329 %mul7 = mul nuw nsw i8 %cv1e7, %cv2e7
1331 %acc = load i8, ptr addrspace(1) %dst, align 4
1332 %add1 = add i8 %mul0, %acc
1333 %add2 = add i8 %add1, %mul1
1334 %add3 = add i8 %add2, %mul2
1335 %add4 = add i8 %add3, %mul3
1336 %add5 = add i8 %add4, %mul4
1337 %add6 = add i8 %add5, %mul5
1338 %add7 = add i8 %add6, %mul6
1339 %add8 = add i8 %add7, %mul7
1341 store i8 %add8, ptr addrspace(1) %dst, align 4
1345 ; Make sure the pattern is not recognized if there are multiple uses of the
1346 ; intermediate multiplications.
1347 define amdgpu_kernel void @idot8_multiuses_mul1(ptr addrspace(1) %src1,
1348 ; GFX7-LABEL: idot8_multiuses_mul1:
1349 ; GFX7: ; %bb.0: ; %entry
1350 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
1351 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
1352 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
1353 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
1354 ; GFX7-NEXT: s_mov_b32 s14, -1
1355 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
1356 ; GFX7-NEXT: s_add_u32 s12, s12, s3
1357 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
1358 ; GFX7-NEXT: s_mov_b32 s10, 0
1359 ; GFX7-NEXT: s_mov_b32 s11, s3
1360 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1361 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
1362 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1363 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
1364 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
1365 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
1366 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
1367 ; GFX7-NEXT: s_load_dword s4, s[0:1], 0x0
1368 ; GFX7-NEXT: s_mov_b32 s2, -1
1369 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
1370 ; GFX7-NEXT: s_waitcnt vmcnt(1)
1371 ; GFX7-NEXT: v_bfe_i32 v1, v2, 0, 4
1372 ; GFX7-NEXT: v_bfe_i32 v3, v2, 4, 4
1373 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1374 ; GFX7-NEXT: v_bfe_i32 v9, v0, 0, 4
1375 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1376 ; GFX7-NEXT: v_mad_i32_i24 v16, v1, v9, s4
1377 ; GFX7-NEXT: v_bfe_i32 v10, v0, 4, 4
1378 ; GFX7-NEXT: v_mad_i32_i24 v1, v1, v9, v16
1379 ; GFX7-NEXT: v_bfe_i32 v4, v2, 8, 4
1380 ; GFX7-NEXT: v_bfe_i32 v11, v0, 8, 4
1381 ; GFX7-NEXT: v_mad_i32_i24 v1, v3, v10, v1
1382 ; GFX7-NEXT: v_bfe_i32 v5, v2, 12, 4
1383 ; GFX7-NEXT: v_bfe_i32 v12, v0, 12, 4
1384 ; GFX7-NEXT: v_mad_i32_i24 v1, v4, v11, v1
1385 ; GFX7-NEXT: v_bfe_i32 v6, v2, 16, 4
1386 ; GFX7-NEXT: v_bfe_i32 v13, v0, 16, 4
1387 ; GFX7-NEXT: v_mad_i32_i24 v1, v5, v12, v1
1388 ; GFX7-NEXT: v_bfe_i32 v7, v2, 20, 4
1389 ; GFX7-NEXT: v_bfe_i32 v14, v0, 20, 4
1390 ; GFX7-NEXT: v_mad_i32_i24 v1, v6, v13, v1
1391 ; GFX7-NEXT: v_bfe_i32 v8, v2, 24, 4
1392 ; GFX7-NEXT: v_bfe_i32 v15, v0, 24, 4
1393 ; GFX7-NEXT: v_mad_i32_i24 v1, v7, v14, v1
1394 ; GFX7-NEXT: v_ashrrev_i32_e32 v2, 28, v2
1395 ; GFX7-NEXT: v_ashrrev_i32_e32 v0, 28, v0
1396 ; GFX7-NEXT: v_mad_i32_i24 v1, v8, v15, v1
1397 ; GFX7-NEXT: v_mad_i32_i24 v0, v2, v0, v1
1398 ; GFX7-NEXT: v_add_i32_e32 v0, vcc, v16, v0
1399 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
1400 ; GFX7-NEXT: s_endpgm
1402 ; GFX8-LABEL: idot8_multiuses_mul1:
1403 ; GFX8: ; %bb.0: ; %entry
1404 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1405 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1406 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
1407 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1408 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1409 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1410 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
1411 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
1412 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
1413 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
1414 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
1415 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
1416 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
1417 ; GFX8-NEXT: flat_load_dword v0, v[0:1]
1418 ; GFX8-NEXT: s_load_dword s2, s[0:1], 0x0
1419 ; GFX8-NEXT: s_mov_b32 s10, -1
1420 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
1421 ; GFX8-NEXT: s_add_u32 s8, s8, s3
1422 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
1423 ; GFX8-NEXT: s_waitcnt vmcnt(1)
1424 ; GFX8-NEXT: v_bfe_i32 v1, v3, 0, 4
1425 ; GFX8-NEXT: v_bfe_i32 v4, v3, 4, 4
1426 ; GFX8-NEXT: v_bfe_i32 v6, v3, 8, 4
1427 ; GFX8-NEXT: v_bfe_i32 v8, v3, 12, 4
1428 ; GFX8-NEXT: v_bfe_i32 v10, v3, 16, 4
1429 ; GFX8-NEXT: v_bfe_i32 v12, v3, 20, 4
1430 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1431 ; GFX8-NEXT: v_bfe_i32 v2, v0, 0, 4
1432 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1433 ; GFX8-NEXT: v_mad_i32_i24 v16, v1, v2, s2
1434 ; GFX8-NEXT: v_bfe_i32 v5, v0, 4, 4
1435 ; GFX8-NEXT: v_mad_i32_i24 v1, v1, v2, v16
1436 ; GFX8-NEXT: v_bfe_i32 v7, v0, 8, 4
1437 ; GFX8-NEXT: v_mad_i32_i24 v1, v4, v5, v1
1438 ; GFX8-NEXT: v_bfe_i32 v9, v0, 12, 4
1439 ; GFX8-NEXT: v_mad_i32_i24 v1, v6, v7, v1
1440 ; GFX8-NEXT: v_bfe_i32 v11, v0, 16, 4
1441 ; GFX8-NEXT: v_mad_i32_i24 v1, v8, v9, v1
1442 ; GFX8-NEXT: v_bfe_i32 v13, v0, 20, 4
1443 ; GFX8-NEXT: v_mad_i32_i24 v1, v10, v11, v1
1444 ; GFX8-NEXT: v_bfe_i32 v14, v3, 24, 4
1445 ; GFX8-NEXT: v_bfe_i32 v15, v0, 24, 4
1446 ; GFX8-NEXT: v_mad_i32_i24 v1, v12, v13, v1
1447 ; GFX8-NEXT: v_ashrrev_i32_e32 v3, 28, v3
1448 ; GFX8-NEXT: v_ashrrev_i32_e32 v0, 28, v0
1449 ; GFX8-NEXT: v_mad_i32_i24 v1, v14, v15, v1
1450 ; GFX8-NEXT: v_mad_i32_i24 v0, v3, v0, v1
1451 ; GFX8-NEXT: v_add_u32_e32 v2, vcc, v16, v0
1452 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
1453 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
1454 ; GFX8-NEXT: flat_store_dword v[0:1], v2
1455 ; GFX8-NEXT: s_endpgm
1457 ; GFX9-LABEL: idot8_multiuses_mul1:
1458 ; GFX9: ; %bb.0: ; %entry
1459 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1460 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1461 ; GFX9-NEXT: s_mov_b32 s10, -1
1462 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
1463 ; GFX9-NEXT: s_add_u32 s8, s8, s3
1464 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1465 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
1466 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1467 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
1468 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1469 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
1470 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
1471 ; GFX9-NEXT: s_load_dword s0, s[2:3], 0x0
1472 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
1473 ; GFX9-NEXT: s_waitcnt vmcnt(1)
1474 ; GFX9-NEXT: v_bfe_i32 v3, v1, 0, 4
1475 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1476 ; GFX9-NEXT: v_bfe_i32 v4, v2, 0, 4
1477 ; GFX9-NEXT: v_bfe_i32 v5, v1, 4, 4
1478 ; GFX9-NEXT: v_bfe_i32 v6, v2, 4, 4
1479 ; GFX9-NEXT: v_bfe_i32 v7, v1, 8, 4
1480 ; GFX9-NEXT: v_bfe_i32 v8, v2, 8, 4
1481 ; GFX9-NEXT: v_bfe_i32 v9, v1, 12, 4
1482 ; GFX9-NEXT: v_bfe_i32 v10, v2, 12, 4
1483 ; GFX9-NEXT: v_bfe_i32 v11, v1, 16, 4
1484 ; GFX9-NEXT: v_bfe_i32 v12, v2, 16, 4
1485 ; GFX9-NEXT: v_bfe_i32 v13, v1, 20, 4
1486 ; GFX9-NEXT: v_bfe_i32 v14, v2, 20, 4
1487 ; GFX9-NEXT: v_bfe_i32 v15, v1, 24, 4
1488 ; GFX9-NEXT: v_bfe_i32 v16, v2, 24, 4
1489 ; GFX9-NEXT: v_ashrrev_i32_e32 v1, 28, v1
1490 ; GFX9-NEXT: v_ashrrev_i32_e32 v2, 28, v2
1491 ; GFX9-NEXT: v_mul_i32_i24_e32 v1, v1, v2
1492 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1493 ; GFX9-NEXT: v_mad_i32_i24 v2, v3, v4, s0
1494 ; GFX9-NEXT: v_mul_i32_i24_e32 v5, v5, v6
1495 ; GFX9-NEXT: v_mul_i32_i24_e32 v6, v7, v8
1496 ; GFX9-NEXT: v_mad_i32_i24 v3, v3, v4, v2
1497 ; GFX9-NEXT: v_mul_i32_i24_e32 v7, v9, v10
1498 ; GFX9-NEXT: v_mul_i32_i24_e32 v8, v11, v12
1499 ; GFX9-NEXT: v_add3_u32 v3, v3, v5, v6
1500 ; GFX9-NEXT: v_mul_i32_i24_e32 v9, v13, v14
1501 ; GFX9-NEXT: v_mul_i32_i24_e32 v10, v15, v16
1502 ; GFX9-NEXT: v_add3_u32 v3, v3, v7, v8
1503 ; GFX9-NEXT: v_add3_u32 v3, v3, v9, v10
1504 ; GFX9-NEXT: v_add3_u32 v1, v3, v1, v2
1505 ; GFX9-NEXT: global_store_dword v0, v1, s[2:3]
1506 ; GFX9-NEXT: s_endpgm
1508 ; GFX9-DL-LABEL: idot8_multiuses_mul1:
1509 ; GFX9-DL: ; %bb.0: ; %entry
1510 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1511 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1512 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
1513 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
1514 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
1515 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1516 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
1517 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1518 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
1519 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
1520 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
1521 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
1522 ; GFX9-DL-NEXT: s_load_dword s0, s[2:3], 0x0
1523 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
1524 ; GFX9-DL-NEXT: s_waitcnt vmcnt(1)
1525 ; GFX9-DL-NEXT: v_bfe_i32 v3, v1, 0, 4
1526 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0)
1527 ; GFX9-DL-NEXT: v_bfe_i32 v4, v2, 0, 4
1528 ; GFX9-DL-NEXT: v_bfe_i32 v5, v1, 4, 4
1529 ; GFX9-DL-NEXT: v_bfe_i32 v6, v2, 4, 4
1530 ; GFX9-DL-NEXT: v_bfe_i32 v7, v1, 8, 4
1531 ; GFX9-DL-NEXT: v_bfe_i32 v8, v2, 8, 4
1532 ; GFX9-DL-NEXT: v_bfe_i32 v9, v1, 12, 4
1533 ; GFX9-DL-NEXT: v_bfe_i32 v10, v2, 12, 4
1534 ; GFX9-DL-NEXT: v_bfe_i32 v11, v1, 16, 4
1535 ; GFX9-DL-NEXT: v_bfe_i32 v12, v2, 16, 4
1536 ; GFX9-DL-NEXT: v_bfe_i32 v13, v1, 20, 4
1537 ; GFX9-DL-NEXT: v_bfe_i32 v14, v2, 20, 4
1538 ; GFX9-DL-NEXT: v_bfe_i32 v15, v1, 24, 4
1539 ; GFX9-DL-NEXT: v_bfe_i32 v16, v2, 24, 4
1540 ; GFX9-DL-NEXT: v_ashrrev_i32_e32 v1, 28, v1
1541 ; GFX9-DL-NEXT: v_ashrrev_i32_e32 v2, 28, v2
1542 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v1, v1, v2
1543 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
1544 ; GFX9-DL-NEXT: v_mad_i32_i24 v2, v3, v4, s0
1545 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v5, v5, v6
1546 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v6, v7, v8
1547 ; GFX9-DL-NEXT: v_mad_i32_i24 v3, v3, v4, v2
1548 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v7, v9, v10
1549 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v8, v11, v12
1550 ; GFX9-DL-NEXT: v_add3_u32 v3, v3, v5, v6
1551 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v9, v13, v14
1552 ; GFX9-DL-NEXT: v_mul_i32_i24_e32 v10, v15, v16
1553 ; GFX9-DL-NEXT: v_add3_u32 v3, v3, v7, v8
1554 ; GFX9-DL-NEXT: v_add3_u32 v3, v3, v9, v10
1555 ; GFX9-DL-NEXT: v_add3_u32 v1, v3, v1, v2
1556 ; GFX9-DL-NEXT: global_store_dword v0, v1, s[2:3]
1557 ; GFX9-DL-NEXT: s_endpgm
1559 ; GFX10-DL-XNACK-LABEL: idot8_multiuses_mul1:
1560 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
1561 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1562 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1563 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1564 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1565 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1566 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
1567 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
1568 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
1569 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
1570 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
1571 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
1572 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
1573 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
1574 ; GFX10-DL-XNACK-NEXT: s_load_dword s2, s[0:1], 0x0
1575 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(1)
1576 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v0, v1, 0, 4
1577 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v3, v1, 4, 4
1578 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0)
1579 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v4, v2, 4, 4
1580 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v5, v1, 8, 4
1581 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v6, v2, 8, 4
1582 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v7, v2, 0, 4
1583 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v8, v1, 12, 4
1584 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v3, v3, v4
1585 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v9, v2, 12, 4
1586 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v4, v5, v6
1587 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
1588 ; GFX10-DL-XNACK-NEXT: v_mad_i32_i24 v5, v0, v7, s2
1589 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v6, v1, 16, 4
1590 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v10, v2, 16, 4
1591 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v11, v1, 20, 4
1592 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v12, v2, 20, 4
1593 ; GFX10-DL-XNACK-NEXT: v_mad_i32_i24 v0, v0, v7, v5
1594 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v7, v1, 24, 4
1595 ; GFX10-DL-XNACK-NEXT: v_bfe_i32 v13, v2, 24, 4
1596 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v8, v8, v9
1597 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v6, v6, v10
1598 ; GFX10-DL-XNACK-NEXT: v_add3_u32 v0, v0, v3, v4
1599 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v3, v11, v12
1600 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v4, v7, v13
1601 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i32_e32 v1, 28, v1
1602 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i32_e32 v2, 28, v2
1603 ; GFX10-DL-XNACK-NEXT: v_add3_u32 v0, v0, v8, v6
1604 ; GFX10-DL-XNACK-NEXT: v_mul_i32_i24_e32 v1, v1, v2
1605 ; GFX10-DL-XNACK-NEXT: v_add3_u32 v0, v0, v3, v4
1606 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v2, 0
1607 ; GFX10-DL-XNACK-NEXT: v_add3_u32 v0, v0, v1, v5
1608 ; GFX10-DL-XNACK-NEXT: global_store_dword v2, v0, s[0:1]
1609 ; GFX10-DL-XNACK-NEXT: s_endpgm
1611 ; GFX10-DL-NOXNACK-LABEL: idot8_multiuses_mul1:
1612 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
1613 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1614 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1615 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1616 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1617 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1618 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
1619 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
1620 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
1621 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
1622 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
1623 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
1624 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
1625 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
1626 ; GFX10-DL-NOXNACK-NEXT: s_load_dword s2, s[0:1], 0x0
1627 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(1)
1628 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v2, v1, 0, 4
1629 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v3, v1, 4, 4
1630 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0)
1631 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v4, v0, 4, 4
1632 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v5, v1, 8, 4
1633 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v6, v0, 8, 4
1634 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v7, v0, 0, 4
1635 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v8, v1, 12, 4
1636 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v3, v3, v4
1637 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v9, v0, 12, 4
1638 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v4, v5, v6
1639 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
1640 ; GFX10-DL-NOXNACK-NEXT: v_mad_i32_i24 v5, v2, v7, s2
1641 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v6, v1, 16, 4
1642 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v10, v0, 16, 4
1643 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v11, v1, 20, 4
1644 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v12, v0, 20, 4
1645 ; GFX10-DL-NOXNACK-NEXT: v_mad_i32_i24 v2, v2, v7, v5
1646 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v7, v1, 24, 4
1647 ; GFX10-DL-NOXNACK-NEXT: v_bfe_i32 v13, v0, 24, 4
1648 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v8, v8, v9
1649 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v6, v6, v10
1650 ; GFX10-DL-NOXNACK-NEXT: v_add3_u32 v2, v2, v3, v4
1651 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v3, v11, v12
1652 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v4, v7, v13
1653 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i32_e32 v1, 28, v1
1654 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i32_e32 v0, 28, v0
1655 ; GFX10-DL-NOXNACK-NEXT: v_add3_u32 v2, v2, v8, v6
1656 ; GFX10-DL-NOXNACK-NEXT: v_mul_i32_i24_e32 v0, v1, v0
1657 ; GFX10-DL-NOXNACK-NEXT: v_add3_u32 v1, v2, v3, v4
1658 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
1659 ; GFX10-DL-NOXNACK-NEXT: v_add3_u32 v0, v1, v0, v5
1660 ; GFX10-DL-NOXNACK-NEXT: global_store_dword v2, v0, s[0:1]
1661 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
1662 ptr addrspace(1) %src2,
1663 ptr addrspace(1) nocapture %dst) {
1665 %idx = call i32 @llvm.amdgcn.workitem.id.x()
1666 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
1667 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
1668 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
1669 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
1671 %v1e0 = extractelement <8 x i4> %vec1, i64 0
1672 %cv1e0 = sext i4 %v1e0 to i32
1673 %v2e0 = extractelement <8 x i4> %vec2, i64 0
1674 %cv2e0 = sext i4 %v2e0 to i32
1675 %mul0 = mul nuw nsw i32 %cv1e0, %cv2e0
1677 %v1e1 = extractelement <8 x i4> %vec1, i64 1
1678 %cv1e1 = sext i4 %v1e1 to i32
1679 %v2e1 = extractelement <8 x i4> %vec2, i64 1
1680 %cv2e1 = sext i4 %v2e1 to i32
1681 %mul1 = mul nuw nsw i32 %cv1e1, %cv2e1
1683 %v1e2 = extractelement <8 x i4> %vec1, i64 2
1684 %cv1e2 = sext i4 %v1e2 to i32
1685 %v2e2 = extractelement <8 x i4> %vec2, i64 2
1686 %cv2e2 = sext i4 %v2e2 to i32
1687 %mul2 = mul nuw nsw i32 %cv1e2, %cv2e2
1689 %v1e3 = extractelement <8 x i4> %vec1, i64 3
1690 %cv1e3 = sext i4 %v1e3 to i32
1691 %v2e3 = extractelement <8 x i4> %vec2, i64 3
1692 %cv2e3 = sext i4 %v2e3 to i32
1693 %mul3 = mul nuw nsw i32 %cv1e3, %cv2e3
1695 %v1e4 = extractelement <8 x i4> %vec1, i64 4
1696 %cv1e4 = sext i4 %v1e4 to i32
1697 %v2e4 = extractelement <8 x i4> %vec2, i64 4
1698 %cv2e4 = sext i4 %v2e4 to i32
1699 %mul4 = mul nuw nsw i32 %cv1e4, %cv2e4
1701 %v1e5 = extractelement <8 x i4> %vec1, i64 5
1702 %cv1e5 = sext i4 %v1e5 to i32
1703 %v2e5 = extractelement <8 x i4> %vec2, i64 5
1704 %cv2e5 = sext i4 %v2e5 to i32
1705 %mul5 = mul nuw nsw i32 %cv1e5, %cv2e5
1707 %v1e6 = extractelement <8 x i4> %vec1, i64 6
1708 %cv1e6 = sext i4 %v1e6 to i32
1709 %v2e6 = extractelement <8 x i4> %vec2, i64 6
1710 %cv2e6 = sext i4 %v2e6 to i32
1711 %mul6 = mul nuw nsw i32 %cv1e6, %cv2e6
1713 %v1e7 = extractelement <8 x i4> %vec1, i64 7
1714 %cv1e7 = sext i4 %v1e7 to i32
1715 %v2e7 = extractelement <8 x i4> %vec2, i64 7
1716 %cv2e7 = sext i4 %v2e7 to i32
1717 %mul7 = mul nuw nsw i32 %cv1e7, %cv2e7
1719 %acc = load i32, ptr addrspace(1) %dst, align 4
1720 %add = add i32 %mul0, %acc
1721 %add1 = add i32 %mul0, %add
1722 %add2 = add i32 %add1, %mul1
1723 %add3 = add i32 %add2, %mul2
1724 %add4 = add i32 %add3, %mul3
1725 %add5 = add i32 %add4, %mul4
1726 %add6 = add i32 %add5, %mul5
1727 %add7 = add i32 %add6, %mul6
1728 %add8 = add i32 %add7, %mul7
1730 %res = add i32 %add, %add8
1731 store i32 %res, ptr addrspace(1) %dst, align 4
1735 ; TODO: Support this pattern.
1736 define amdgpu_kernel void @idot8_acc32_vecMul(ptr addrspace(1) %src1,
1737 ; GFX7-LABEL: idot8_acc32_vecMul:
1738 ; GFX7: ; %bb.0: ; %entry
1739 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
1740 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
1741 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
1742 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
1743 ; GFX7-NEXT: s_mov_b32 s14, -1
1744 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
1745 ; GFX7-NEXT: s_add_u32 s12, s12, s3
1746 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
1747 ; GFX7-NEXT: s_mov_b32 s10, 0
1748 ; GFX7-NEXT: s_mov_b32 s11, s3
1749 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1750 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
1751 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1752 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
1753 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
1754 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
1755 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
1756 ; GFX7-NEXT: s_load_dword s4, s[0:1], 0x0
1757 ; GFX7-NEXT: s_mov_b32 s2, -1
1758 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
1759 ; GFX7-NEXT: s_waitcnt vmcnt(1)
1760 ; GFX7-NEXT: v_ashrrev_i32_e32 v1, 28, v2
1761 ; GFX7-NEXT: v_bfe_i32 v3, v2, 24, 4
1762 ; GFX7-NEXT: v_bfe_i32 v4, v2, 20, 4
1763 ; GFX7-NEXT: v_bfe_i32 v5, v2, 16, 4
1764 ; GFX7-NEXT: v_bfe_i32 v6, v2, 12, 4
1765 ; GFX7-NEXT: v_bfe_i32 v7, v2, 8, 4
1766 ; GFX7-NEXT: v_bfe_i32 v8, v2, 4, 4
1767 ; GFX7-NEXT: v_bfe_i32 v2, v2, 0, 4
1768 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1769 ; GFX7-NEXT: v_ashrrev_i32_e32 v9, 28, v0
1770 ; GFX7-NEXT: v_bfe_i32 v10, v0, 24, 4
1771 ; GFX7-NEXT: v_bfe_i32 v11, v0, 20, 4
1772 ; GFX7-NEXT: v_bfe_i32 v12, v0, 16, 4
1773 ; GFX7-NEXT: v_bfe_i32 v13, v0, 12, 4
1774 ; GFX7-NEXT: v_bfe_i32 v14, v0, 8, 4
1775 ; GFX7-NEXT: v_bfe_i32 v15, v0, 4, 4
1776 ; GFX7-NEXT: v_bfe_i32 v0, v0, 0, 4
1777 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1778 ; GFX7-NEXT: v_mad_i32_i24 v0, v2, v0, s4
1779 ; GFX7-NEXT: v_mad_i32_i24 v0, v8, v15, v0
1780 ; GFX7-NEXT: v_mad_i32_i24 v0, v7, v14, v0
1781 ; GFX7-NEXT: v_mad_i32_i24 v0, v6, v13, v0
1782 ; GFX7-NEXT: v_mad_i32_i24 v0, v5, v12, v0
1783 ; GFX7-NEXT: v_mad_i32_i24 v0, v4, v11, v0
1784 ; GFX7-NEXT: v_mad_i32_i24 v0, v3, v10, v0
1785 ; GFX7-NEXT: v_mad_i32_i24 v0, v1, v9, v0
1786 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
1787 ; GFX7-NEXT: s_endpgm
1789 ; GFX8-LABEL: idot8_acc32_vecMul:
1790 ; GFX8: ; %bb.0: ; %entry
1791 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1792 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1793 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
1794 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1795 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1796 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1797 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
1798 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
1799 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
1800 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
1801 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
1802 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
1803 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
1804 ; GFX8-NEXT: flat_load_dword v0, v[0:1]
1805 ; GFX8-NEXT: s_load_dword s2, s[0:1], 0x0
1806 ; GFX8-NEXT: s_mov_b32 s10, -1
1807 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
1808 ; GFX8-NEXT: s_add_u32 s8, s8, s3
1809 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
1810 ; GFX8-NEXT: s_waitcnt vmcnt(1)
1811 ; GFX8-NEXT: v_ashrrev_i32_e32 v1, 28, v3
1812 ; GFX8-NEXT: v_bfe_i32 v2, v3, 24, 4
1813 ; GFX8-NEXT: v_bfe_i32 v4, v3, 20, 4
1814 ; GFX8-NEXT: v_bfe_i32 v5, v3, 16, 4
1815 ; GFX8-NEXT: v_bfe_i32 v6, v3, 12, 4
1816 ; GFX8-NEXT: v_bfe_i32 v7, v3, 8, 4
1817 ; GFX8-NEXT: v_bfe_i32 v8, v3, 4, 4
1818 ; GFX8-NEXT: v_bfe_i32 v3, v3, 0, 4
1819 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1820 ; GFX8-NEXT: v_ashrrev_i32_e32 v9, 28, v0
1821 ; GFX8-NEXT: v_bfe_i32 v10, v0, 24, 4
1822 ; GFX8-NEXT: v_bfe_i32 v11, v0, 20, 4
1823 ; GFX8-NEXT: v_bfe_i32 v12, v0, 16, 4
1824 ; GFX8-NEXT: v_bfe_i32 v13, v0, 12, 4
1825 ; GFX8-NEXT: v_bfe_i32 v14, v0, 8, 4
1826 ; GFX8-NEXT: v_bfe_i32 v15, v0, 4, 4
1827 ; GFX8-NEXT: v_bfe_i32 v0, v0, 0, 4
1828 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1829 ; GFX8-NEXT: v_mad_i32_i24 v0, v3, v0, s2
1830 ; GFX8-NEXT: v_mad_i32_i24 v0, v8, v15, v0
1831 ; GFX8-NEXT: v_mad_i32_i24 v0, v7, v14, v0
1832 ; GFX8-NEXT: v_mad_i32_i24 v0, v6, v13, v0
1833 ; GFX8-NEXT: v_mad_i32_i24 v0, v5, v12, v0
1834 ; GFX8-NEXT: v_mad_i32_i24 v0, v4, v11, v0
1835 ; GFX8-NEXT: v_mad_i32_i24 v0, v2, v10, v0
1836 ; GFX8-NEXT: v_mad_i32_i24 v2, v1, v9, v0
1837 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
1838 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
1839 ; GFX8-NEXT: flat_store_dword v[0:1], v2
1840 ; GFX8-NEXT: s_endpgm
1842 ; GFX9-LABEL: idot8_acc32_vecMul:
1843 ; GFX9: ; %bb.0: ; %entry
1844 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1845 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1846 ; GFX9-NEXT: s_mov_b32 s10, -1
1847 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
1848 ; GFX9-NEXT: s_add_u32 s8, s8, s3
1849 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1850 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
1851 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1852 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
1853 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1854 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
1855 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
1856 ; GFX9-NEXT: s_load_dword s0, s[2:3], 0x0
1857 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
1858 ; GFX9-NEXT: s_waitcnt vmcnt(1)
1859 ; GFX9-NEXT: v_ashrrev_i32_e32 v3, 28, v1
1860 ; GFX9-NEXT: v_bfe_i32 v4, v1, 24, 4
1861 ; GFX9-NEXT: v_bfe_i32 v5, v1, 20, 4
1862 ; GFX9-NEXT: v_bfe_i32 v6, v1, 16, 4
1863 ; GFX9-NEXT: v_bfe_i32 v7, v1, 12, 4
1864 ; GFX9-NEXT: v_bfe_i32 v8, v1, 8, 4
1865 ; GFX9-NEXT: v_bfe_i32 v9, v1, 4, 4
1866 ; GFX9-NEXT: v_bfe_i32 v1, v1, 0, 4
1867 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1868 ; GFX9-NEXT: v_ashrrev_i32_e32 v10, 28, v2
1869 ; GFX9-NEXT: v_bfe_i32 v11, v2, 24, 4
1870 ; GFX9-NEXT: v_bfe_i32 v12, v2, 20, 4
1871 ; GFX9-NEXT: v_bfe_i32 v13, v2, 16, 4
1872 ; GFX9-NEXT: v_bfe_i32 v14, v2, 12, 4
1873 ; GFX9-NEXT: v_bfe_i32 v15, v2, 8, 4
1874 ; GFX9-NEXT: v_bfe_i32 v16, v2, 4, 4
1875 ; GFX9-NEXT: v_bfe_i32 v2, v2, 0, 4
1876 ; GFX9-NEXT: v_mul_i32_i24_e32 v1, v1, v2
1877 ; GFX9-NEXT: v_mul_i32_i24_e32 v2, v9, v16
1878 ; GFX9-NEXT: v_mul_i32_i24_e32 v8, v8, v15
1879 ; GFX9-NEXT: v_mul_i32_i24_e32 v7, v7, v14
1880 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1881 ; GFX9-NEXT: v_add3_u32 v1, v1, s0, v2
1882 ; GFX9-NEXT: v_mul_i32_i24_e32 v6, v6, v13
1883 ; GFX9-NEXT: v_mul_i32_i24_e32 v5, v5, v12
1884 ; GFX9-NEXT: v_add3_u32 v1, v1, v8, v7
1885 ; GFX9-NEXT: v_mul_i32_i24_e32 v4, v4, v11
1886 ; GFX9-NEXT: v_mul_i32_i24_e32 v3, v3, v10
1887 ; GFX9-NEXT: v_add3_u32 v1, v1, v6, v5
1888 ; GFX9-NEXT: v_add3_u32 v1, v1, v4, v3
1889 ; GFX9-NEXT: global_store_dword v0, v1, s[2:3]
1890 ; GFX9-NEXT: s_endpgm
1892 ; GFX9-DL-LABEL: idot8_acc32_vecMul:
1893 ; GFX9-DL: ; %bb.0: ; %entry
1894 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1895 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1896 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
1897 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
1898 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
1899 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1900 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
1901 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1902 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
1903 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
1904 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
1905 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
1906 ; GFX9-DL-NEXT: s_load_dword s0, s[2:3], 0x0
1907 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
1908 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1909 ; GFX9-DL-NEXT: v_dot8_i32_i4 v1, v1, v2, s0
1910 ; GFX9-DL-NEXT: global_store_dword v0, v1, s[2:3]
1911 ; GFX9-DL-NEXT: s_endpgm
1913 ; GFX10-DL-XNACK-LABEL: idot8_acc32_vecMul:
1914 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
1915 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1916 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1917 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1918 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1919 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1920 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
1921 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
1922 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
1923 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
1924 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
1925 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
1926 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
1927 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
1928 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v0, 0
1929 ; GFX10-DL-XNACK-NEXT: s_load_dword s2, s[0:1], 0x0
1930 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1931 ; GFX10-DL-XNACK-NEXT: v_dot8_i32_i4 v1, v1, v2, s2
1932 ; GFX10-DL-XNACK-NEXT: global_store_dword v0, v1, s[0:1]
1933 ; GFX10-DL-XNACK-NEXT: s_endpgm
1935 ; GFX10-DL-NOXNACK-LABEL: idot8_acc32_vecMul:
1936 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
1937 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1938 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
1939 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
1940 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
1941 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
1942 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
1943 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
1944 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
1945 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
1946 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
1947 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
1948 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
1949 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
1950 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
1951 ; GFX10-DL-NOXNACK-NEXT: s_load_dword s2, s[0:1], 0x0
1952 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1953 ; GFX10-DL-NOXNACK-NEXT: v_dot8_i32_i4 v0, v1, v0, s2
1954 ; GFX10-DL-NOXNACK-NEXT: global_store_dword v2, v0, s[0:1]
1955 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
1956 ptr addrspace(1) %src2,
1957 ptr addrspace(1) nocapture %dst) {
1959 %idx = call i32 @llvm.amdgcn.workitem.id.x()
1960 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
1961 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
1962 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
1963 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
1965 %cvec1 = sext <8 x i4> %vec1 to <8 x i32>
1966 %cvec2 = sext <8 x i4> %vec2 to <8 x i32>
1968 %mul = mul <8 x i32> %cvec1, %cvec2
1969 %mul0 = extractelement <8 x i32> %mul, i64 0
1970 %mul1 = extractelement <8 x i32> %mul, i64 1
1971 %mul2 = extractelement <8 x i32> %mul, i64 2
1972 %mul3 = extractelement <8 x i32> %mul, i64 3
1973 %mul4 = extractelement <8 x i32> %mul, i64 4
1974 %mul5 = extractelement <8 x i32> %mul, i64 5
1975 %mul6 = extractelement <8 x i32> %mul, i64 6
1976 %mul7 = extractelement <8 x i32> %mul, i64 7
1978 %acc = load i32, ptr addrspace(1) %dst, align 4
1979 %add1 = add i32 %mul0, %acc
1980 %add2 = add i32 %add1, %mul1
1981 %add3 = add i32 %add2, %mul2
1982 %add4 = add i32 %add3, %mul3
1983 %add5 = add i32 %add4, %mul4
1984 %add6 = add i32 %add5, %mul5
1985 %add7 = add i32 %add6, %mul6
1986 %add8 = add i32 %add7, %mul7
1988 store i32 %add8, ptr addrspace(1) %dst, align 4
1992 ; TODO: Support this pattern.
1993 define amdgpu_kernel void @idot8_acc16_vecMul(ptr addrspace(1) %src1,
1994 ; GFX7-LABEL: idot8_acc16_vecMul:
1995 ; GFX7: ; %bb.0: ; %entry
1996 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
1997 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
1998 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
1999 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
2000 ; GFX7-NEXT: s_mov_b32 s14, -1
2001 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
2002 ; GFX7-NEXT: s_add_u32 s12, s12, s3
2003 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2004 ; GFX7-NEXT: s_mov_b32 s10, 0
2005 ; GFX7-NEXT: s_mov_b32 s11, s3
2006 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2007 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
2008 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2009 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
2010 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
2011 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
2012 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
2013 ; GFX7-NEXT: s_mov_b32 s2, -1
2014 ; GFX7-NEXT: buffer_load_ushort v1, off, s[0:3], 0
2015 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
2016 ; GFX7-NEXT: s_waitcnt vmcnt(2)
2017 ; GFX7-NEXT: v_bfe_i32 v6, v2, 0, 4
2018 ; GFX7-NEXT: v_bfe_i32 v3, v2, 24, 4
2019 ; GFX7-NEXT: s_waitcnt vmcnt(1)
2020 ; GFX7-NEXT: v_bfe_i32 v13, v0, 0, 4
2021 ; GFX7-NEXT: v_bfe_i32 v4, v2, 16, 4
2022 ; GFX7-NEXT: v_bfe_i32 v5, v2, 8, 4
2023 ; GFX7-NEXT: v_ashrrev_i32_e32 v7, 28, v2
2024 ; GFX7-NEXT: v_bfe_i32 v8, v2, 20, 4
2025 ; GFX7-NEXT: v_bfe_i32 v9, v2, 12, 4
2026 ; GFX7-NEXT: v_bfe_i32 v2, v2, 4, 4
2027 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff, v6
2028 ; GFX7-NEXT: v_bfe_i32 v10, v0, 24, 4
2029 ; GFX7-NEXT: v_bfe_i32 v11, v0, 16, 4
2030 ; GFX7-NEXT: v_bfe_i32 v12, v0, 8, 4
2031 ; GFX7-NEXT: v_ashrrev_i32_e32 v14, 28, v0
2032 ; GFX7-NEXT: v_bfe_i32 v15, v0, 20, 4
2033 ; GFX7-NEXT: v_bfe_i32 v16, v0, 12, 4
2034 ; GFX7-NEXT: v_bfe_i32 v0, v0, 4, 4
2035 ; GFX7-NEXT: v_and_b32_e32 v13, 0xffff, v13
2036 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff, v2
2037 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff, v0
2038 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2039 ; GFX7-NEXT: v_mad_u32_u24 v1, v6, v13, v1
2040 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff, v5
2041 ; GFX7-NEXT: v_and_b32_e32 v12, 0xffff, v12
2042 ; GFX7-NEXT: v_mad_u32_u24 v0, v2, v0, v1
2043 ; GFX7-NEXT: v_and_b32_e32 v9, 0xffff, v9
2044 ; GFX7-NEXT: v_and_b32_e32 v16, 0xffff, v16
2045 ; GFX7-NEXT: v_mad_u32_u24 v0, v5, v12, v0
2046 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff, v4
2047 ; GFX7-NEXT: v_and_b32_e32 v11, 0xffff, v11
2048 ; GFX7-NEXT: v_mad_u32_u24 v0, v9, v16, v0
2049 ; GFX7-NEXT: v_and_b32_e32 v8, 0xffff, v8
2050 ; GFX7-NEXT: v_and_b32_e32 v15, 0xffff, v15
2051 ; GFX7-NEXT: v_mad_u32_u24 v0, v4, v11, v0
2052 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff, v3
2053 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff, v10
2054 ; GFX7-NEXT: v_mad_u32_u24 v0, v8, v15, v0
2055 ; GFX7-NEXT: v_and_b32_e32 v7, 0xffff, v7
2056 ; GFX7-NEXT: v_and_b32_e32 v14, 0xffff, v14
2057 ; GFX7-NEXT: v_mad_u32_u24 v0, v3, v10, v0
2058 ; GFX7-NEXT: v_mad_u32_u24 v0, v7, v14, v0
2059 ; GFX7-NEXT: buffer_store_short v0, off, s[0:3], 0
2060 ; GFX7-NEXT: s_endpgm
2062 ; GFX8-LABEL: idot8_acc16_vecMul:
2063 ; GFX8: ; %bb.0: ; %entry
2064 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2065 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2066 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
2067 ; GFX8-NEXT: v_mov_b32_e32 v5, 12
2068 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2069 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2070 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
2071 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
2072 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
2073 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
2074 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
2075 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
2076 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
2077 ; GFX8-NEXT: flat_load_dword v2, v[0:1]
2078 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2079 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2080 ; GFX8-NEXT: flat_load_ushort v4, v[0:1]
2081 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2082 ; GFX8-NEXT: s_mov_b32 s10, -1
2083 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
2084 ; GFX8-NEXT: s_add_u32 s8, s8, s3
2085 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
2086 ; GFX8-NEXT: s_waitcnt vmcnt(2)
2087 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, 28, v3
2088 ; GFX8-NEXT: v_lshlrev_b16_sdwa v7, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2089 ; GFX8-NEXT: v_lshrrev_b32_e32 v8, 20, v3
2090 ; GFX8-NEXT: v_lshlrev_b16_sdwa v9, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2091 ; GFX8-NEXT: v_lshrrev_b32_e32 v10, 12, v3
2092 ; GFX8-NEXT: v_lshrrev_b32_e32 v11, 8, v3
2093 ; GFX8-NEXT: v_lshrrev_b32_e32 v12, 4, v3
2094 ; GFX8-NEXT: v_lshlrev_b16_e32 v3, 12, v3
2095 ; GFX8-NEXT: s_waitcnt vmcnt(1)
2096 ; GFX8-NEXT: v_lshrrev_b32_e32 v13, 28, v2
2097 ; GFX8-NEXT: v_lshlrev_b16_sdwa v14, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2098 ; GFX8-NEXT: v_lshrrev_b32_e32 v15, 20, v2
2099 ; GFX8-NEXT: v_lshlrev_b16_sdwa v5, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2100 ; GFX8-NEXT: v_lshrrev_b32_e32 v16, 12, v2
2101 ; GFX8-NEXT: v_lshrrev_b32_e32 v17, 8, v2
2102 ; GFX8-NEXT: v_lshrrev_b32_e32 v18, 4, v2
2103 ; GFX8-NEXT: v_lshlrev_b16_e32 v2, 12, v2
2104 ; GFX8-NEXT: v_lshlrev_b16_e32 v12, 12, v12
2105 ; GFX8-NEXT: v_ashrrev_i16_e32 v3, 12, v3
2106 ; GFX8-NEXT: v_lshlrev_b16_e32 v18, 12, v18
2107 ; GFX8-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2108 ; GFX8-NEXT: v_lshlrev_b16_e32 v11, 12, v11
2109 ; GFX8-NEXT: v_lshlrev_b16_e32 v17, 12, v17
2110 ; GFX8-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2111 ; GFX8-NEXT: v_ashrrev_i16_e32 v18, 12, v18
2112 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2113 ; GFX8-NEXT: v_mad_u16 v2, v3, v2, v4
2114 ; GFX8-NEXT: v_lshlrev_b16_e32 v10, 12, v10
2115 ; GFX8-NEXT: v_lshlrev_b16_e32 v16, 12, v16
2116 ; GFX8-NEXT: v_ashrrev_i16_e32 v11, 12, v11
2117 ; GFX8-NEXT: v_ashrrev_i16_e32 v17, 12, v17
2118 ; GFX8-NEXT: v_mad_u16 v2, v12, v18, v2
2119 ; GFX8-NEXT: v_ashrrev_i16_e32 v10, 12, v10
2120 ; GFX8-NEXT: v_ashrrev_i16_e32 v16, 12, v16
2121 ; GFX8-NEXT: v_mad_u16 v2, v11, v17, v2
2122 ; GFX8-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2123 ; GFX8-NEXT: v_ashrrev_i16_e32 v9, 12, v9
2124 ; GFX8-NEXT: v_lshlrev_b16_e32 v15, 12, v15
2125 ; GFX8-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2126 ; GFX8-NEXT: v_mad_u16 v2, v10, v16, v2
2127 ; GFX8-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2128 ; GFX8-NEXT: v_ashrrev_i16_e32 v15, 12, v15
2129 ; GFX8-NEXT: v_mad_u16 v2, v9, v5, v2
2130 ; GFX8-NEXT: v_lshlrev_b16_e32 v6, 12, v6
2131 ; GFX8-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2132 ; GFX8-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2133 ; GFX8-NEXT: v_ashrrev_i16_e32 v14, 12, v14
2134 ; GFX8-NEXT: v_mad_u16 v2, v8, v15, v2
2135 ; GFX8-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2136 ; GFX8-NEXT: v_ashrrev_i16_e32 v13, 12, v13
2137 ; GFX8-NEXT: v_mad_u16 v2, v7, v14, v2
2138 ; GFX8-NEXT: v_mad_u16 v2, v6, v13, v2
2139 ; GFX8-NEXT: flat_store_short v[0:1], v2
2140 ; GFX8-NEXT: s_endpgm
2142 ; GFX9-LABEL: idot8_acc16_vecMul:
2143 ; GFX9: ; %bb.0: ; %entry
2144 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2145 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2146 ; GFX9-NEXT: s_mov_b32 s10, -1
2147 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
2148 ; GFX9-NEXT: s_add_u32 s8, s8, s3
2149 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2150 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
2151 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2152 ; GFX9-NEXT: v_mov_b32_e32 v4, 12
2153 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2154 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
2155 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
2156 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
2157 ; GFX9-NEXT: global_load_ushort v3, v0, s[2:3]
2158 ; GFX9-NEXT: s_mov_b32 s0, 0x5040100
2159 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
2160 ; GFX9-NEXT: s_waitcnt vmcnt(2)
2161 ; GFX9-NEXT: v_lshrrev_b32_e32 v6, 4, v1
2162 ; GFX9-NEXT: v_lshrrev_b32_e32 v7, 8, v1
2163 ; GFX9-NEXT: v_lshrrev_b32_e32 v8, 12, v1
2164 ; GFX9-NEXT: s_waitcnt vmcnt(1)
2165 ; GFX9-NEXT: v_lshrrev_b32_e32 v13, 4, v2
2166 ; GFX9-NEXT: v_lshlrev_b16_e32 v5, 12, v1
2167 ; GFX9-NEXT: v_lshlrev_b16_e32 v12, 12, v2
2168 ; GFX9-NEXT: v_lshlrev_b16_e32 v6, 12, v6
2169 ; GFX9-NEXT: v_lshlrev_b16_e32 v7, 12, v7
2170 ; GFX9-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2171 ; GFX9-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2172 ; GFX9-NEXT: v_lshlrev_b16_sdwa v9, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2173 ; GFX9-NEXT: v_lshrrev_b32_e32 v10, 20, v1
2174 ; GFX9-NEXT: v_lshlrev_b16_sdwa v11, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2175 ; GFX9-NEXT: v_lshrrev_b32_e32 v1, 28, v1
2176 ; GFX9-NEXT: v_lshrrev_b32_e32 v14, 8, v2
2177 ; GFX9-NEXT: v_lshrrev_b32_e32 v15, 12, v2
2178 ; GFX9-NEXT: v_lshlrev_b16_sdwa v16, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2179 ; GFX9-NEXT: v_lshrrev_b32_e32 v17, 20, v2
2180 ; GFX9-NEXT: v_lshlrev_b16_sdwa v4, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2181 ; GFX9-NEXT: v_lshrrev_b32_e32 v2, 28, v2
2182 ; GFX9-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2183 ; GFX9-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2184 ; GFX9-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2185 ; GFX9-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2186 ; GFX9-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2187 ; GFX9-NEXT: v_ashrrev_i16_e32 v13, 12, v13
2188 ; GFX9-NEXT: v_lshlrev_b16_e32 v10, 12, v10
2189 ; GFX9-NEXT: v_lshlrev_b16_e32 v1, 12, v1
2190 ; GFX9-NEXT: v_lshlrev_b16_e32 v14, 12, v14
2191 ; GFX9-NEXT: v_lshlrev_b16_e32 v15, 12, v15
2192 ; GFX9-NEXT: v_lshlrev_b16_e32 v17, 12, v17
2193 ; GFX9-NEXT: v_lshlrev_b16_e32 v2, 12, v2
2194 ; GFX9-NEXT: v_perm_b32 v7, v8, v7, s0
2195 ; GFX9-NEXT: v_perm_b32 v8, v13, v12, s0
2196 ; GFX9-NEXT: v_perm_b32 v5, v6, v5, s0
2197 ; GFX9-NEXT: v_ashrrev_i16_e32 v9, 12, v9
2198 ; GFX9-NEXT: v_ashrrev_i16_e32 v11, 12, v11
2199 ; GFX9-NEXT: v_ashrrev_i16_e32 v16, 12, v16
2200 ; GFX9-NEXT: v_ashrrev_i16_e32 v4, 12, v4
2201 ; GFX9-NEXT: v_ashrrev_i16_e32 v10, 12, v10
2202 ; GFX9-NEXT: v_ashrrev_i16_e32 v1, 12, v1
2203 ; GFX9-NEXT: v_ashrrev_i16_e32 v14, 12, v14
2204 ; GFX9-NEXT: v_ashrrev_i16_e32 v15, 12, v15
2205 ; GFX9-NEXT: v_ashrrev_i16_e32 v17, 12, v17
2206 ; GFX9-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2207 ; GFX9-NEXT: v_pk_mul_lo_u16 v5, v5, v8
2208 ; GFX9-NEXT: v_perm_b32 v2, v2, v4, s0
2209 ; GFX9-NEXT: v_perm_b32 v1, v1, v11, s0
2210 ; GFX9-NEXT: v_perm_b32 v4, v17, v16, s0
2211 ; GFX9-NEXT: v_perm_b32 v9, v10, v9, s0
2212 ; GFX9-NEXT: v_perm_b32 v10, v15, v14, s0
2213 ; GFX9-NEXT: s_waitcnt vmcnt(0)
2214 ; GFX9-NEXT: v_add_u16_e32 v3, v5, v3
2215 ; GFX9-NEXT: v_pk_mul_lo_u16 v1, v1, v2
2216 ; GFX9-NEXT: v_pk_mul_lo_u16 v2, v9, v4
2217 ; GFX9-NEXT: v_pk_mul_lo_u16 v4, v7, v10
2218 ; GFX9-NEXT: v_add_u16_sdwa v3, v3, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2219 ; GFX9-NEXT: v_add_u16_e32 v3, v3, v4
2220 ; GFX9-NEXT: v_add_u16_sdwa v3, v3, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2221 ; GFX9-NEXT: v_add_u16_e32 v3, v3, v2
2222 ; GFX9-NEXT: v_add_u16_sdwa v2, v3, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2223 ; GFX9-NEXT: v_add_u16_e32 v2, v2, v1
2224 ; GFX9-NEXT: v_add_u16_sdwa v1, v2, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2225 ; GFX9-NEXT: global_store_short v0, v1, s[2:3]
2226 ; GFX9-NEXT: s_endpgm
2228 ; GFX9-DL-LABEL: idot8_acc16_vecMul:
2229 ; GFX9-DL: ; %bb.0: ; %entry
2230 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2231 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2232 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
2233 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
2234 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
2235 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2236 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
2237 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2238 ; GFX9-DL-NEXT: v_mov_b32_e32 v4, 12
2239 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
2240 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
2241 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
2242 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
2243 ; GFX9-DL-NEXT: global_load_ushort v3, v0, s[2:3]
2244 ; GFX9-DL-NEXT: s_mov_b32 s0, 0x5040100
2245 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
2246 ; GFX9-DL-NEXT: s_waitcnt vmcnt(2)
2247 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v6, 4, v1
2248 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v7, 8, v1
2249 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v8, 12, v1
2250 ; GFX9-DL-NEXT: s_waitcnt vmcnt(1)
2251 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v13, 4, v2
2252 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v5, 12, v1
2253 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v12, 12, v2
2254 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v6, 12, v6
2255 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v7, 12, v7
2256 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2257 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2258 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v9, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2259 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v10, 20, v1
2260 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v11, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2261 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v1, 28, v1
2262 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v14, 8, v2
2263 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v15, 12, v2
2264 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v16, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2265 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v17, 20, v2
2266 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v4, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2267 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v2, 28, v2
2268 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2269 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2270 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2271 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2272 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2273 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v13, 12, v13
2274 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v10, 12, v10
2275 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v1, 12, v1
2276 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v14, 12, v14
2277 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v15, 12, v15
2278 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v17, 12, v17
2279 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v2, 12, v2
2280 ; GFX9-DL-NEXT: v_perm_b32 v7, v8, v7, s0
2281 ; GFX9-DL-NEXT: v_perm_b32 v8, v13, v12, s0
2282 ; GFX9-DL-NEXT: v_perm_b32 v5, v6, v5, s0
2283 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v9, 12, v9
2284 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v11, 12, v11
2285 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v16, 12, v16
2286 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v4, 12, v4
2287 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v10, 12, v10
2288 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v1, 12, v1
2289 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v14, 12, v14
2290 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v15, 12, v15
2291 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v17, 12, v17
2292 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2293 ; GFX9-DL-NEXT: v_pk_mul_lo_u16 v5, v5, v8
2294 ; GFX9-DL-NEXT: v_perm_b32 v2, v2, v4, s0
2295 ; GFX9-DL-NEXT: v_perm_b32 v1, v1, v11, s0
2296 ; GFX9-DL-NEXT: v_perm_b32 v4, v17, v16, s0
2297 ; GFX9-DL-NEXT: v_perm_b32 v9, v10, v9, s0
2298 ; GFX9-DL-NEXT: v_perm_b32 v10, v15, v14, s0
2299 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0)
2300 ; GFX9-DL-NEXT: v_add_u16_e32 v3, v5, v3
2301 ; GFX9-DL-NEXT: v_pk_mul_lo_u16 v1, v1, v2
2302 ; GFX9-DL-NEXT: v_pk_mul_lo_u16 v2, v9, v4
2303 ; GFX9-DL-NEXT: v_pk_mul_lo_u16 v4, v7, v10
2304 ; GFX9-DL-NEXT: v_add_u16_sdwa v3, v3, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2305 ; GFX9-DL-NEXT: v_add_u16_e32 v3, v3, v4
2306 ; GFX9-DL-NEXT: v_add_u16_sdwa v3, v3, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2307 ; GFX9-DL-NEXT: v_add_u16_e32 v3, v3, v2
2308 ; GFX9-DL-NEXT: v_add_u16_sdwa v2, v3, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2309 ; GFX9-DL-NEXT: v_add_u16_e32 v2, v2, v1
2310 ; GFX9-DL-NEXT: v_add_u16_sdwa v1, v2, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2311 ; GFX9-DL-NEXT: global_store_short v0, v1, s[2:3]
2312 ; GFX9-DL-NEXT: s_endpgm
2314 ; GFX10-DL-XNACK-LABEL: idot8_acc16_vecMul:
2315 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
2316 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2317 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2318 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2319 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2320 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2321 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
2322 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
2323 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
2324 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
2325 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
2326 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
2327 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
2328 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
2329 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v0, 0
2330 ; GFX10-DL-XNACK-NEXT: global_load_ushort v3, v0, s[0:1]
2331 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(2)
2332 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v5, 4, v1
2333 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(1)
2334 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v12, 4, v2
2335 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v4, 12, v1
2336 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v11, 12, v2
2337 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v6, 8, v1
2338 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v5
2339 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v12, 12, v12
2340 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 12, v1
2341 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v8, 16, v1
2342 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v13, 8, v2
2343 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v14, 12, v2
2344 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v4, 12, v4
2345 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v11, 12, v11
2346 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v12, 12, v12
2347 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v5, 12, v5
2348 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v6, 12, v6
2349 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v7
2350 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v8
2351 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v13, 12, v13
2352 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v14, 12, v14
2353 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v11, v12, v11, 0x5040100
2354 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v4, v5, v4, 0x5040100
2355 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v9, 20, v1
2356 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v15, 16, v2
2357 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v16, 20, v2
2358 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v6, 12, v6
2359 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v7, 12, v7
2360 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v5, 12, v8
2361 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v8, 12, v13
2362 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v12, 12, v14
2363 ; GFX10-DL-XNACK-NEXT: v_pk_mul_lo_u16 v4, v4, v11
2364 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v9
2365 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v15, 12, v15
2366 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v16, 12, v16
2367 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v8, v12, v8, 0x5040100
2368 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v6, v7, v6, 0x5040100
2369 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v4
2370 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0)
2371 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v4, v3
2372 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v10, 24, v1
2373 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v1, 28, v1
2374 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v17, 24, v2
2375 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v9, 12, v9
2376 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v11, 12, v15
2377 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v2, 28, v2
2378 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v4, 12, v16
2379 ; GFX10-DL-XNACK-NEXT: v_pk_mul_lo_u16 v6, v6, v8
2380 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v3, v7
2381 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v10
2382 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v1, 12, v1
2383 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v12, 12, v17
2384 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v2, 12, v2
2385 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v4, v4, v11, 0x5040100
2386 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v5, v9, v5, 0x5040100
2387 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v6
2388 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v3, v6
2389 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v10, 12, v10
2390 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v6, 12, v12
2391 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v2
2392 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v1, 12, v1
2393 ; GFX10-DL-XNACK-NEXT: v_pk_mul_lo_u16 v4, v5, v4
2394 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v3, v7
2395 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v2, v2, v6, 0x5040100
2396 ; GFX10-DL-XNACK-NEXT: v_perm_b32 v1, v1, v10, 0x5040100
2397 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v5, 16, v4
2398 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v3, v4
2399 ; GFX10-DL-XNACK-NEXT: v_pk_mul_lo_u16 v1, v1, v2
2400 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v2, v3, v5
2401 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v3, 16, v1
2402 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v1, v2, v1
2403 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v1, v1, v3
2404 ; GFX10-DL-XNACK-NEXT: global_store_short v0, v1, s[0:1]
2405 ; GFX10-DL-XNACK-NEXT: s_endpgm
2407 ; GFX10-DL-NOXNACK-LABEL: idot8_acc16_vecMul:
2408 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
2409 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2410 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2411 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2412 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v2, 0
2413 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2414 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2415 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
2416 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
2417 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
2418 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
2419 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
2420 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
2421 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
2422 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
2423 ; GFX10-DL-NOXNACK-NEXT: global_load_ushort v3, v2, s[0:1]
2424 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(2)
2425 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v5, 4, v1
2426 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(1)
2427 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v12, 4, v0
2428 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v4, 12, v1
2429 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v11, 12, v0
2430 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v6, 8, v1
2431 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v5
2432 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v12, 12, v12
2433 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 12, v1
2434 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v8, 16, v1
2435 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v13, 8, v0
2436 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v14, 12, v0
2437 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v4, 12, v4
2438 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v11, 12, v11
2439 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v12, 12, v12
2440 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v5, 12, v5
2441 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v6, 12, v6
2442 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v7
2443 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v8
2444 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v13, 12, v13
2445 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v14, 12, v14
2446 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v11, v12, v11, 0x5040100
2447 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v4, v5, v4, 0x5040100
2448 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v9, 20, v1
2449 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v15, 16, v0
2450 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v16, 20, v0
2451 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v6, 12, v6
2452 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v7, 12, v7
2453 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v5, 12, v8
2454 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v8, 12, v13
2455 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v12, 12, v14
2456 ; GFX10-DL-NOXNACK-NEXT: v_pk_mul_lo_u16 v4, v4, v11
2457 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v9
2458 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v15, 12, v15
2459 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v16, 12, v16
2460 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v8, v12, v8, 0x5040100
2461 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v6, v7, v6, 0x5040100
2462 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v4
2463 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0)
2464 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v3, v4, v3
2465 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v10, 24, v1
2466 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v1, 28, v1
2467 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v17, 24, v0
2468 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v9, 12, v9
2469 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v11, 12, v15
2470 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v0, 28, v0
2471 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v4, 12, v16
2472 ; GFX10-DL-NOXNACK-NEXT: v_pk_mul_lo_u16 v6, v6, v8
2473 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v3, v3, v7
2474 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v10
2475 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v1, 12, v1
2476 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v12, 12, v17
2477 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v0, 12, v0
2478 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v4, v4, v11, 0x5040100
2479 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v5, v9, v5, 0x5040100
2480 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 16, v6
2481 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v3, v3, v6
2482 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v10, 12, v10
2483 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v6, 12, v12
2484 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v0, 12, v0
2485 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v1
2486 ; GFX10-DL-NOXNACK-NEXT: v_pk_mul_lo_u16 v4, v5, v4
2487 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v3, v3, v7
2488 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v0, v0, v6, 0x5040100
2489 ; GFX10-DL-NOXNACK-NEXT: v_perm_b32 v1, v1, v10, 0x5040100
2490 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v5, 16, v4
2491 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v3, v3, v4
2492 ; GFX10-DL-NOXNACK-NEXT: v_pk_mul_lo_u16 v0, v1, v0
2493 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v1, v3, v5
2494 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v3, 16, v0
2495 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v1, v0
2496 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v0, v3
2497 ; GFX10-DL-NOXNACK-NEXT: global_store_short v2, v0, s[0:1]
2498 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
2499 ptr addrspace(1) %src2,
2500 ptr addrspace(1) nocapture %dst) {
2502 %idx = call i32 @llvm.amdgcn.workitem.id.x()
2503 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
2504 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
2505 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
2506 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
2508 %cvec1 = sext <8 x i4> %vec1 to <8 x i16>
2509 %cvec2 = sext <8 x i4> %vec2 to <8 x i16>
2511 %mul = mul <8 x i16> %cvec1, %cvec2
2512 %mul0 = extractelement <8 x i16> %mul, i64 0
2513 %mul1 = extractelement <8 x i16> %mul, i64 1
2514 %mul2 = extractelement <8 x i16> %mul, i64 2
2515 %mul3 = extractelement <8 x i16> %mul, i64 3
2516 %mul4 = extractelement <8 x i16> %mul, i64 4
2517 %mul5 = extractelement <8 x i16> %mul, i64 5
2518 %mul6 = extractelement <8 x i16> %mul, i64 6
2519 %mul7 = extractelement <8 x i16> %mul, i64 7
2521 %acc = load i16, ptr addrspace(1) %dst, align 4
2522 %add1 = add i16 %mul0, %acc
2523 %add2 = add i16 %add1, %mul1
2524 %add3 = add i16 %add2, %mul2
2525 %add4 = add i16 %add3, %mul3
2526 %add5 = add i16 %add4, %mul4
2527 %add6 = add i16 %add5, %mul5
2528 %add7 = add i16 %add6, %mul6
2529 %add8 = add i16 %add7, %mul7
2531 store i16 %add8, ptr addrspace(1) %dst, align 4
2535 ; TODO: Support this pattern.
2536 define amdgpu_kernel void @idot8_acc8_vecMul(ptr addrspace(1) %src1,
2537 ; GFX7-LABEL: idot8_acc8_vecMul:
2538 ; GFX7: ; %bb.0: ; %entry
2539 ; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
2540 ; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
2541 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
2542 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
2543 ; GFX7-NEXT: s_mov_b32 s14, -1
2544 ; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
2545 ; GFX7-NEXT: s_add_u32 s12, s12, s3
2546 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2547 ; GFX7-NEXT: s_mov_b32 s10, 0
2548 ; GFX7-NEXT: s_mov_b32 s11, s3
2549 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2550 ; GFX7-NEXT: s_mov_b64 s[8:9], s[4:5]
2551 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2552 ; GFX7-NEXT: v_mov_b32_e32 v1, 0
2553 ; GFX7-NEXT: buffer_load_dword v2, v[0:1], s[8:11], 0 addr64
2554 ; GFX7-NEXT: s_mov_b64 s[8:9], s[6:7]
2555 ; GFX7-NEXT: buffer_load_dword v0, v[0:1], s[8:11], 0 addr64
2556 ; GFX7-NEXT: s_mov_b32 s2, -1
2557 ; GFX7-NEXT: buffer_load_ubyte v1, off, s[0:3], 0
2558 ; GFX7-NEXT: s_addc_u32 s13, s13, 0
2559 ; GFX7-NEXT: s_waitcnt vmcnt(2)
2560 ; GFX7-NEXT: v_bfe_i32 v7, v2, 0, 4
2561 ; GFX7-NEXT: v_bfe_i32 v3, v2, 24, 4
2562 ; GFX7-NEXT: s_waitcnt vmcnt(1)
2563 ; GFX7-NEXT: v_bfe_i32 v14, v0, 0, 4
2564 ; GFX7-NEXT: v_bfe_i32 v4, v2, 20, 4
2565 ; GFX7-NEXT: v_bfe_i32 v5, v2, 16, 4
2566 ; GFX7-NEXT: v_bfe_i32 v6, v2, 8, 4
2567 ; GFX7-NEXT: v_ashrrev_i32_e32 v8, 28, v2
2568 ; GFX7-NEXT: v_bfe_i32 v9, v2, 12, 4
2569 ; GFX7-NEXT: v_bfe_i32 v2, v2, 4, 4
2570 ; GFX7-NEXT: v_and_b32_e32 v7, 0xff, v7
2571 ; GFX7-NEXT: v_bfe_i32 v10, v0, 24, 4
2572 ; GFX7-NEXT: v_bfe_i32 v11, v0, 20, 4
2573 ; GFX7-NEXT: v_bfe_i32 v12, v0, 16, 4
2574 ; GFX7-NEXT: v_bfe_i32 v13, v0, 8, 4
2575 ; GFX7-NEXT: v_ashrrev_i32_e32 v15, 28, v0
2576 ; GFX7-NEXT: v_bfe_i32 v16, v0, 12, 4
2577 ; GFX7-NEXT: v_bfe_i32 v0, v0, 4, 4
2578 ; GFX7-NEXT: v_and_b32_e32 v14, 0xff, v14
2579 ; GFX7-NEXT: v_and_b32_e32 v2, 0xff, v2
2580 ; GFX7-NEXT: v_and_b32_e32 v0, 0xff, v0
2581 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2582 ; GFX7-NEXT: v_mad_u32_u24 v1, v7, v14, v1
2583 ; GFX7-NEXT: v_and_b32_e32 v6, 0xff, v6
2584 ; GFX7-NEXT: v_and_b32_e32 v13, 0xff, v13
2585 ; GFX7-NEXT: v_mad_u32_u24 v0, v2, v0, v1
2586 ; GFX7-NEXT: v_and_b32_e32 v9, 0xff, v9
2587 ; GFX7-NEXT: v_and_b32_e32 v16, 0xff, v16
2588 ; GFX7-NEXT: v_mad_u32_u24 v0, v6, v13, v0
2589 ; GFX7-NEXT: v_and_b32_e32 v5, 0xff, v5
2590 ; GFX7-NEXT: v_and_b32_e32 v12, 0xff, v12
2591 ; GFX7-NEXT: v_mad_u32_u24 v0, v9, v16, v0
2592 ; GFX7-NEXT: v_and_b32_e32 v4, 0xff, v4
2593 ; GFX7-NEXT: v_and_b32_e32 v11, 0xff, v11
2594 ; GFX7-NEXT: v_mad_u32_u24 v0, v5, v12, v0
2595 ; GFX7-NEXT: v_and_b32_e32 v3, 0xff, v3
2596 ; GFX7-NEXT: v_and_b32_e32 v10, 0xff, v10
2597 ; GFX7-NEXT: v_mad_u32_u24 v0, v4, v11, v0
2598 ; GFX7-NEXT: v_and_b32_e32 v8, 0xff, v8
2599 ; GFX7-NEXT: v_and_b32_e32 v15, 0xff, v15
2600 ; GFX7-NEXT: v_mad_u32_u24 v0, v3, v10, v0
2601 ; GFX7-NEXT: v_mad_u32_u24 v0, v8, v15, v0
2602 ; GFX7-NEXT: buffer_store_byte v0, off, s[0:3], 0
2603 ; GFX7-NEXT: s_endpgm
2605 ; GFX8-LABEL: idot8_acc8_vecMul:
2606 ; GFX8: ; %bb.0: ; %entry
2607 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2608 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2609 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 2, v0
2610 ; GFX8-NEXT: v_mov_b32_e32 v5, 12
2611 ; GFX8-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2612 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2613 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
2614 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s4, v2
2615 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
2616 ; GFX8-NEXT: flat_load_dword v3, v[0:1]
2617 ; GFX8-NEXT: v_mov_b32_e32 v1, s7
2618 ; GFX8-NEXT: v_add_u32_e32 v0, vcc, s6, v2
2619 ; GFX8-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
2620 ; GFX8-NEXT: flat_load_dword v2, v[0:1]
2621 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2622 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2623 ; GFX8-NEXT: flat_load_ubyte v4, v[0:1]
2624 ; GFX8-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2625 ; GFX8-NEXT: s_mov_b32 s10, -1
2626 ; GFX8-NEXT: s_mov_b32 s11, 0xe80000
2627 ; GFX8-NEXT: s_add_u32 s8, s8, s3
2628 ; GFX8-NEXT: s_addc_u32 s9, s9, 0
2629 ; GFX8-NEXT: s_waitcnt vmcnt(2)
2630 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, 20, v3
2631 ; GFX8-NEXT: v_lshrrev_b32_e32 v7, 28, v3
2632 ; GFX8-NEXT: v_lshrrev_b32_e32 v8, 12, v3
2633 ; GFX8-NEXT: v_lshrrev_b32_e32 v9, 8, v3
2634 ; GFX8-NEXT: v_lshrrev_b32_e32 v10, 4, v3
2635 ; GFX8-NEXT: v_lshlrev_b16_e32 v16, 12, v3
2636 ; GFX8-NEXT: s_waitcnt vmcnt(1)
2637 ; GFX8-NEXT: v_lshrrev_b32_e32 v11, 20, v2
2638 ; GFX8-NEXT: v_lshrrev_b32_e32 v12, 28, v2
2639 ; GFX8-NEXT: v_lshrrev_b32_e32 v13, 12, v2
2640 ; GFX8-NEXT: v_lshrrev_b32_e32 v14, 8, v2
2641 ; GFX8-NEXT: v_lshrrev_b32_e32 v15, 4, v2
2642 ; GFX8-NEXT: v_lshlrev_b16_sdwa v17, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2643 ; GFX8-NEXT: v_lshlrev_b16_sdwa v3, v5, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2644 ; GFX8-NEXT: v_lshlrev_b16_e32 v18, 12, v2
2645 ; GFX8-NEXT: v_lshlrev_b16_sdwa v19, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2646 ; GFX8-NEXT: v_lshlrev_b16_sdwa v2, v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2647 ; GFX8-NEXT: v_lshlrev_b16_e32 v5, 12, v10
2648 ; GFX8-NEXT: v_ashrrev_i16_e32 v10, 12, v16
2649 ; GFX8-NEXT: v_ashrrev_i16_e32 v16, 12, v17
2650 ; GFX8-NEXT: v_lshlrev_b16_e32 v7, 12, v7
2651 ; GFX8-NEXT: v_ashrrev_i16_e32 v17, 12, v3
2652 ; GFX8-NEXT: v_lshlrev_b16_e32 v3, 12, v6
2653 ; GFX8-NEXT: v_lshlrev_b16_e32 v6, 12, v15
2654 ; GFX8-NEXT: v_ashrrev_i16_e32 v15, 12, v18
2655 ; GFX8-NEXT: v_ashrrev_i16_e32 v18, 12, v19
2656 ; GFX8-NEXT: v_lshlrev_b16_e32 v12, 12, v12
2657 ; GFX8-NEXT: v_ashrrev_i16_e32 v19, 12, v2
2658 ; GFX8-NEXT: v_lshlrev_b16_e32 v2, 12, v11
2659 ; GFX8-NEXT: v_lshlrev_b16_e32 v9, 12, v9
2660 ; GFX8-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2661 ; GFX8-NEXT: v_lshlrev_b16_e32 v14, 12, v14
2662 ; GFX8-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2663 ; GFX8-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2664 ; GFX8-NEXT: v_ashrrev_i16_e32 v3, 12, v3
2665 ; GFX8-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2666 ; GFX8-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2667 ; GFX8-NEXT: v_ashrrev_i16_e32 v9, 12, v9
2668 ; GFX8-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2669 ; GFX8-NEXT: v_ashrrev_i16_e32 v11, 12, v14
2670 ; GFX8-NEXT: v_ashrrev_i16_e32 v13, 12, v13
2671 ; GFX8-NEXT: v_mul_lo_u16_e32 v20, v16, v18
2672 ; GFX8-NEXT: v_mul_lo_u16_sdwa v2, v3, v2 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2673 ; GFX8-NEXT: v_mul_lo_u16_sdwa v3, v7, v12 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2674 ; GFX8-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2675 ; GFX8-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2676 ; GFX8-NEXT: v_mul_lo_u16_e32 v14, v17, v19
2677 ; GFX8-NEXT: v_mul_lo_u16_sdwa v7, v8, v13 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2678 ; GFX8-NEXT: v_mul_lo_u16_e32 v8, v9, v11
2679 ; GFX8-NEXT: v_or_b32_sdwa v3, v20, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2680 ; GFX8-NEXT: v_mul_lo_u16_e32 v10, v10, v15
2681 ; GFX8-NEXT: v_mul_lo_u16_sdwa v5, v5, v6 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2682 ; GFX8-NEXT: v_or_b32_sdwa v6, v14, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2683 ; GFX8-NEXT: v_or_b32_sdwa v7, v8, v7 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2684 ; GFX8-NEXT: v_lshlrev_b32_e32 v9, 16, v3
2685 ; GFX8-NEXT: v_or_b32_sdwa v8, v10, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2686 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v7
2687 ; GFX8-NEXT: v_lshrrev_b32_e32 v10, 8, v3
2688 ; GFX8-NEXT: v_or_b32_sdwa v3, v6, v9 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
2689 ; GFX8-NEXT: v_or_b32_e32 v5, v5, v2
2690 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, 8, v3
2691 ; GFX8-NEXT: v_lshrrev_b64 v[2:3], 24, v[2:3]
2692 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 8, v5
2693 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2694 ; GFX8-NEXT: v_add_u16_e32 v3, v8, v4
2695 ; GFX8-NEXT: v_add_u16_e32 v3, v3, v5
2696 ; GFX8-NEXT: v_add_u16_e32 v3, v3, v7
2697 ; GFX8-NEXT: v_add_u16_e32 v2, v3, v2
2698 ; GFX8-NEXT: v_mad_u16 v2, v17, v19, v2
2699 ; GFX8-NEXT: v_add_u16_e32 v2, v2, v6
2700 ; GFX8-NEXT: v_mad_u16 v2, v16, v18, v2
2701 ; GFX8-NEXT: v_add_u16_e32 v2, v2, v10
2702 ; GFX8-NEXT: flat_store_byte v[0:1], v2
2703 ; GFX8-NEXT: s_endpgm
2705 ; GFX9-LABEL: idot8_acc8_vecMul:
2706 ; GFX9: ; %bb.0: ; %entry
2707 ; GFX9-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2708 ; GFX9-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2709 ; GFX9-NEXT: s_mov_b32 s10, -1
2710 ; GFX9-NEXT: s_mov_b32 s11, 0xe00000
2711 ; GFX9-NEXT: s_add_u32 s8, s8, s3
2712 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2713 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
2714 ; GFX9-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2715 ; GFX9-NEXT: v_mov_b32_e32 v4, 12
2716 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2717 ; GFX9-NEXT: global_load_dword v1, v0, s[4:5]
2718 ; GFX9-NEXT: global_load_dword v2, v0, s[6:7]
2719 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
2720 ; GFX9-NEXT: global_load_ubyte v3, v0, s[2:3]
2721 ; GFX9-NEXT: s_addc_u32 s9, s9, 0
2722 ; GFX9-NEXT: s_waitcnt vmcnt(2)
2723 ; GFX9-NEXT: v_lshrrev_b32_e32 v5, 20, v1
2724 ; GFX9-NEXT: v_lshrrev_b32_e32 v6, 28, v1
2725 ; GFX9-NEXT: v_lshrrev_b32_e32 v7, 12, v1
2726 ; GFX9-NEXT: v_lshrrev_b32_e32 v8, 8, v1
2727 ; GFX9-NEXT: v_lshrrev_b32_e32 v9, 4, v1
2728 ; GFX9-NEXT: s_waitcnt vmcnt(1)
2729 ; GFX9-NEXT: v_lshrrev_b32_e32 v10, 20, v2
2730 ; GFX9-NEXT: v_lshrrev_b32_e32 v11, 28, v2
2731 ; GFX9-NEXT: v_lshrrev_b32_e32 v12, 12, v2
2732 ; GFX9-NEXT: v_lshrrev_b32_e32 v13, 8, v2
2733 ; GFX9-NEXT: v_lshrrev_b32_e32 v14, 4, v2
2734 ; GFX9-NEXT: v_lshlrev_b16_e32 v15, 12, v1
2735 ; GFX9-NEXT: v_lshlrev_b16_sdwa v16, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2736 ; GFX9-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2737 ; GFX9-NEXT: v_lshlrev_b16_e32 v17, 12, v2
2738 ; GFX9-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2739 ; GFX9-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2740 ; GFX9-NEXT: v_lshlrev_b16_e32 v4, 12, v9
2741 ; GFX9-NEXT: v_ashrrev_i16_e32 v9, 12, v15
2742 ; GFX9-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2743 ; GFX9-NEXT: v_lshlrev_b16_e32 v7, 12, v7
2744 ; GFX9-NEXT: v_ashrrev_i16_e32 v15, 12, v16
2745 ; GFX9-NEXT: v_lshlrev_b16_e32 v6, 12, v6
2746 ; GFX9-NEXT: v_ashrrev_i16_e32 v16, 12, v1
2747 ; GFX9-NEXT: v_lshlrev_b16_e32 v1, 12, v5
2748 ; GFX9-NEXT: v_lshlrev_b16_e32 v5, 12, v14
2749 ; GFX9-NEXT: v_ashrrev_i16_e32 v14, 12, v17
2750 ; GFX9-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2751 ; GFX9-NEXT: v_lshlrev_b16_e32 v12, 12, v12
2752 ; GFX9-NEXT: v_ashrrev_i16_e32 v17, 12, v18
2753 ; GFX9-NEXT: v_lshlrev_b16_e32 v11, 12, v11
2754 ; GFX9-NEXT: v_ashrrev_i16_e32 v18, 12, v2
2755 ; GFX9-NEXT: v_lshlrev_b16_e32 v2, 12, v10
2756 ; GFX9-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2757 ; GFX9-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2758 ; GFX9-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2759 ; GFX9-NEXT: v_ashrrev_i16_e32 v1, 12, v1
2760 ; GFX9-NEXT: v_ashrrev_i16_e32 v10, 12, v13
2761 ; GFX9-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2762 ; GFX9-NEXT: v_ashrrev_i16_e32 v11, 12, v11
2763 ; GFX9-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2764 ; GFX9-NEXT: v_ashrrev_i16_e32 v4, 12, v4
2765 ; GFX9-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2766 ; GFX9-NEXT: v_mul_lo_u16_e32 v13, v16, v18
2767 ; GFX9-NEXT: v_mul_lo_u16_e32 v19, v15, v17
2768 ; GFX9-NEXT: v_mul_lo_u16_sdwa v1, v1, v2 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2769 ; GFX9-NEXT: v_mul_lo_u16_sdwa v2, v6, v11 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2770 ; GFX9-NEXT: v_mul_lo_u16_sdwa v6, v7, v12 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2771 ; GFX9-NEXT: v_mul_lo_u16_e32 v7, v8, v10
2772 ; GFX9-NEXT: v_mul_lo_u16_sdwa v4, v4, v5 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2773 ; GFX9-NEXT: v_or_b32_sdwa v1, v13, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2774 ; GFX9-NEXT: v_or_b32_sdwa v5, v19, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2775 ; GFX9-NEXT: v_or_b32_sdwa v6, v7, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2776 ; GFX9-NEXT: v_mul_lo_u16_e32 v9, v9, v14
2777 ; GFX9-NEXT: v_lshrrev_b32_e32 v8, 8, v2
2778 ; GFX9-NEXT: v_or_b32_sdwa v2, v1, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
2779 ; GFX9-NEXT: v_lshlrev_b32_e32 v1, 16, v6
2780 ; GFX9-NEXT: v_or_b32_sdwa v7, v9, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2781 ; GFX9-NEXT: v_lshrrev_b32_e32 v5, 8, v2
2782 ; GFX9-NEXT: v_or_b32_e32 v4, v4, v1
2783 ; GFX9-NEXT: v_lshrrev_b64 v[1:2], 24, v[1:2]
2784 ; GFX9-NEXT: v_lshrrev_b32_e32 v2, 8, v4
2785 ; GFX9-NEXT: s_waitcnt vmcnt(0)
2786 ; GFX9-NEXT: v_add_u16_e32 v3, v7, v3
2787 ; GFX9-NEXT: v_add_u16_e32 v2, v3, v2
2788 ; GFX9-NEXT: v_add_u16_e32 v2, v2, v6
2789 ; GFX9-NEXT: v_add_u16_e32 v1, v2, v1
2790 ; GFX9-NEXT: v_mad_legacy_u16 v1, v16, v18, v1
2791 ; GFX9-NEXT: v_add_u16_e32 v1, v1, v5
2792 ; GFX9-NEXT: v_mad_legacy_u16 v1, v15, v17, v1
2793 ; GFX9-NEXT: v_add_u16_e32 v1, v1, v8
2794 ; GFX9-NEXT: global_store_byte v0, v1, s[2:3]
2795 ; GFX9-NEXT: s_endpgm
2797 ; GFX9-DL-LABEL: idot8_acc8_vecMul:
2798 ; GFX9-DL: ; %bb.0: ; %entry
2799 ; GFX9-DL-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2800 ; GFX9-DL-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2801 ; GFX9-DL-NEXT: s_mov_b32 s10, -1
2802 ; GFX9-DL-NEXT: s_mov_b32 s11, 0xe00000
2803 ; GFX9-DL-NEXT: s_add_u32 s8, s8, s3
2804 ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2805 ; GFX9-DL-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
2806 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2807 ; GFX9-DL-NEXT: v_mov_b32_e32 v4, 12
2808 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0)
2809 ; GFX9-DL-NEXT: global_load_dword v1, v0, s[4:5]
2810 ; GFX9-DL-NEXT: global_load_dword v2, v0, s[6:7]
2811 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, 0
2812 ; GFX9-DL-NEXT: global_load_ubyte v3, v0, s[2:3]
2813 ; GFX9-DL-NEXT: s_addc_u32 s9, s9, 0
2814 ; GFX9-DL-NEXT: s_waitcnt vmcnt(2)
2815 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v5, 20, v1
2816 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v6, 28, v1
2817 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v7, 12, v1
2818 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v8, 8, v1
2819 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v9, 4, v1
2820 ; GFX9-DL-NEXT: s_waitcnt vmcnt(1)
2821 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v10, 20, v2
2822 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v11, 28, v2
2823 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v12, 12, v2
2824 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v13, 8, v2
2825 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v14, 4, v2
2826 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v15, 12, v1
2827 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v16, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2828 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v1, v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2829 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v17, 12, v2
2830 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v18, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_3
2831 ; GFX9-DL-NEXT: v_lshlrev_b16_sdwa v2, v4, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
2832 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v4, 12, v9
2833 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v9, 12, v15
2834 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v8, 12, v8
2835 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v7, 12, v7
2836 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v15, 12, v16
2837 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v6, 12, v6
2838 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v16, 12, v1
2839 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v1, 12, v5
2840 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v5, 12, v14
2841 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v14, 12, v17
2842 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v13, 12, v13
2843 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v12, 12, v12
2844 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v17, 12, v18
2845 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v11, 12, v11
2846 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v18, 12, v2
2847 ; GFX9-DL-NEXT: v_lshlrev_b16_e32 v2, 12, v10
2848 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v8, 12, v8
2849 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v7, 12, v7
2850 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v6, 12, v6
2851 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v1, 12, v1
2852 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v10, 12, v13
2853 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v12, 12, v12
2854 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v11, 12, v11
2855 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v2, 12, v2
2856 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v4, 12, v4
2857 ; GFX9-DL-NEXT: v_ashrrev_i16_e32 v5, 12, v5
2858 ; GFX9-DL-NEXT: v_mul_lo_u16_e32 v13, v16, v18
2859 ; GFX9-DL-NEXT: v_mul_lo_u16_e32 v19, v15, v17
2860 ; GFX9-DL-NEXT: v_mul_lo_u16_sdwa v1, v1, v2 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2861 ; GFX9-DL-NEXT: v_mul_lo_u16_sdwa v2, v6, v11 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2862 ; GFX9-DL-NEXT: v_mul_lo_u16_sdwa v6, v7, v12 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2863 ; GFX9-DL-NEXT: v_mul_lo_u16_e32 v7, v8, v10
2864 ; GFX9-DL-NEXT: v_mul_lo_u16_sdwa v4, v4, v5 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
2865 ; GFX9-DL-NEXT: v_or_b32_sdwa v1, v13, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2866 ; GFX9-DL-NEXT: v_or_b32_sdwa v5, v19, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2867 ; GFX9-DL-NEXT: v_or_b32_sdwa v6, v7, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2868 ; GFX9-DL-NEXT: v_mul_lo_u16_e32 v9, v9, v14
2869 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v8, 8, v2
2870 ; GFX9-DL-NEXT: v_or_b32_sdwa v2, v1, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
2871 ; GFX9-DL-NEXT: v_lshlrev_b32_e32 v1, 16, v6
2872 ; GFX9-DL-NEXT: v_or_b32_sdwa v7, v9, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2873 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v5, 8, v2
2874 ; GFX9-DL-NEXT: v_or_b32_e32 v4, v4, v1
2875 ; GFX9-DL-NEXT: v_lshrrev_b64 v[1:2], 24, v[1:2]
2876 ; GFX9-DL-NEXT: v_lshrrev_b32_e32 v2, 8, v4
2877 ; GFX9-DL-NEXT: s_waitcnt vmcnt(0)
2878 ; GFX9-DL-NEXT: v_add_u16_e32 v3, v7, v3
2879 ; GFX9-DL-NEXT: v_add_u16_e32 v2, v3, v2
2880 ; GFX9-DL-NEXT: v_add_u16_e32 v2, v2, v6
2881 ; GFX9-DL-NEXT: v_add_u16_e32 v1, v2, v1
2882 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v16, v18, v1
2883 ; GFX9-DL-NEXT: v_add_u16_e32 v1, v1, v5
2884 ; GFX9-DL-NEXT: v_mad_legacy_u16 v1, v15, v17, v1
2885 ; GFX9-DL-NEXT: v_add_u16_e32 v1, v1, v8
2886 ; GFX9-DL-NEXT: global_store_byte v0, v1, s[2:3]
2887 ; GFX9-DL-NEXT: s_endpgm
2889 ; GFX10-DL-XNACK-LABEL: idot8_acc8_vecMul:
2890 ; GFX10-DL-XNACK: ; %bb.0: ; %entry
2891 ; GFX10-DL-XNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2892 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2893 ; GFX10-DL-XNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2894 ; GFX10-DL-XNACK-NEXT: v_mov_b32_e32 v4, 0
2895 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2896 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2897 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s10, -1
2898 ; GFX10-DL-XNACK-NEXT: s_mov_b32 s11, 0x31c16000
2899 ; GFX10-DL-XNACK-NEXT: s_add_u32 s8, s8, s3
2900 ; GFX10-DL-XNACK-NEXT: s_addc_u32 s9, s9, 0
2901 ; GFX10-DL-XNACK-NEXT: s_waitcnt lgkmcnt(0)
2902 ; GFX10-DL-XNACK-NEXT: s_clause 0x1
2903 ; GFX10-DL-XNACK-NEXT: global_load_dword v1, v0, s[4:5]
2904 ; GFX10-DL-XNACK-NEXT: global_load_dword v2, v0, s[6:7]
2905 ; GFX10-DL-XNACK-NEXT: global_load_ubyte v3, v4, s[0:1]
2906 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(2)
2907 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
2908 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(1)
2909 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v2
2910 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
2911 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v16, 8, v2
2912 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
2913 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 12, v8
2914 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v15, 12, v15
2915 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v17, 4, v2
2916 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 12, v9
2917 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v16, 12, v16
2918 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v8, 12, v8
2919 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v15, 12, v15
2920 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v0, 20, v1
2921 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v6, 28, v1
2922 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v11, 20, v2
2923 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v13, 28, v2
2924 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v10, 12, v10
2925 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v17, 12, v17
2926 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v9, 12, v9
2927 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v16, 12, v16
2928 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v8, v8, v15
2929 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v5, 16, v1
2930 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v7, 24, v1
2931 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v12, 16, v2
2932 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v14, 24, v2
2933 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v1, 12, v1
2934 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v2, 12, v2
2935 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v6, 12, v6
2936 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v0, 12, v0
2937 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v13, 12, v13
2938 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v11, 12, v11
2939 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v10, 12, v10
2940 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v15, 12, v17
2941 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v9, v9, v16
2942 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v8, 8, v8
2943 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v1, 12, v1
2944 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v7, 12, v7
2945 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v5, 12, v5
2946 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v2, 12, v2
2947 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v14, 12, v14
2948 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v12, 12, v12
2949 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v6, 12, v6
2950 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v0, 12, v0
2951 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v13, 12, v13
2952 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v11, 12, v11
2953 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v10, v10, v15
2954 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v8, v9, v8 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2955 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v7, 12, v7
2956 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v5, 12, v5
2957 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v14, 12, v14
2958 ; GFX10-DL-XNACK-NEXT: v_ashrrev_i16 v12, 12, v12
2959 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v1, v1, v2
2960 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v2, v0, v11
2961 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v6, v6, v13
2962 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v9, 8, v10
2963 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b32_e32 v0, 16, v8
2964 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v10, v5, v12
2965 ; GFX10-DL-XNACK-NEXT: v_mul_lo_u16 v11, v7, v14
2966 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v2, 8, v2
2967 ; GFX10-DL-XNACK-NEXT: v_lshlrev_b16 v6, 8, v6
2968 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v13, v9, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
2969 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v1, v1, v9 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2970 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v2, v10, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2971 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v9, v11, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
2972 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v10, 8, v13
2973 ; GFX10-DL-XNACK-NEXT: s_waitcnt vmcnt(0)
2974 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v3, v1, v3
2975 ; GFX10-DL-XNACK-NEXT: v_or_b32_sdwa v1, v2, v9 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
2976 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v9, v3, v10
2977 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b64 v[2:3], 24, v[0:1]
2978 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v1, 8, v1
2979 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v0, v9, v8
2980 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v0, v0, v2
2981 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v0, v5, v12, v0
2982 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v0, v0, v1
2983 ; GFX10-DL-XNACK-NEXT: v_lshrrev_b32_e32 v1, 8, v6
2984 ; GFX10-DL-XNACK-NEXT: v_mad_u16 v0, v7, v14, v0
2985 ; GFX10-DL-XNACK-NEXT: v_add_nc_u16 v0, v0, v1
2986 ; GFX10-DL-XNACK-NEXT: global_store_byte v4, v0, s[0:1]
2987 ; GFX10-DL-XNACK-NEXT: s_endpgm
2989 ; GFX10-DL-NOXNACK-LABEL: idot8_acc8_vecMul:
2990 ; GFX10-DL-NOXNACK: ; %bb.0: ; %entry
2991 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
2992 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
2993 ; GFX10-DL-NOXNACK-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
2994 ; GFX10-DL-NOXNACK-NEXT: v_mov_b32_e32 v4, 0
2995 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s8, SCRATCH_RSRC_DWORD0
2996 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s9, SCRATCH_RSRC_DWORD1
2997 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s10, -1
2998 ; GFX10-DL-NOXNACK-NEXT: s_mov_b32 s11, 0x31c16000
2999 ; GFX10-DL-NOXNACK-NEXT: s_add_u32 s8, s8, s3
3000 ; GFX10-DL-NOXNACK-NEXT: s_addc_u32 s9, s9, 0
3001 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt lgkmcnt(0)
3002 ; GFX10-DL-NOXNACK-NEXT: s_clause 0x1
3003 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v1, v0, s[4:5]
3004 ; GFX10-DL-NOXNACK-NEXT: global_load_dword v0, v0, s[6:7]
3005 ; GFX10-DL-NOXNACK-NEXT: global_load_ubyte v2, v4, s[0:1]
3006 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(2)
3007 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v8, 12, v1
3008 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(1)
3009 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v15, 12, v0
3010 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v9, 8, v1
3011 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v16, 8, v0
3012 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v10, 4, v1
3013 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 12, v8
3014 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v15, 12, v15
3015 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v17, 4, v0
3016 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 12, v9
3017 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v16, 12, v16
3018 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v8, 12, v8
3019 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v15, 12, v15
3020 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v3, 20, v1
3021 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v6, 28, v1
3022 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v11, 20, v0
3023 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v13, 28, v0
3024 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v10, 12, v10
3025 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v17, 12, v17
3026 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v9, 12, v9
3027 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v16, 12, v16
3028 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v8, v8, v15
3029 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v5, 16, v1
3030 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v7, 24, v1
3031 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v12, 16, v0
3032 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v14, 24, v0
3033 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v6, 12, v6
3034 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v3, 12, v3
3035 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v13, 12, v13
3036 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v11, 12, v11
3037 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v1, 12, v1
3038 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v0, 12, v0
3039 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v10, 12, v10
3040 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v15, 12, v17
3041 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v9, v9, v16
3042 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v8, 8, v8
3043 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v7, 12, v7
3044 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v5, 12, v5
3045 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v14, 12, v14
3046 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v12, 12, v12
3047 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v6, 12, v6
3048 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v3, 12, v3
3049 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v13, 12, v13
3050 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v11, 12, v11
3051 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v1, 12, v1
3052 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v0, 12, v0
3053 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v10, v10, v15
3054 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v8, v9, v8 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
3055 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v7, 12, v7
3056 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v5, 12, v5
3057 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v14, 12, v14
3058 ; GFX10-DL-NOXNACK-NEXT: v_ashrrev_i16 v12, 12, v12
3059 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v3, v3, v11
3060 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v6, v6, v13
3061 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v1, v1, v0
3062 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v9, 8, v10
3063 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b32_e32 v0, 16, v8
3064 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v10, v5, v12
3065 ; GFX10-DL-NOXNACK-NEXT: v_mul_lo_u16 v11, v7, v14
3066 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v3, 8, v3
3067 ; GFX10-DL-NOXNACK-NEXT: v_lshlrev_b16 v6, 8, v6
3068 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v13, v9, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
3069 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v1, v1, v9 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
3070 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v3, v10, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
3071 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v9, v11, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD
3072 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v10, 8, v13
3073 ; GFX10-DL-NOXNACK-NEXT: s_waitcnt vmcnt(0)
3074 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v2, v1, v2
3075 ; GFX10-DL-NOXNACK-NEXT: v_or_b32_sdwa v1, v3, v9 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
3076 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v9, v2, v10
3077 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b64 v[2:3], 24, v[0:1]
3078 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v1, 8, v1
3079 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v9, v8
3080 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v0, v2
3081 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v5, v12, v0
3082 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v0, v1
3083 ; GFX10-DL-NOXNACK-NEXT: v_lshrrev_b32_e32 v1, 8, v6
3084 ; GFX10-DL-NOXNACK-NEXT: v_mad_u16 v0, v7, v14, v0
3085 ; GFX10-DL-NOXNACK-NEXT: v_add_nc_u16 v0, v0, v1
3086 ; GFX10-DL-NOXNACK-NEXT: global_store_byte v4, v0, s[0:1]
3087 ; GFX10-DL-NOXNACK-NEXT: s_endpgm
3088 ptr addrspace(1) %src2,
3089 ptr addrspace(1) nocapture %dst) {
3091 %idx = call i32 @llvm.amdgcn.workitem.id.x()
3092 %gep1 = getelementptr <8 x i4>, ptr addrspace(1) %src1, i32 %idx
3093 %vec1 = load <8 x i4>, ptr addrspace(1) %gep1
3094 %gep2 = getelementptr <8 x i4>, ptr addrspace(1) %src2, i32 %idx
3095 %vec2 = load <8 x i4>, ptr addrspace(1) %gep2
3097 %cvec1 = sext <8 x i4> %vec1 to <8 x i8>
3098 %cvec2 = sext <8 x i4> %vec2 to <8 x i8>
3100 %mul = mul <8 x i8> %cvec1, %cvec2
3101 %mul0 = extractelement <8 x i8> %mul, i64 0
3102 %mul1 = extractelement <8 x i8> %mul, i64 1
3103 %mul2 = extractelement <8 x i8> %mul, i64 2
3104 %mul3 = extractelement <8 x i8> %mul, i64 3
3105 %mul4 = extractelement <8 x i8> %mul, i64 4
3106 %mul5 = extractelement <8 x i8> %mul, i64 5
3107 %mul6 = extractelement <8 x i8> %mul, i64 6
3108 %mul7 = extractelement <8 x i8> %mul, i64 7
3110 %acc = load i8, ptr addrspace(1) %dst, align 4
3111 %add1 = add i8 %mul0, %acc
3112 %add2 = add i8 %add1, %mul1
3113 %add3 = add i8 %add2, %mul2
3114 %add4 = add i8 %add3, %mul3
3115 %add5 = add i8 %add4, %mul4
3116 %add6 = add i8 %add5, %mul5
3117 %add7 = add i8 %add6, %mul6
3118 %add8 = add i8 %add7, %mul7
3120 store i8 %add8, ptr addrspace(1) %dst, align 4
3124 declare i32 @llvm.amdgcn.workitem.id.x()