1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck --check-prefix=GFX6 %s
3 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck --check-prefix=GFX8 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck --check-prefix=GFX9 %s
5 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck --check-prefix=GFX101 %s
6 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1030 -verify-machineinstrs < %s | FileCheck --check-prefix=GFX103 %s
7 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck --check-prefix=GFX11 %s
9 define float @v_mul_legacy_f32(float %a, float %b) {
10 ; GFX6-LABEL: v_mul_legacy_f32:
12 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
13 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
14 ; GFX6-NEXT: s_setpc_b64 s[30:31]
16 ; GFX8-LABEL: v_mul_legacy_f32:
18 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
20 ; GFX8-NEXT: s_setpc_b64 s[30:31]
22 ; GFX9-LABEL: v_mul_legacy_f32:
24 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
25 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
26 ; GFX9-NEXT: s_setpc_b64 s[30:31]
28 ; GFX101-LABEL: v_mul_legacy_f32:
30 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
31 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
32 ; GFX101-NEXT: s_setpc_b64 s[30:31]
34 ; GFX103-LABEL: v_mul_legacy_f32:
36 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
37 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
38 ; GFX103-NEXT: s_setpc_b64 s[30:31]
40 ; GFX11-LABEL: v_mul_legacy_f32:
42 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
43 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, v0, v1
44 ; GFX11-NEXT: s_setpc_b64 s[30:31]
45 %result = call float @llvm.amdgcn.fmul.legacy(float %a, float %b)
49 define float @v_mul_legacy_undef0_f32(float %a) {
50 ; GFX6-LABEL: v_mul_legacy_undef0_f32:
52 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
53 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
54 ; GFX6-NEXT: s_setpc_b64 s[30:31]
56 ; GFX8-LABEL: v_mul_legacy_undef0_f32:
58 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
59 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
60 ; GFX8-NEXT: s_setpc_b64 s[30:31]
62 ; GFX9-LABEL: v_mul_legacy_undef0_f32:
64 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
65 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
66 ; GFX9-NEXT: s_setpc_b64 s[30:31]
68 ; GFX101-LABEL: v_mul_legacy_undef0_f32:
70 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
71 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
72 ; GFX101-NEXT: s_setpc_b64 s[30:31]
74 ; GFX103-LABEL: v_mul_legacy_undef0_f32:
76 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
77 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
78 ; GFX103-NEXT: s_setpc_b64 s[30:31]
80 ; GFX11-LABEL: v_mul_legacy_undef0_f32:
82 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
83 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, s0, v0
84 ; GFX11-NEXT: s_setpc_b64 s[30:31]
85 %result = call float @llvm.amdgcn.fmul.legacy(float undef, float %a)
89 define float @v_mul_legacy_undef1_f32(float %a) {
90 ; GFX6-LABEL: v_mul_legacy_undef1_f32:
92 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
93 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
94 ; GFX6-NEXT: s_setpc_b64 s[30:31]
96 ; GFX8-LABEL: v_mul_legacy_undef1_f32:
98 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
99 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
100 ; GFX8-NEXT: s_setpc_b64 s[30:31]
102 ; GFX9-LABEL: v_mul_legacy_undef1_f32:
104 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
105 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
106 ; GFX9-NEXT: s_setpc_b64 s[30:31]
108 ; GFX101-LABEL: v_mul_legacy_undef1_f32:
110 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
111 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
112 ; GFX101-NEXT: s_setpc_b64 s[30:31]
114 ; GFX103-LABEL: v_mul_legacy_undef1_f32:
116 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
117 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, s4, v0
118 ; GFX103-NEXT: s_setpc_b64 s[30:31]
120 ; GFX11-LABEL: v_mul_legacy_undef1_f32:
122 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
123 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, s0, v0
124 ; GFX11-NEXT: s_setpc_b64 s[30:31]
125 %result = call float @llvm.amdgcn.fmul.legacy(float %a, float undef)
129 define float @v_mul_legacy_undef_f32() {
130 ; GFX6-LABEL: v_mul_legacy_undef_f32:
132 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
133 ; GFX6-NEXT: v_mul_legacy_f32_e64 v0, s4, s4
134 ; GFX6-NEXT: s_setpc_b64 s[30:31]
136 ; GFX8-LABEL: v_mul_legacy_undef_f32:
138 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
139 ; GFX8-NEXT: v_mul_legacy_f32_e64 v0, s4, s4
140 ; GFX8-NEXT: s_setpc_b64 s[30:31]
142 ; GFX9-LABEL: v_mul_legacy_undef_f32:
144 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
145 ; GFX9-NEXT: v_mul_legacy_f32_e64 v0, s4, s4
146 ; GFX9-NEXT: s_setpc_b64 s[30:31]
148 ; GFX101-LABEL: v_mul_legacy_undef_f32:
150 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
151 ; GFX101-NEXT: v_mul_legacy_f32_e64 v0, s4, s4
152 ; GFX101-NEXT: s_setpc_b64 s[30:31]
154 ; GFX103-LABEL: v_mul_legacy_undef_f32:
156 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
157 ; GFX103-NEXT: v_mul_legacy_f32_e64 v0, s4, s4
158 ; GFX103-NEXT: s_setpc_b64 s[30:31]
160 ; GFX11-LABEL: v_mul_legacy_undef_f32:
162 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
163 ; GFX11-NEXT: v_mul_dx9_zero_f32_e64 v0, s0, s0
164 ; GFX11-NEXT: s_setpc_b64 s[30:31]
165 %result = call float @llvm.amdgcn.fmul.legacy(float undef, float undef)
169 define float @v_mul_legacy_fabs_f32(float %a, float %b) {
170 ; GFX6-LABEL: v_mul_legacy_fabs_f32:
172 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
173 ; GFX6-NEXT: v_mul_legacy_f32_e64 v0, |v0|, |v1|
174 ; GFX6-NEXT: s_setpc_b64 s[30:31]
176 ; GFX8-LABEL: v_mul_legacy_fabs_f32:
178 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
179 ; GFX8-NEXT: v_mul_legacy_f32_e64 v0, |v0|, |v1|
180 ; GFX8-NEXT: s_setpc_b64 s[30:31]
182 ; GFX9-LABEL: v_mul_legacy_fabs_f32:
184 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
185 ; GFX9-NEXT: v_mul_legacy_f32_e64 v0, |v0|, |v1|
186 ; GFX9-NEXT: s_setpc_b64 s[30:31]
188 ; GFX101-LABEL: v_mul_legacy_fabs_f32:
190 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
191 ; GFX101-NEXT: v_mul_legacy_f32_e64 v0, |v0|, |v1|
192 ; GFX101-NEXT: s_setpc_b64 s[30:31]
194 ; GFX103-LABEL: v_mul_legacy_fabs_f32:
196 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
197 ; GFX103-NEXT: v_mul_legacy_f32_e64 v0, |v0|, |v1|
198 ; GFX103-NEXT: s_setpc_b64 s[30:31]
200 ; GFX11-LABEL: v_mul_legacy_fabs_f32:
202 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
203 ; GFX11-NEXT: v_mul_dx9_zero_f32_e64 v0, |v0|, |v1|
204 ; GFX11-NEXT: s_setpc_b64 s[30:31]
205 %a.fabs = call float @llvm.fabs.f32(float %a)
206 %b.fabs = call float @llvm.fabs.f32(float %b)
207 %result = call float @llvm.amdgcn.fmul.legacy(float %a.fabs, float %b.fabs)
211 define float @v_mul_legacy_fneg_f32(float %a, float %b) {
212 ; GFX6-LABEL: v_mul_legacy_fneg_f32:
214 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
215 ; GFX6-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
216 ; GFX6-NEXT: s_setpc_b64 s[30:31]
218 ; GFX8-LABEL: v_mul_legacy_fneg_f32:
220 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
221 ; GFX8-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
222 ; GFX8-NEXT: s_setpc_b64 s[30:31]
224 ; GFX9-LABEL: v_mul_legacy_fneg_f32:
226 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
227 ; GFX9-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
228 ; GFX9-NEXT: s_setpc_b64 s[30:31]
230 ; GFX101-LABEL: v_mul_legacy_fneg_f32:
232 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
233 ; GFX101-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
234 ; GFX101-NEXT: s_setpc_b64 s[30:31]
236 ; GFX103-LABEL: v_mul_legacy_fneg_f32:
238 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
239 ; GFX103-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
240 ; GFX103-NEXT: s_setpc_b64 s[30:31]
242 ; GFX11-LABEL: v_mul_legacy_fneg_f32:
244 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
245 ; GFX11-NEXT: v_mul_dx9_zero_f32_e64 v0, -v0, -v1
246 ; GFX11-NEXT: s_setpc_b64 s[30:31]
247 %a.fneg = fneg float %a
248 %b.fneg = fneg float %b
249 %result = call float @llvm.amdgcn.fmul.legacy(float %a.fneg, float %b.fneg)
253 ; Don't form mad/mac instructions because they don't support denormals.
254 define float @v_add_mul_legacy_f32(float %a, float %b, float %c) {
255 ; GFX6-LABEL: v_add_mul_legacy_f32:
257 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
258 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
259 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
260 ; GFX6-NEXT: s_setpc_b64 s[30:31]
262 ; GFX8-LABEL: v_add_mul_legacy_f32:
264 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
265 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
266 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
267 ; GFX8-NEXT: s_setpc_b64 s[30:31]
269 ; GFX9-LABEL: v_add_mul_legacy_f32:
271 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
272 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
273 ; GFX9-NEXT: v_add_f32_e32 v0, v0, v2
274 ; GFX9-NEXT: s_setpc_b64 s[30:31]
276 ; GFX101-LABEL: v_add_mul_legacy_f32:
278 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
279 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
280 ; GFX101-NEXT: v_add_f32_e32 v0, v0, v2
281 ; GFX101-NEXT: s_setpc_b64 s[30:31]
283 ; GFX103-LABEL: v_add_mul_legacy_f32:
285 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
286 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
287 ; GFX103-NEXT: v_add_f32_e32 v0, v0, v2
288 ; GFX103-NEXT: s_setpc_b64 s[30:31]
290 ; GFX11-LABEL: v_add_mul_legacy_f32:
292 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
293 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, v0, v1
294 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
295 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
296 ; GFX11-NEXT: s_setpc_b64 s[30:31]
297 %mul = call float @llvm.amdgcn.fmul.legacy(float %a, float %b)
298 %add = fadd float %mul, %c
302 define float @v_mad_legacy_f32(float %a, float %b, float %c) #2 {
303 ; GFX6-LABEL: v_mad_legacy_f32:
305 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
306 ; GFX6-NEXT: v_mad_legacy_f32 v0, v0, v1, v2
307 ; GFX6-NEXT: s_setpc_b64 s[30:31]
309 ; GFX8-LABEL: v_mad_legacy_f32:
311 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
312 ; GFX8-NEXT: v_mad_legacy_f32 v0, v0, v1, v2
313 ; GFX8-NEXT: s_setpc_b64 s[30:31]
315 ; GFX9-LABEL: v_mad_legacy_f32:
317 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
318 ; GFX9-NEXT: v_mad_legacy_f32 v0, v0, v1, v2
319 ; GFX9-NEXT: s_setpc_b64 s[30:31]
321 ; GFX101-LABEL: v_mad_legacy_f32:
323 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
324 ; GFX101-NEXT: v_mad_legacy_f32 v0, v0, v1, v2
325 ; GFX101-NEXT: s_setpc_b64 s[30:31]
327 ; GFX103-LABEL: v_mad_legacy_f32:
329 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
330 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, v0, v1
331 ; GFX103-NEXT: v_add_f32_e32 v0, v0, v2
332 ; GFX103-NEXT: s_setpc_b64 s[30:31]
334 ; GFX11-LABEL: v_mad_legacy_f32:
336 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
337 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, v0, v1
338 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
339 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
340 ; GFX11-NEXT: s_setpc_b64 s[30:31]
341 %mul = call float @llvm.amdgcn.fmul.legacy(float %a, float %b)
342 %add = fadd float %mul, %c
346 define float @v_mad_legacy_fneg_f32(float %a, float %b, float %c) #2 {
347 ; GFX6-LABEL: v_mad_legacy_fneg_f32:
349 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
350 ; GFX6-NEXT: v_mad_legacy_f32 v0, -v0, -v1, v2
351 ; GFX6-NEXT: s_setpc_b64 s[30:31]
353 ; GFX8-LABEL: v_mad_legacy_fneg_f32:
355 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
356 ; GFX8-NEXT: v_mad_legacy_f32 v0, -v0, -v1, v2
357 ; GFX8-NEXT: s_setpc_b64 s[30:31]
359 ; GFX9-LABEL: v_mad_legacy_fneg_f32:
361 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
362 ; GFX9-NEXT: v_mad_legacy_f32 v0, -v0, -v1, v2
363 ; GFX9-NEXT: s_setpc_b64 s[30:31]
365 ; GFX101-LABEL: v_mad_legacy_fneg_f32:
367 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
368 ; GFX101-NEXT: v_mad_legacy_f32 v0, -v0, -v1, v2
369 ; GFX101-NEXT: s_setpc_b64 s[30:31]
371 ; GFX103-LABEL: v_mad_legacy_fneg_f32:
373 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
374 ; GFX103-NEXT: v_mul_legacy_f32_e64 v0, -v0, -v1
375 ; GFX103-NEXT: v_add_f32_e32 v0, v0, v2
376 ; GFX103-NEXT: s_setpc_b64 s[30:31]
378 ; GFX11-LABEL: v_mad_legacy_fneg_f32:
380 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
381 ; GFX11-NEXT: v_mul_dx9_zero_f32_e64 v0, -v0, -v1
382 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
383 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
384 ; GFX11-NEXT: s_setpc_b64 s[30:31]
385 %a.fneg = fneg float %a
386 %b.fneg = fneg float %b
387 %mul = call float @llvm.amdgcn.fmul.legacy(float %a.fneg, float %b.fneg)
388 %add = fadd float %mul, %c
392 define amdgpu_ps float @s_mul_legacy_f32(float inreg %a, float inreg %b) {
393 ; GFX6-LABEL: s_mul_legacy_f32:
395 ; GFX6-NEXT: v_mov_b32_e32 v0, s1
396 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, s0, v0
397 ; GFX6-NEXT: ; return to shader part epilog
399 ; GFX8-LABEL: s_mul_legacy_f32:
401 ; GFX8-NEXT: v_mov_b32_e32 v0, s1
402 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, s0, v0
403 ; GFX8-NEXT: ; return to shader part epilog
405 ; GFX9-LABEL: s_mul_legacy_f32:
407 ; GFX9-NEXT: v_mov_b32_e32 v0, s1
408 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, s0, v0
409 ; GFX9-NEXT: ; return to shader part epilog
411 ; GFX101-LABEL: s_mul_legacy_f32:
413 ; GFX101-NEXT: v_mul_legacy_f32_e64 v0, s0, s1
414 ; GFX101-NEXT: ; return to shader part epilog
416 ; GFX103-LABEL: s_mul_legacy_f32:
418 ; GFX103-NEXT: v_mul_legacy_f32_e64 v0, s0, s1
419 ; GFX103-NEXT: ; return to shader part epilog
421 ; GFX11-LABEL: s_mul_legacy_f32:
423 ; GFX11-NEXT: v_mul_dx9_zero_f32_e64 v0, s0, s1
424 ; GFX11-NEXT: ; return to shader part epilog
425 %result = call float @llvm.amdgcn.fmul.legacy(float %a, float %b)
429 define float @v_mul_legacy_f32_1.0(float %a) {
430 ; GFX6-LABEL: v_mul_legacy_f32_1.0:
432 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
433 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
434 ; GFX6-NEXT: s_setpc_b64 s[30:31]
436 ; GFX8-LABEL: v_mul_legacy_f32_1.0:
438 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
439 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
440 ; GFX8-NEXT: s_setpc_b64 s[30:31]
442 ; GFX9-LABEL: v_mul_legacy_f32_1.0:
444 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
445 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
446 ; GFX9-NEXT: s_setpc_b64 s[30:31]
448 ; GFX101-LABEL: v_mul_legacy_f32_1.0:
450 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
451 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
452 ; GFX101-NEXT: s_setpc_b64 s[30:31]
454 ; GFX103-LABEL: v_mul_legacy_f32_1.0:
456 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
457 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
458 ; GFX103-NEXT: s_setpc_b64 s[30:31]
460 ; GFX11-LABEL: v_mul_legacy_f32_1.0:
462 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
463 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, 1.0, v0
464 ; GFX11-NEXT: s_setpc_b64 s[30:31]
465 %result = call float @llvm.amdgcn.fmul.legacy(float %a, float 1.0)
469 define float @v_mul_legacy_f32_1.0_swap(float %b) {
470 ; GFX6-LABEL: v_mul_legacy_f32_1.0_swap:
472 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
473 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
474 ; GFX6-NEXT: s_setpc_b64 s[30:31]
476 ; GFX8-LABEL: v_mul_legacy_f32_1.0_swap:
478 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
479 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
480 ; GFX8-NEXT: s_setpc_b64 s[30:31]
482 ; GFX9-LABEL: v_mul_legacy_f32_1.0_swap:
484 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
485 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
486 ; GFX9-NEXT: s_setpc_b64 s[30:31]
488 ; GFX101-LABEL: v_mul_legacy_f32_1.0_swap:
490 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
491 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
492 ; GFX101-NEXT: s_setpc_b64 s[30:31]
494 ; GFX103-LABEL: v_mul_legacy_f32_1.0_swap:
496 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
497 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, 1.0, v0
498 ; GFX103-NEXT: s_setpc_b64 s[30:31]
500 ; GFX11-LABEL: v_mul_legacy_f32_1.0_swap:
502 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
503 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, 1.0, v0
504 ; GFX11-NEXT: s_setpc_b64 s[30:31]
505 %result = call float @llvm.amdgcn.fmul.legacy(float 1.0, float %b)
509 define float @v_mul_legacy_f32_2.0(float %a) {
510 ; GFX6-LABEL: v_mul_legacy_f32_2.0:
512 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
513 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
514 ; GFX6-NEXT: s_setpc_b64 s[30:31]
516 ; GFX8-LABEL: v_mul_legacy_f32_2.0:
518 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
519 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
520 ; GFX8-NEXT: s_setpc_b64 s[30:31]
522 ; GFX9-LABEL: v_mul_legacy_f32_2.0:
524 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
525 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
526 ; GFX9-NEXT: s_setpc_b64 s[30:31]
528 ; GFX101-LABEL: v_mul_legacy_f32_2.0:
530 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
531 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
532 ; GFX101-NEXT: s_setpc_b64 s[30:31]
534 ; GFX103-LABEL: v_mul_legacy_f32_2.0:
536 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
537 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
538 ; GFX103-NEXT: s_setpc_b64 s[30:31]
540 ; GFX11-LABEL: v_mul_legacy_f32_2.0:
542 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
543 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, 2.0, v0
544 ; GFX11-NEXT: s_setpc_b64 s[30:31]
545 %result = call float @llvm.amdgcn.fmul.legacy(float %a, float 2.0)
549 define float @v_mul_legacy_f32_2.0_swap(float %b) {
550 ; GFX6-LABEL: v_mul_legacy_f32_2.0_swap:
552 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
553 ; GFX6-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
554 ; GFX6-NEXT: s_setpc_b64 s[30:31]
556 ; GFX8-LABEL: v_mul_legacy_f32_2.0_swap:
558 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
559 ; GFX8-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
560 ; GFX8-NEXT: s_setpc_b64 s[30:31]
562 ; GFX9-LABEL: v_mul_legacy_f32_2.0_swap:
564 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
565 ; GFX9-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
566 ; GFX9-NEXT: s_setpc_b64 s[30:31]
568 ; GFX101-LABEL: v_mul_legacy_f32_2.0_swap:
570 ; GFX101-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
571 ; GFX101-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
572 ; GFX101-NEXT: s_setpc_b64 s[30:31]
574 ; GFX103-LABEL: v_mul_legacy_f32_2.0_swap:
576 ; GFX103-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
577 ; GFX103-NEXT: v_mul_legacy_f32_e32 v0, 2.0, v0
578 ; GFX103-NEXT: s_setpc_b64 s[30:31]
580 ; GFX11-LABEL: v_mul_legacy_f32_2.0_swap:
582 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
583 ; GFX11-NEXT: v_mul_dx9_zero_f32_e32 v0, 2.0, v0
584 ; GFX11-NEXT: s_setpc_b64 s[30:31]
585 %result = call float @llvm.amdgcn.fmul.legacy(float 2.0, float %b)
589 declare float @llvm.fabs.f32(float) #0
590 declare float @llvm.amdgcn.fmul.legacy(float, float) #1
592 attributes #0 = { nounwind readnone speculatable willreturn }
593 attributes #1 = { nounwind readnone speculatable }
594 attributes #2 = { "denormal-fp-math-f32"="preserve-sign" }