1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -march=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX6,GFX6-FASTFMA %s
3 ; RUN: llc -march=amdgcn -mcpu=pitcairn < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX6,GFX6-SLOWFMA %s
4 ; RUN: llc -march=amdgcn -mcpu=hawaii < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX7 %s
5 ; RUN: llc -march=amdgcn -mcpu=fiji < %s | FileCheck -check-prefixes=GCN,GFX678,GFX8 %s
6 ; RUN: llc -march=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GCN,GFX10 %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefixes=GCN,GFX11 %s
8 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG %s
10 ; These tests check that fdiv is expanded correctly and also test that the
11 ; scheduler is scheduling the RECIP_IEEE and MUL_IEEE instructions in separate
14 ; These test check that fdiv using unsafe_fp_math, coarse fp div, and IEEE754 fp div.
16 define amdgpu_kernel void @s_fdiv_f32_ninf(ptr addrspace(1) %out, float %a, float %b) #0 {
17 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_ninf:
18 ; GFX6-FASTFMA: ; %bb.0: ; %entry
19 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
20 ; GFX6-FASTFMA-NEXT: s_mov_b32 s7, 0xf000
21 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, -1
22 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
23 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s2
24 ; GFX6-FASTFMA-NEXT: s_mov_b32 s4, s0
25 ; GFX6-FASTFMA-NEXT: s_mov_b32 s5, s1
26 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[0:1], s3, s3, v1
27 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
28 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s3
29 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
30 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
31 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
32 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
33 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v0, v3
34 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, v0
35 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v3, v4
36 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v4, v0
37 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
38 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v3, v4
39 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s3, v1
40 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
41 ; GFX6-FASTFMA-NEXT: s_endpgm
43 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_ninf:
44 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
45 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
46 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s7, 0xf000
47 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, -1
48 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
49 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s2
50 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
51 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s3
52 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
53 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s4, s0
54 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s5, s1
55 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
56 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
57 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
58 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
59 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
60 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
61 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
62 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
63 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
64 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
65 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s3, v0
66 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
67 ; GFX6-SLOWFMA-NEXT: s_endpgm
69 ; GFX7-LABEL: s_fdiv_f32_ninf:
70 ; GFX7: ; %bb.0: ; %entry
71 ; GFX7-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
72 ; GFX7-NEXT: s_mov_b32 s7, 0xf000
73 ; GFX7-NEXT: s_mov_b32 s6, -1
74 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
75 ; GFX7-NEXT: v_mov_b32_e32 v1, s2
76 ; GFX7-NEXT: s_mov_b32 s4, s0
77 ; GFX7-NEXT: s_mov_b32 s5, s1
78 ; GFX7-NEXT: v_div_scale_f32 v2, s[0:1], s3, s3, v1
79 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
80 ; GFX7-NEXT: v_mov_b32_e32 v0, s3
81 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
82 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
83 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
84 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
85 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
86 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
87 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
88 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
89 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
90 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
91 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s3, v1
92 ; GFX7-NEXT: buffer_store_dword v0, off, s[4:7], 0
95 ; GFX8-LABEL: s_fdiv_f32_ninf:
96 ; GFX8: ; %bb.0: ; %entry
97 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
98 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
99 ; GFX8-NEXT: v_mov_b32_e32 v0, s2
100 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
101 ; GFX8-NEXT: v_mov_b32_e32 v2, s3
102 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
103 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
104 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
105 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
106 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
107 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
108 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
109 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
110 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
111 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
112 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
113 ; GFX8-NEXT: v_div_fixup_f32 v2, v1, s3, v0
114 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
115 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
116 ; GFX8-NEXT: flat_store_dword v[0:1], v2
117 ; GFX8-NEXT: s_endpgm
119 ; GFX10-LABEL: s_fdiv_f32_ninf:
120 ; GFX10: ; %bb.0: ; %entry
121 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
122 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
123 ; GFX10-NEXT: v_div_scale_f32 v0, s4, s3, s3, s2
124 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
125 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
126 ; GFX10-NEXT: s_denorm_mode 15
127 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
128 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
129 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
130 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
131 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
132 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
133 ; GFX10-NEXT: s_denorm_mode 12
134 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
135 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
136 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s3, s2
137 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
138 ; GFX10-NEXT: s_endpgm
140 ; GFX11-LABEL: s_fdiv_f32_ninf:
141 ; GFX11: ; %bb.0: ; %entry
142 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
143 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
144 ; GFX11-NEXT: v_div_scale_f32 v0, null, s3, s3, s2
145 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
146 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
147 ; GFX11-NEXT: s_denorm_mode 15
148 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
149 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
150 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
151 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
152 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
153 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
154 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
155 ; GFX11-NEXT: s_denorm_mode 12
156 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
157 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
158 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s3, s2
159 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
160 ; GFX11-NEXT: s_nop 0
161 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
162 ; GFX11-NEXT: s_endpgm
164 ; EG-LABEL: s_fdiv_f32_ninf:
165 ; EG: ; %bb.0: ; %entry
166 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
167 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
170 ; EG-NEXT: ALU clause starting at 4:
171 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
172 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].Z, PS,
173 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
174 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
176 %fdiv = fdiv ninf float %a, %b
177 store float %fdiv, ptr addrspace(1) %out
181 define amdgpu_kernel void @s_fdiv_f32_ieee(ptr addrspace(1) %out, float %a, float %b) #1 {
182 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_ieee:
183 ; GFX6-FASTFMA: ; %bb.0: ; %entry
184 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
185 ; GFX6-FASTFMA-NEXT: s_mov_b32 s7, 0xf000
186 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, -1
187 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
188 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s2
189 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
190 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
191 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v3, s3
192 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s2, v3, s2
193 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
194 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
195 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
196 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
197 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
198 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
199 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
200 ; GFX6-FASTFMA-NEXT: s_mov_b32 s4, s0
201 ; GFX6-FASTFMA-NEXT: s_mov_b32 s5, s1
202 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s3, v0
203 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
204 ; GFX6-FASTFMA-NEXT: s_endpgm
206 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_ieee:
207 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
208 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
209 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s7, 0xf000
210 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, -1
211 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
212 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s2
213 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
214 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s3
215 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
216 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s4, s0
217 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s5, s1
218 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
219 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
220 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
221 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
222 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
223 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
224 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
225 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
226 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s3, v0
227 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
228 ; GFX6-SLOWFMA-NEXT: s_endpgm
230 ; GFX7-LABEL: s_fdiv_f32_ieee:
231 ; GFX7: ; %bb.0: ; %entry
232 ; GFX7-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
233 ; GFX7-NEXT: s_mov_b32 s7, 0xf000
234 ; GFX7-NEXT: s_mov_b32 s6, -1
235 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
236 ; GFX7-NEXT: v_mov_b32_e32 v0, s2
237 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
238 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
239 ; GFX7-NEXT: v_mov_b32_e32 v3, s3
240 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s2, v3, s2
241 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
242 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
243 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
244 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
245 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
246 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
247 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
248 ; GFX7-NEXT: s_mov_b32 s4, s0
249 ; GFX7-NEXT: s_mov_b32 s5, s1
250 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s3, v0
251 ; GFX7-NEXT: buffer_store_dword v0, off, s[4:7], 0
252 ; GFX7-NEXT: s_endpgm
254 ; GFX8-LABEL: s_fdiv_f32_ieee:
255 ; GFX8: ; %bb.0: ; %entry
256 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
257 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
258 ; GFX8-NEXT: v_mov_b32_e32 v0, s2
259 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
260 ; GFX8-NEXT: v_mov_b32_e32 v2, s3
261 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
262 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
263 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
264 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
265 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
266 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
267 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
268 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
269 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
270 ; GFX8-NEXT: v_div_fixup_f32 v2, v1, s3, v0
271 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
272 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
273 ; GFX8-NEXT: flat_store_dword v[0:1], v2
274 ; GFX8-NEXT: s_endpgm
276 ; GFX10-LABEL: s_fdiv_f32_ieee:
277 ; GFX10: ; %bb.0: ; %entry
278 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
279 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
280 ; GFX10-NEXT: v_div_scale_f32 v0, s4, s3, s3, s2
281 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
282 ; GFX10-NEXT: v_fma_f32 v2, -v0, v1, 1.0
283 ; GFX10-NEXT: v_fmac_f32_e32 v1, v2, v1
284 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
285 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
286 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
287 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
288 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
289 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
290 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
291 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s3, s2
292 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
293 ; GFX10-NEXT: s_endpgm
295 ; GFX11-LABEL: s_fdiv_f32_ieee:
296 ; GFX11: ; %bb.0: ; %entry
297 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
298 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
299 ; GFX11-NEXT: v_div_scale_f32 v0, null, s3, s3, s2
300 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
301 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
302 ; GFX11-NEXT: v_fma_f32 v2, -v0, v1, 1.0
303 ; GFX11-NEXT: v_fmac_f32_e32 v1, v2, v1
304 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
305 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
306 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
307 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
308 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
309 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
310 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
311 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s3, s2
312 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
313 ; GFX11-NEXT: s_nop 0
314 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
315 ; GFX11-NEXT: s_endpgm
317 ; EG-LABEL: s_fdiv_f32_ieee:
318 ; EG: ; %bb.0: ; %entry
319 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
320 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
323 ; EG-NEXT: ALU clause starting at 4:
324 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
325 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].Z, PS,
326 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
327 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
329 %fdiv = fdiv float %a, %b
330 store float %fdiv, ptr addrspace(1) %out
334 define amdgpu_kernel void @s_fdiv_25ulp_f32(ptr addrspace(1) %out, float %a, float %b) #0 {
335 ; GFX67-LABEL: s_fdiv_25ulp_f32:
336 ; GFX67: ; %bb.0: ; %entry
337 ; GFX67-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
338 ; GFX67-NEXT: v_mov_b32_e32 v0, 0x6f800000
339 ; GFX67-NEXT: v_mov_b32_e32 v1, 0x2f800000
340 ; GFX67-NEXT: s_mov_b32 s7, 0xf000
341 ; GFX67-NEXT: s_mov_b32 s6, -1
342 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
343 ; GFX67-NEXT: v_cmp_gt_f32_e64 vcc, |s3|, v0
344 ; GFX67-NEXT: v_cndmask_b32_e32 v0, 1.0, v1, vcc
345 ; GFX67-NEXT: v_mul_f32_e32 v1, s3, v0
346 ; GFX67-NEXT: v_rcp_f32_e32 v1, v1
347 ; GFX67-NEXT: s_mov_b32 s4, s0
348 ; GFX67-NEXT: s_mov_b32 s5, s1
349 ; GFX67-NEXT: v_mul_f32_e32 v1, s2, v1
350 ; GFX67-NEXT: v_mul_f32_e32 v0, v0, v1
351 ; GFX67-NEXT: buffer_store_dword v0, off, s[4:7], 0
352 ; GFX67-NEXT: s_endpgm
354 ; GFX8-LABEL: s_fdiv_25ulp_f32:
355 ; GFX8: ; %bb.0: ; %entry
356 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
357 ; GFX8-NEXT: v_mov_b32_e32 v0, 0x6f800000
358 ; GFX8-NEXT: v_mov_b32_e32 v1, 0x2f800000
359 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
360 ; GFX8-NEXT: v_cmp_gt_f32_e64 vcc, |s3|, v0
361 ; GFX8-NEXT: v_cndmask_b32_e32 v0, 1.0, v1, vcc
362 ; GFX8-NEXT: v_mul_f32_e32 v1, s3, v0
363 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
364 ; GFX8-NEXT: v_mul_f32_e32 v1, s2, v1
365 ; GFX8-NEXT: v_mul_f32_e32 v2, v0, v1
366 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
367 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
368 ; GFX8-NEXT: flat_store_dword v[0:1], v2
369 ; GFX8-NEXT: s_endpgm
371 ; GFX10-LABEL: s_fdiv_25ulp_f32:
372 ; GFX10: ; %bb.0: ; %entry
373 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
374 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
375 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
376 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |s3|
377 ; GFX10-NEXT: v_cndmask_b32_e64 v0, 1.0, 0x2f800000, s4
378 ; GFX10-NEXT: v_mul_f32_e32 v1, s3, v0
379 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
380 ; GFX10-NEXT: v_mul_f32_e32 v1, s2, v1
381 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
382 ; GFX10-NEXT: global_store_dword v2, v0, s[0:1]
383 ; GFX10-NEXT: s_endpgm
385 ; GFX11-LABEL: s_fdiv_25ulp_f32:
386 ; GFX11: ; %bb.0: ; %entry
387 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
388 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
389 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
390 ; GFX11-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |s3|
391 ; GFX11-NEXT: v_cndmask_b32_e64 v0, 1.0, 0x2f800000, s4
392 ; GFX11-NEXT: v_mul_f32_e32 v1, s3, v0
393 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
394 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
395 ; GFX11-NEXT: v_mul_f32_e32 v1, s2, v1
396 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
397 ; GFX11-NEXT: global_store_b32 v2, v0, s[0:1]
398 ; GFX11-NEXT: s_nop 0
399 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
400 ; GFX11-NEXT: s_endpgm
402 ; EG-LABEL: s_fdiv_25ulp_f32:
403 ; EG: ; %bb.0: ; %entry
404 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
405 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
408 ; EG-NEXT: ALU clause starting at 4:
409 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
410 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].Z, PS,
411 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
412 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
414 %fdiv = fdiv float %a, %b, !fpmath !0
415 store float %fdiv, ptr addrspace(1) %out
420 define amdgpu_kernel void @s_fdiv_25ulp_ieee_f32(ptr addrspace(1) %out, float %a, float %b) #1 {
421 ; GFX6-LABEL: s_fdiv_25ulp_ieee_f32:
422 ; GFX6: ; %bb.0: ; %entry
423 ; GFX6-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
424 ; GFX6-NEXT: v_mov_b32_e32 v0, 0x7f800000
425 ; GFX6-NEXT: s_mov_b32 s7, 0xf000
426 ; GFX6-NEXT: s_mov_b32 s6, -1
427 ; GFX6-NEXT: s_waitcnt lgkmcnt(0)
428 ; GFX6-NEXT: v_frexp_mant_f32_e32 v1, s3
429 ; GFX6-NEXT: v_mov_b32_e32 v2, s3
430 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |s3|, v0
431 ; GFX6-NEXT: v_cndmask_b32_e32 v1, v2, v1, vcc
432 ; GFX6-NEXT: v_rcp_f32_e32 v1, v1
433 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, s2
434 ; GFX6-NEXT: v_mov_b32_e32 v4, s2
435 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |s2|, v0
436 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v2, s3
437 ; GFX6-NEXT: v_cndmask_b32_e32 v0, v4, v3, vcc
438 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v3, s2
439 ; GFX6-NEXT: v_mul_f32_e32 v0, v0, v1
440 ; GFX6-NEXT: v_sub_i32_e32 v1, vcc, v3, v2
441 ; GFX6-NEXT: s_mov_b32 s4, s0
442 ; GFX6-NEXT: s_mov_b32 s5, s1
443 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v0, v1
444 ; GFX6-NEXT: buffer_store_dword v0, off, s[4:7], 0
445 ; GFX6-NEXT: s_endpgm
447 ; GFX7-LABEL: s_fdiv_25ulp_ieee_f32:
448 ; GFX7: ; %bb.0: ; %entry
449 ; GFX7-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
450 ; GFX7-NEXT: s_mov_b32 s7, 0xf000
451 ; GFX7-NEXT: s_mov_b32 s6, -1
452 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
453 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, s3
454 ; GFX7-NEXT: v_rcp_f32_e32 v0, v0
455 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, s3
456 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v2, s2
457 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, s2
458 ; GFX7-NEXT: v_mul_f32_e32 v0, v3, v0
459 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v2, v1
460 ; GFX7-NEXT: s_mov_b32 s4, s0
461 ; GFX7-NEXT: s_mov_b32 s5, s1
462 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
463 ; GFX7-NEXT: buffer_store_dword v0, off, s[4:7], 0
464 ; GFX7-NEXT: s_endpgm
466 ; GFX8-LABEL: s_fdiv_25ulp_ieee_f32:
467 ; GFX8: ; %bb.0: ; %entry
468 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
469 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
470 ; GFX8-NEXT: v_frexp_mant_f32_e32 v1, s3
471 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
472 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v0, s3
473 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v2, s2
474 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, s2
475 ; GFX8-NEXT: v_sub_u32_e32 v0, vcc, v2, v0
476 ; GFX8-NEXT: v_mul_f32_e32 v1, v3, v1
477 ; GFX8-NEXT: v_ldexp_f32 v2, v1, v0
478 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
479 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
480 ; GFX8-NEXT: flat_store_dword v[0:1], v2
481 ; GFX8-NEXT: s_endpgm
483 ; GFX10-LABEL: s_fdiv_25ulp_ieee_f32:
484 ; GFX10: ; %bb.0: ; %entry
485 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
486 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
487 ; GFX10-NEXT: v_frexp_mant_f32_e32 v0, s3
488 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, s3
489 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, s2
490 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v3, s2
491 ; GFX10-NEXT: v_rcp_f32_e32 v0, v0
492 ; GFX10-NEXT: v_sub_nc_u32_e32 v1, v3, v1
493 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
494 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
495 ; GFX10-NEXT: v_ldexp_f32 v0, v0, v1
496 ; GFX10-NEXT: global_store_dword v2, v0, s[0:1]
497 ; GFX10-NEXT: s_endpgm
499 ; GFX11-LABEL: s_fdiv_25ulp_ieee_f32:
500 ; GFX11: ; %bb.0: ; %entry
501 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
502 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
503 ; GFX11-NEXT: v_frexp_mant_f32_e32 v0, s3
504 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, s3
505 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, s2
506 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v3, s2
507 ; GFX11-NEXT: v_rcp_f32_e32 v0, v0
508 ; GFX11-NEXT: v_sub_nc_u32_e32 v1, v3, v1
509 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
510 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
511 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
512 ; GFX11-NEXT: v_ldexp_f32 v0, v0, v1
513 ; GFX11-NEXT: global_store_b32 v2, v0, s[0:1]
514 ; GFX11-NEXT: s_nop 0
515 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
516 ; GFX11-NEXT: s_endpgm
518 ; EG-LABEL: s_fdiv_25ulp_ieee_f32:
519 ; EG: ; %bb.0: ; %entry
520 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
521 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
524 ; EG-NEXT: ALU clause starting at 4:
525 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
526 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].Z, PS,
527 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
528 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
530 %fdiv = fdiv float %a, %b, !fpmath !0
531 store float %fdiv, ptr addrspace(1) %out
535 define amdgpu_kernel void @s_fdiv_fast_ieee_f32(ptr addrspace(1) %out, float %a, float %b) #1 {
536 ; GFX67-LABEL: s_fdiv_fast_ieee_f32:
537 ; GFX67: ; %bb.0: ; %entry
538 ; GFX67-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
539 ; GFX67-NEXT: s_mov_b32 s7, 0xf000
540 ; GFX67-NEXT: s_mov_b32 s6, -1
541 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
542 ; GFX67-NEXT: v_rcp_f32_e32 v0, s3
543 ; GFX67-NEXT: s_mov_b32 s4, s0
544 ; GFX67-NEXT: s_mov_b32 s5, s1
545 ; GFX67-NEXT: v_mul_f32_e32 v0, s2, v0
546 ; GFX67-NEXT: buffer_store_dword v0, off, s[4:7], 0
547 ; GFX67-NEXT: s_endpgm
549 ; GFX8-LABEL: s_fdiv_fast_ieee_f32:
550 ; GFX8: ; %bb.0: ; %entry
551 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
552 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
553 ; GFX8-NEXT: v_rcp_f32_e32 v0, s3
554 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v0
555 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
556 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
557 ; GFX8-NEXT: flat_store_dword v[0:1], v2
558 ; GFX8-NEXT: s_endpgm
560 ; GFX10-LABEL: s_fdiv_fast_ieee_f32:
561 ; GFX10: ; %bb.0: ; %entry
562 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
563 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
564 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
565 ; GFX10-NEXT: v_rcp_f32_e32 v0, s3
566 ; GFX10-NEXT: v_mul_f32_e32 v0, s2, v0
567 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
568 ; GFX10-NEXT: s_endpgm
570 ; GFX11-LABEL: s_fdiv_fast_ieee_f32:
571 ; GFX11: ; %bb.0: ; %entry
572 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
573 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
574 ; GFX11-NEXT: v_rcp_f32_e32 v0, s3
575 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
576 ; GFX11-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mul_f32 v0, s2, v0
577 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
578 ; GFX11-NEXT: s_nop 0
579 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
580 ; GFX11-NEXT: s_endpgm
582 ; EG-LABEL: s_fdiv_fast_ieee_f32:
583 ; EG: ; %bb.0: ; %entry
584 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
585 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
588 ; EG-NEXT: ALU clause starting at 4:
589 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
590 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].Z,
591 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
592 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
594 %fdiv = fdiv fast float %a, %b
595 store float %fdiv, ptr addrspace(1) %out
599 define amdgpu_kernel void @s_fdiv_f32_fast_math(ptr addrspace(1) %out, float %a, float %b) #0 {
600 ; GFX67-LABEL: s_fdiv_f32_fast_math:
601 ; GFX67: ; %bb.0: ; %entry
602 ; GFX67-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
603 ; GFX67-NEXT: s_mov_b32 s7, 0xf000
604 ; GFX67-NEXT: s_mov_b32 s6, -1
605 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
606 ; GFX67-NEXT: v_rcp_f32_e32 v0, s3
607 ; GFX67-NEXT: s_mov_b32 s4, s0
608 ; GFX67-NEXT: s_mov_b32 s5, s1
609 ; GFX67-NEXT: v_mul_f32_e32 v0, s2, v0
610 ; GFX67-NEXT: buffer_store_dword v0, off, s[4:7], 0
611 ; GFX67-NEXT: s_endpgm
613 ; GFX8-LABEL: s_fdiv_f32_fast_math:
614 ; GFX8: ; %bb.0: ; %entry
615 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
616 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
617 ; GFX8-NEXT: v_rcp_f32_e32 v0, s3
618 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v0
619 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
620 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
621 ; GFX8-NEXT: flat_store_dword v[0:1], v2
622 ; GFX8-NEXT: s_endpgm
624 ; GFX10-LABEL: s_fdiv_f32_fast_math:
625 ; GFX10: ; %bb.0: ; %entry
626 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
627 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
628 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
629 ; GFX10-NEXT: v_rcp_f32_e32 v0, s3
630 ; GFX10-NEXT: v_mul_f32_e32 v0, s2, v0
631 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
632 ; GFX10-NEXT: s_endpgm
634 ; GFX11-LABEL: s_fdiv_f32_fast_math:
635 ; GFX11: ; %bb.0: ; %entry
636 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
637 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
638 ; GFX11-NEXT: v_rcp_f32_e32 v0, s3
639 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
640 ; GFX11-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mul_f32 v0, s2, v0
641 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
642 ; GFX11-NEXT: s_nop 0
643 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
644 ; GFX11-NEXT: s_endpgm
646 ; EG-LABEL: s_fdiv_f32_fast_math:
647 ; EG: ; %bb.0: ; %entry
648 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
649 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
652 ; EG-NEXT: ALU clause starting at 4:
653 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
654 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].Z,
655 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
656 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
658 %fdiv = fdiv fast float %a, %b
659 store float %fdiv, ptr addrspace(1) %out
663 define amdgpu_kernel void @s_fdiv_ulp25_f32_fast_math(ptr addrspace(1) %out, float %a, float %b) #0 {
664 ; GFX67-LABEL: s_fdiv_ulp25_f32_fast_math:
665 ; GFX67: ; %bb.0: ; %entry
666 ; GFX67-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
667 ; GFX67-NEXT: s_mov_b32 s7, 0xf000
668 ; GFX67-NEXT: s_mov_b32 s6, -1
669 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
670 ; GFX67-NEXT: v_rcp_f32_e32 v0, s3
671 ; GFX67-NEXT: s_mov_b32 s4, s0
672 ; GFX67-NEXT: s_mov_b32 s5, s1
673 ; GFX67-NEXT: v_mul_f32_e32 v0, s2, v0
674 ; GFX67-NEXT: buffer_store_dword v0, off, s[4:7], 0
675 ; GFX67-NEXT: s_endpgm
677 ; GFX8-LABEL: s_fdiv_ulp25_f32_fast_math:
678 ; GFX8: ; %bb.0: ; %entry
679 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
680 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
681 ; GFX8-NEXT: v_rcp_f32_e32 v0, s3
682 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v0
683 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
684 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
685 ; GFX8-NEXT: flat_store_dword v[0:1], v2
686 ; GFX8-NEXT: s_endpgm
688 ; GFX10-LABEL: s_fdiv_ulp25_f32_fast_math:
689 ; GFX10: ; %bb.0: ; %entry
690 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
691 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
692 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
693 ; GFX10-NEXT: v_rcp_f32_e32 v0, s3
694 ; GFX10-NEXT: v_mul_f32_e32 v0, s2, v0
695 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
696 ; GFX10-NEXT: s_endpgm
698 ; GFX11-LABEL: s_fdiv_ulp25_f32_fast_math:
699 ; GFX11: ; %bb.0: ; %entry
700 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
701 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
702 ; GFX11-NEXT: v_rcp_f32_e32 v0, s3
703 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
704 ; GFX11-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mul_f32 v0, s2, v0
705 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
706 ; GFX11-NEXT: s_nop 0
707 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
708 ; GFX11-NEXT: s_endpgm
710 ; EG-LABEL: s_fdiv_ulp25_f32_fast_math:
711 ; EG: ; %bb.0: ; %entry
712 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
713 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
716 ; EG-NEXT: ALU clause starting at 4:
717 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
718 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].Z,
719 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
720 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
722 %fdiv = fdiv fast float %a, %b, !fpmath !0
723 store float %fdiv, ptr addrspace(1) %out
727 define amdgpu_kernel void @s_fdiv_f32_arcp_daz(ptr addrspace(1) %out, float %a, float %b) #0 {
728 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_arcp_daz:
729 ; GFX6-FASTFMA: ; %bb.0: ; %entry
730 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
731 ; GFX6-FASTFMA-NEXT: s_mov_b32 s7, 0xf000
732 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, -1
733 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
734 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s2
735 ; GFX6-FASTFMA-NEXT: s_mov_b32 s4, s0
736 ; GFX6-FASTFMA-NEXT: s_mov_b32 s5, s1
737 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[0:1], s3, s3, v1
738 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
739 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s3
740 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
741 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
742 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
743 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
744 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v0, v3
745 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, v0
746 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v3, v4
747 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v4, v0
748 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
749 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v3, v4
750 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s3, v1
751 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
752 ; GFX6-FASTFMA-NEXT: s_endpgm
754 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_arcp_daz:
755 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
756 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
757 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s7, 0xf000
758 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, -1
759 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
760 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s2
761 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
762 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s3
763 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
764 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s4, s0
765 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s5, s1
766 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
767 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
768 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
769 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
770 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
771 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
772 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
773 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
774 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
775 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
776 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s3, v0
777 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[4:7], 0
778 ; GFX6-SLOWFMA-NEXT: s_endpgm
780 ; GFX7-LABEL: s_fdiv_f32_arcp_daz:
781 ; GFX7: ; %bb.0: ; %entry
782 ; GFX7-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
783 ; GFX7-NEXT: s_mov_b32 s7, 0xf000
784 ; GFX7-NEXT: s_mov_b32 s6, -1
785 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
786 ; GFX7-NEXT: v_mov_b32_e32 v1, s2
787 ; GFX7-NEXT: s_mov_b32 s4, s0
788 ; GFX7-NEXT: s_mov_b32 s5, s1
789 ; GFX7-NEXT: v_div_scale_f32 v2, s[0:1], s3, s3, v1
790 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
791 ; GFX7-NEXT: v_mov_b32_e32 v0, s3
792 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
793 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
794 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
795 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
796 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
797 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
798 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
799 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
800 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
801 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
802 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s3, v1
803 ; GFX7-NEXT: buffer_store_dword v0, off, s[4:7], 0
804 ; GFX7-NEXT: s_endpgm
806 ; GFX8-LABEL: s_fdiv_f32_arcp_daz:
807 ; GFX8: ; %bb.0: ; %entry
808 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
809 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
810 ; GFX8-NEXT: v_mov_b32_e32 v0, s2
811 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s3, s3, v0
812 ; GFX8-NEXT: v_mov_b32_e32 v2, s3
813 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s2, v2, s2
814 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
815 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
816 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
817 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
818 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
819 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
820 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
821 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
822 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
823 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
824 ; GFX8-NEXT: v_div_fixup_f32 v2, v1, s3, v0
825 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
826 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
827 ; GFX8-NEXT: flat_store_dword v[0:1], v2
828 ; GFX8-NEXT: s_endpgm
830 ; GFX10-LABEL: s_fdiv_f32_arcp_daz:
831 ; GFX10: ; %bb.0: ; %entry
832 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
833 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
834 ; GFX10-NEXT: v_div_scale_f32 v0, s4, s3, s3, s2
835 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
836 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
837 ; GFX10-NEXT: s_denorm_mode 15
838 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
839 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
840 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
841 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
842 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
843 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
844 ; GFX10-NEXT: s_denorm_mode 12
845 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
846 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
847 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s3, s2
848 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
849 ; GFX10-NEXT: s_endpgm
851 ; GFX11-LABEL: s_fdiv_f32_arcp_daz:
852 ; GFX11: ; %bb.0: ; %entry
853 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
854 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
855 ; GFX11-NEXT: v_div_scale_f32 v0, null, s3, s3, s2
856 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s2, s3, s2
857 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
858 ; GFX11-NEXT: s_denorm_mode 15
859 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
860 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
861 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
862 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
863 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
864 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
865 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
866 ; GFX11-NEXT: s_denorm_mode 12
867 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
868 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
869 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s3, s2
870 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
871 ; GFX11-NEXT: s_nop 0
872 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
873 ; GFX11-NEXT: s_endpgm
875 ; EG-LABEL: s_fdiv_f32_arcp_daz:
876 ; EG: ; %bb.0: ; %entry
877 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
878 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
881 ; EG-NEXT: ALU clause starting at 4:
882 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
883 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].Z, PS,
884 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
885 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
887 %fdiv = fdiv arcp float %a, %b
888 store float %fdiv, ptr addrspace(1) %out
892 define amdgpu_kernel void @s_fdiv_f32_arcp_ninf(ptr addrspace(1) %out, float %a, float %b) #0 {
893 ; GFX67-LABEL: s_fdiv_f32_arcp_ninf:
894 ; GFX67: ; %bb.0: ; %entry
895 ; GFX67-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
896 ; GFX67-NEXT: s_mov_b32 s7, 0xf000
897 ; GFX67-NEXT: s_mov_b32 s6, -1
898 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
899 ; GFX67-NEXT: v_rcp_f32_e32 v0, s3
900 ; GFX67-NEXT: s_mov_b32 s4, s0
901 ; GFX67-NEXT: s_mov_b32 s5, s1
902 ; GFX67-NEXT: v_mul_f32_e32 v0, s2, v0
903 ; GFX67-NEXT: buffer_store_dword v0, off, s[4:7], 0
904 ; GFX67-NEXT: s_endpgm
906 ; GFX8-LABEL: s_fdiv_f32_arcp_ninf:
907 ; GFX8: ; %bb.0: ; %entry
908 ; GFX8-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
909 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
910 ; GFX8-NEXT: v_rcp_f32_e32 v0, s3
911 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v0
912 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
913 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
914 ; GFX8-NEXT: flat_store_dword v[0:1], v2
915 ; GFX8-NEXT: s_endpgm
917 ; GFX10-LABEL: s_fdiv_f32_arcp_ninf:
918 ; GFX10: ; %bb.0: ; %entry
919 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
920 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
921 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
922 ; GFX10-NEXT: v_rcp_f32_e32 v0, s3
923 ; GFX10-NEXT: v_mul_f32_e32 v0, s2, v0
924 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
925 ; GFX10-NEXT: s_endpgm
927 ; GFX11-LABEL: s_fdiv_f32_arcp_ninf:
928 ; GFX11: ; %bb.0: ; %entry
929 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
930 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
931 ; GFX11-NEXT: v_rcp_f32_e32 v0, s3
932 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
933 ; GFX11-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mul_f32 v0, s2, v0
934 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
935 ; GFX11-NEXT: s_nop 0
936 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
937 ; GFX11-NEXT: s_endpgm
939 ; EG-LABEL: s_fdiv_f32_arcp_ninf:
940 ; EG: ; %bb.0: ; %entry
941 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
942 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
945 ; EG-NEXT: ALU clause starting at 4:
946 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[2].W,
947 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].Z,
948 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
949 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
951 %fdiv = fdiv arcp ninf float %a, %b
952 store float %fdiv, ptr addrspace(1) %out
956 define amdgpu_kernel void @s_fdiv_v2f32(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
957 ; GFX6-FASTFMA-LABEL: s_fdiv_v2f32:
958 ; GFX6-FASTFMA: ; %bb.0: ; %entry
959 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
960 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
961 ; GFX6-FASTFMA-NEXT: s_mov_b32 s3, 0xf000
962 ; GFX6-FASTFMA-NEXT: s_mov_b32 s2, -1
963 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
964 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s5
965 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[8:9], s7, s7, v1
966 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
967 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s7
968 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s5, v0, s5
969 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
970 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
971 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
972 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v0, v3
973 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, v0
974 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v3, v4
975 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v4, v0
976 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
977 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v2, s4
978 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v3, v4
979 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[8:9], s6, s6, v2
980 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
981 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v1, v0, s7, v1
982 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s6
983 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s4, v0, s4
984 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
985 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v3, v4, 1.0
986 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
987 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v0, v4
988 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v5, v0
989 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v4, v5
990 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v3, v5, v0
991 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
992 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v4, v5
993 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s6, v2
994 ; GFX6-FASTFMA-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
995 ; GFX6-FASTFMA-NEXT: s_endpgm
997 ; GFX6-SLOWFMA-LABEL: s_fdiv_v2f32:
998 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
999 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
1000 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1001 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1002 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s5
1003 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[2:3], s7, s7, v0
1004 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s7
1005 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s5, v2, s5
1006 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v4, s4
1007 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
1008 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1009 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1010 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v5, v3, v3
1011 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v2, v3
1012 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v1, v5, v2
1013 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v3, v5
1014 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v5, v2
1015 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1016 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[2:3], s6, s6, v4
1017 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1018 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v3, s6
1019 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, s4, v3, s4
1020 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s3, 0xf000
1021 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s2, -1
1022 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v2
1023 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v1, v1, s7, v0
1024 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1025 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v2, v5, 1.0
1026 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v5, v5
1027 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v0
1028 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
1029 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v0, v5
1030 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
1031 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1032 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v2, v0, v5
1033 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s6, v4
1034 ; GFX6-SLOWFMA-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1035 ; GFX6-SLOWFMA-NEXT: s_endpgm
1037 ; GFX7-LABEL: s_fdiv_v2f32:
1038 ; GFX7: ; %bb.0: ; %entry
1039 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
1040 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1041 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
1042 ; GFX7-NEXT: s_mov_b32 s2, -1
1043 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1044 ; GFX7-NEXT: v_mov_b32_e32 v1, s5
1045 ; GFX7-NEXT: v_div_scale_f32 v2, s[8:9], s7, s7, v1
1046 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
1047 ; GFX7-NEXT: v_mov_b32_e32 v0, s7
1048 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s5, v0, s5
1049 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1050 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1051 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
1052 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
1053 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
1054 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
1055 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
1056 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1057 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
1058 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1059 ; GFX7-NEXT: v_div_scale_f32 v3, s[8:9], s6, s6, v2
1060 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
1061 ; GFX7-NEXT: v_div_fixup_f32 v1, v0, s7, v1
1062 ; GFX7-NEXT: v_mov_b32_e32 v0, s6
1063 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s4, v0, s4
1064 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1065 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
1066 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
1067 ; GFX7-NEXT: v_mul_f32_e32 v5, v0, v4
1068 ; GFX7-NEXT: v_fma_f32 v6, -v3, v5, v0
1069 ; GFX7-NEXT: v_fma_f32 v5, v6, v4, v5
1070 ; GFX7-NEXT: v_fma_f32 v0, -v3, v5, v0
1071 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1072 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1073 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, v2
1074 ; GFX7-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1075 ; GFX7-NEXT: s_endpgm
1077 ; GFX8-LABEL: s_fdiv_v2f32:
1078 ; GFX8: ; %bb.0: ; %entry
1079 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1080 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1081 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1082 ; GFX8-NEXT: v_mov_b32_e32 v0, s5
1083 ; GFX8-NEXT: v_div_scale_f32 v1, s[2:3], s7, s7, v0
1084 ; GFX8-NEXT: v_mov_b32_e32 v2, s7
1085 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s5, v2, s5
1086 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
1087 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
1088 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1089 ; GFX8-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1090 ; GFX8-NEXT: v_fma_f32 v3, v5, v3, v3
1091 ; GFX8-NEXT: v_mul_f32_e32 v5, v2, v3
1092 ; GFX8-NEXT: v_fma_f32 v6, -v1, v5, v2
1093 ; GFX8-NEXT: v_fma_f32 v5, v6, v3, v5
1094 ; GFX8-NEXT: v_fma_f32 v1, -v1, v5, v2
1095 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1096 ; GFX8-NEXT: v_div_scale_f32 v2, s[2:3], s6, s6, v4
1097 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1098 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1099 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, s4, v3, s4
1100 ; GFX8-NEXT: v_rcp_f32_e32 v5, v2
1101 ; GFX8-NEXT: v_div_fixup_f32 v1, v1, s7, v0
1102 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1103 ; GFX8-NEXT: v_fma_f32 v0, -v2, v5, 1.0
1104 ; GFX8-NEXT: v_fma_f32 v0, v0, v5, v5
1105 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v0
1106 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
1107 ; GFX8-NEXT: v_fma_f32 v5, v6, v0, v5
1108 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
1109 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1110 ; GFX8-NEXT: v_div_fmas_f32 v0, v2, v0, v5
1111 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1112 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1113 ; GFX8-NEXT: v_div_fixup_f32 v0, v0, s6, v4
1114 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1115 ; GFX8-NEXT: s_endpgm
1117 ; GFX10-LABEL: s_fdiv_v2f32:
1118 ; GFX10: ; %bb.0: ; %entry
1119 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1120 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1121 ; GFX10-NEXT: v_div_scale_f32 v0, s2, s7, s7, s5
1122 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s5, s7, s5
1123 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1124 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
1125 ; GFX10-NEXT: s_denorm_mode 15
1126 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1127 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
1128 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
1129 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
1130 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
1131 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
1132 ; GFX10-NEXT: s_denorm_mode 12
1133 ; GFX10-NEXT: v_div_scale_f32 v2, s2, s6, s6, s4
1134 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1135 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
1136 ; GFX10-NEXT: v_div_fixup_f32 v1, v0, s7, s5
1137 ; GFX10-NEXT: v_div_scale_f32 v0, vcc_lo, s4, s6, s4
1138 ; GFX10-NEXT: s_denorm_mode 15
1139 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1140 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
1141 ; GFX10-NEXT: v_mul_f32_e32 v4, v0, v3
1142 ; GFX10-NEXT: v_fma_f32 v5, -v2, v4, v0
1143 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v3
1144 ; GFX10-NEXT: v_fma_f32 v0, -v2, v4, v0
1145 ; GFX10-NEXT: s_denorm_mode 12
1146 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
1147 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1148 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s6, s4
1149 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1150 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1151 ; GFX10-NEXT: s_endpgm
1153 ; GFX11-LABEL: s_fdiv_v2f32:
1154 ; GFX11: ; %bb.0: ; %entry
1155 ; GFX11-NEXT: s_clause 0x1
1156 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
1157 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1158 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1159 ; GFX11-NEXT: v_div_scale_f32 v0, null, s7, s7, s5
1160 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s5, s7, s5
1161 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
1162 ; GFX11-NEXT: s_denorm_mode 15
1163 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1164 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1165 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
1166 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
1167 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
1168 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
1169 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
1170 ; GFX11-NEXT: s_denorm_mode 12
1171 ; GFX11-NEXT: v_div_scale_f32 v2, null, s6, s6, s4
1172 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1173 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
1174 ; GFX11-NEXT: v_div_fixup_f32 v1, v0, s7, s5
1175 ; GFX11-NEXT: v_div_scale_f32 v0, vcc_lo, s4, s6, s4
1176 ; GFX11-NEXT: s_denorm_mode 15
1177 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1178 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1179 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
1180 ; GFX11-NEXT: v_mul_f32_e32 v4, v0, v3
1181 ; GFX11-NEXT: v_fma_f32 v5, -v2, v4, v0
1182 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v3
1183 ; GFX11-NEXT: v_fma_f32 v0, -v2, v4, v0
1184 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1185 ; GFX11-NEXT: s_denorm_mode 12
1186 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1187 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s6, s4
1188 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1189 ; GFX11-NEXT: s_nop 0
1190 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1191 ; GFX11-NEXT: s_endpgm
1193 ; EG-LABEL: s_fdiv_v2f32:
1194 ; EG: ; %bb.0: ; %entry
1195 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1196 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1199 ; EG-NEXT: ALU clause starting at 4:
1200 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1201 ; EG-NEXT: MUL_IEEE T0.Y, KC0[3].X, PS,
1202 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1203 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].W, PS,
1204 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1205 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1207 %fdiv = fdiv <2 x float> %a, %b
1208 store <2 x float> %fdiv, ptr addrspace(1) %out
1212 define amdgpu_kernel void @s_fdiv_ulp25_v2f32(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1213 ; GFX67-LABEL: s_fdiv_ulp25_v2f32:
1214 ; GFX67: ; %bb.0: ; %entry
1215 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
1216 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1217 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1218 ; GFX67-NEXT: s_mov_b32 s2, -1
1219 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1220 ; GFX67-NEXT: v_rcp_f32_e32 v0, s6
1221 ; GFX67-NEXT: v_rcp_f32_e32 v1, s7
1222 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v0
1223 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v1
1224 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1225 ; GFX67-NEXT: s_endpgm
1227 ; GFX8-LABEL: s_fdiv_ulp25_v2f32:
1228 ; GFX8: ; %bb.0: ; %entry
1229 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1230 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1231 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1232 ; GFX8-NEXT: v_rcp_f32_e32 v0, s6
1233 ; GFX8-NEXT: v_rcp_f32_e32 v1, s7
1234 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1235 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1236 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v0
1237 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v1
1238 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1239 ; GFX8-NEXT: s_endpgm
1241 ; GFX10-LABEL: s_fdiv_ulp25_v2f32:
1242 ; GFX10: ; %bb.0: ; %entry
1243 ; GFX10-NEXT: s_clause 0x1
1244 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1245 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1246 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
1247 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1248 ; GFX10-NEXT: v_rcp_f32_e32 v0, s6
1249 ; GFX10-NEXT: v_rcp_f32_e32 v1, s7
1250 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v0
1251 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v1
1252 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1253 ; GFX10-NEXT: s_endpgm
1255 ; GFX11-LABEL: s_fdiv_ulp25_v2f32:
1256 ; GFX11: ; %bb.0: ; %entry
1257 ; GFX11-NEXT: s_clause 0x1
1258 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
1259 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1260 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1261 ; GFX11-NEXT: v_rcp_f32_e32 v0, s6
1262 ; GFX11-NEXT: v_rcp_f32_e32 v1, s7
1263 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1264 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1265 ; GFX11-NEXT: v_dual_mul_f32 v0, s4, v0 :: v_dual_mul_f32 v1, s5, v1
1266 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1267 ; GFX11-NEXT: s_nop 0
1268 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1269 ; GFX11-NEXT: s_endpgm
1271 ; EG-LABEL: s_fdiv_ulp25_v2f32:
1272 ; EG: ; %bb.0: ; %entry
1273 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1274 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1277 ; EG-NEXT: ALU clause starting at 4:
1278 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1279 ; EG-NEXT: MUL_IEEE T0.Y, KC0[3].X, PS,
1280 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1281 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].W, PS,
1282 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1283 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1285 %fdiv = fdiv arcp <2 x float> %a, %b, !fpmath !0
1286 store <2 x float> %fdiv, ptr addrspace(1) %out
1290 define amdgpu_kernel void @s_fdiv_v2f32_fast_math(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1291 ; GFX67-LABEL: s_fdiv_v2f32_fast_math:
1292 ; GFX67: ; %bb.0: ; %entry
1293 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
1294 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1295 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1296 ; GFX67-NEXT: s_mov_b32 s2, -1
1297 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1298 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1299 ; GFX67-NEXT: v_rcp_f32_e32 v2, s6
1300 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v0
1301 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v2
1302 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1303 ; GFX67-NEXT: s_endpgm
1305 ; GFX8-LABEL: s_fdiv_v2f32_fast_math:
1306 ; GFX8: ; %bb.0: ; %entry
1307 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1308 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1309 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1310 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1311 ; GFX8-NEXT: v_rcp_f32_e32 v2, s6
1312 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v0
1313 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v2
1314 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1315 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1316 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1317 ; GFX8-NEXT: s_endpgm
1319 ; GFX10-LABEL: s_fdiv_v2f32_fast_math:
1320 ; GFX10: ; %bb.0: ; %entry
1321 ; GFX10-NEXT: s_clause 0x1
1322 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1323 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1324 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
1325 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1326 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1327 ; GFX10-NEXT: v_rcp_f32_e32 v2, s6
1328 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v0
1329 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v2
1330 ; GFX10-NEXT: global_store_dwordx2 v3, v[0:1], s[2:3]
1331 ; GFX10-NEXT: s_endpgm
1333 ; GFX11-LABEL: s_fdiv_v2f32_fast_math:
1334 ; GFX11: ; %bb.0: ; %entry
1335 ; GFX11-NEXT: s_clause 0x1
1336 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
1337 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1338 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1339 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1340 ; GFX11-NEXT: v_rcp_f32_e32 v2, s6
1341 ; GFX11-NEXT: v_mov_b32_e32 v3, 0
1342 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1343 ; GFX11-NEXT: v_dual_mul_f32 v1, s5, v0 :: v_dual_mul_f32 v0, s4, v2
1344 ; GFX11-NEXT: global_store_b64 v3, v[0:1], s[0:1]
1345 ; GFX11-NEXT: s_nop 0
1346 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1347 ; GFX11-NEXT: s_endpgm
1349 ; EG-LABEL: s_fdiv_v2f32_fast_math:
1350 ; EG: ; %bb.0: ; %entry
1351 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1352 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1355 ; EG-NEXT: ALU clause starting at 4:
1356 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1357 ; EG-NEXT: MUL_IEEE T0.Y, PS, KC0[3].X,
1358 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1359 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].W,
1360 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1361 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1363 %fdiv = fdiv fast <2 x float> %a, %b
1364 store <2 x float> %fdiv, ptr addrspace(1) %out
1368 define amdgpu_kernel void @s_fdiv_v2f32_arcp_math(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1369 ; GFX67-LABEL: s_fdiv_v2f32_arcp_math:
1370 ; GFX67: ; %bb.0: ; %entry
1371 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
1372 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1373 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1374 ; GFX67-NEXT: s_mov_b32 s2, -1
1375 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1376 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1377 ; GFX67-NEXT: v_rcp_f32_e32 v2, s6
1378 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v0
1379 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v2
1380 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1381 ; GFX67-NEXT: s_endpgm
1383 ; GFX8-LABEL: s_fdiv_v2f32_arcp_math:
1384 ; GFX8: ; %bb.0: ; %entry
1385 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1386 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1387 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1388 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1389 ; GFX8-NEXT: v_rcp_f32_e32 v2, s6
1390 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v0
1391 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v2
1392 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1393 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1394 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1395 ; GFX8-NEXT: s_endpgm
1397 ; GFX10-LABEL: s_fdiv_v2f32_arcp_math:
1398 ; GFX10: ; %bb.0: ; %entry
1399 ; GFX10-NEXT: s_clause 0x1
1400 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
1401 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1402 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
1403 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1404 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1405 ; GFX10-NEXT: v_rcp_f32_e32 v2, s6
1406 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v0
1407 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v2
1408 ; GFX10-NEXT: global_store_dwordx2 v3, v[0:1], s[2:3]
1409 ; GFX10-NEXT: s_endpgm
1411 ; GFX11-LABEL: s_fdiv_v2f32_arcp_math:
1412 ; GFX11: ; %bb.0: ; %entry
1413 ; GFX11-NEXT: s_clause 0x1
1414 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
1415 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1416 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1417 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1418 ; GFX11-NEXT: v_rcp_f32_e32 v2, s6
1419 ; GFX11-NEXT: v_mov_b32_e32 v3, 0
1420 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1421 ; GFX11-NEXT: v_dual_mul_f32 v1, s5, v0 :: v_dual_mul_f32 v0, s4, v2
1422 ; GFX11-NEXT: global_store_b64 v3, v[0:1], s[0:1]
1423 ; GFX11-NEXT: s_nop 0
1424 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1425 ; GFX11-NEXT: s_endpgm
1427 ; EG-LABEL: s_fdiv_v2f32_arcp_math:
1428 ; EG: ; %bb.0: ; %entry
1429 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1430 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1433 ; EG-NEXT: ALU clause starting at 4:
1434 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1435 ; EG-NEXT: MUL_IEEE T0.Y, PS, KC0[3].X,
1436 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1437 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].W,
1438 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1439 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1441 %fdiv = fdiv arcp ninf <2 x float> %a, %b
1442 store <2 x float> %fdiv, ptr addrspace(1) %out
1446 define amdgpu_kernel void @s_fdiv_v4f32(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
1447 ; GFX6-FASTFMA-LABEL: s_fdiv_v4f32:
1448 ; GFX6-FASTFMA: ; %bb.0:
1449 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
1450 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
1451 ; GFX6-FASTFMA-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1452 ; GFX6-FASTFMA-NEXT: s_mov_b32 s11, 0xf000
1453 ; GFX6-FASTFMA-NEXT: s_mov_b32 s10, -1
1454 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
1455 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s3
1456 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[12:13], s7, s7, v1
1457 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
1458 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s7
1459 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s3, v0, s3
1460 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1461 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1462 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
1463 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v0, v3
1464 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, v0
1465 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v3, v4
1466 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v4, v0
1467 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1468 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1469 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v3, v0, s7, v1
1470 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s2
1471 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[12:13], s6, s6, v1
1472 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v2
1473 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s6
1474 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
1475 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1476 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
1477 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
1478 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v0, v4
1479 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v0
1480 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v4, v5
1481 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v5, v0
1482 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1483 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1484 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v2, v0, s6, v1
1485 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s1
1486 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, s[2:3], s5, s5, v1
1487 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v5, v4
1488 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s5
1489 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s1, v0, s1
1490 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1491 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1492 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v5, v5
1493 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v0, v5
1494 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v4, v6, v0
1495 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v5, v6
1496 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v4, v6, v0
1497 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1498 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v4, s0
1499 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1500 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v4
1501 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v6, v5
1502 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v1, v0, s5, v1
1503 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s4
1504 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s0, v0, s0
1505 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1506 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v5, v6, 1.0
1507 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v6, v6
1508 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v7, v0, v6
1509 ; GFX6-FASTFMA-NEXT: v_fma_f32 v8, -v5, v7, v0
1510 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, v8, v6, v7
1511 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v5, v7, v0
1512 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1513 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v6, v7
1514 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s4, v4
1515 ; GFX6-FASTFMA-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1516 ; GFX6-FASTFMA-NEXT: s_endpgm
1518 ; GFX6-SLOWFMA-LABEL: s_fdiv_v4f32:
1519 ; GFX6-SLOWFMA: ; %bb.0:
1520 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
1521 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1522 ; GFX6-SLOWFMA-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1523 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1524 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s3
1525 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[10:11], s7, s7, v0
1526 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s7
1527 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s3, v2, s3
1528 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v4, s2
1529 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v7, s1
1530 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v8, s0
1531 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
1532 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1533 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1534 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v5, v3, v3
1535 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v2, v3
1536 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v1, v5, v2
1537 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v3, v5
1538 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v5, v2
1539 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1540 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[10:11], s6, s6, v4
1541 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1542 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v3, s6
1543 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, vcc, s2, v3, s2
1544 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s11, 0xf000
1545 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s10, -1
1546 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v2
1547 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v3, v1, s7, v0
1548 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1549 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v2, v6, 1.0
1550 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1551 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v1, v5, v0
1552 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v1, v5
1553 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, v6, v0, v1
1554 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v1, v5
1555 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1556 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, s[2:3], s5, s5, v7
1557 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v2, v0, v1
1558 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v1, s5
1559 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, s1, v1, s1
1560 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v5
1561 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v2, v0, s6, v4
1562 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1563 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1564 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1565 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v1, v0
1566 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v5, v4, v1
1567 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v6, v0, v4
1568 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v5, v4, v1
1569 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1570 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v8
1571 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v1, v0, v4
1572 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v1, s4
1573 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, s0, v1, s0
1574 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v5
1575 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v1, v0, s5, v7
1576 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1577 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1578 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1579 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v0
1580 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v5, v6, v4
1581 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v0, v6
1582 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v5, v6, v4
1583 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1584 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v4, v0, v6
1585 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, v8
1586 ; GFX6-SLOWFMA-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1587 ; GFX6-SLOWFMA-NEXT: s_endpgm
1589 ; GFX7-LABEL: s_fdiv_v4f32:
1591 ; GFX7-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
1592 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1593 ; GFX7-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1594 ; GFX7-NEXT: s_mov_b32 s11, 0xf000
1595 ; GFX7-NEXT: s_mov_b32 s10, -1
1596 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1597 ; GFX7-NEXT: v_mov_b32_e32 v1, s3
1598 ; GFX7-NEXT: v_div_scale_f32 v2, s[12:13], s7, s7, v1
1599 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
1600 ; GFX7-NEXT: v_mov_b32_e32 v0, s7
1601 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s3, v0, s3
1602 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1603 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1604 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
1605 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
1606 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
1607 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
1608 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
1609 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1610 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1611 ; GFX7-NEXT: v_div_fixup_f32 v3, v0, s7, v1
1612 ; GFX7-NEXT: v_mov_b32_e32 v1, s2
1613 ; GFX7-NEXT: v_div_scale_f32 v2, s[12:13], s6, s6, v1
1614 ; GFX7-NEXT: v_rcp_f32_e32 v4, v2
1615 ; GFX7-NEXT: v_mov_b32_e32 v0, s6
1616 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
1617 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1618 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, 1.0
1619 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
1620 ; GFX7-NEXT: v_mul_f32_e32 v5, v0, v4
1621 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v0
1622 ; GFX7-NEXT: v_fma_f32 v5, v6, v4, v5
1623 ; GFX7-NEXT: v_fma_f32 v0, -v2, v5, v0
1624 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1625 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1626 ; GFX7-NEXT: v_div_fixup_f32 v2, v0, s6, v1
1627 ; GFX7-NEXT: v_mov_b32_e32 v1, s1
1628 ; GFX7-NEXT: v_div_scale_f32 v4, s[2:3], s5, s5, v1
1629 ; GFX7-NEXT: v_rcp_f32_e32 v5, v4
1630 ; GFX7-NEXT: v_mov_b32_e32 v0, s5
1631 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s1, v0, s1
1632 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1633 ; GFX7-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1634 ; GFX7-NEXT: v_fma_f32 v5, v6, v5, v5
1635 ; GFX7-NEXT: v_mul_f32_e32 v6, v0, v5
1636 ; GFX7-NEXT: v_fma_f32 v7, -v4, v6, v0
1637 ; GFX7-NEXT: v_fma_f32 v6, v7, v5, v6
1638 ; GFX7-NEXT: v_fma_f32 v0, -v4, v6, v0
1639 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1640 ; GFX7-NEXT: v_mov_b32_e32 v4, s0
1641 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1642 ; GFX7-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v4
1643 ; GFX7-NEXT: v_rcp_f32_e32 v6, v5
1644 ; GFX7-NEXT: v_div_fixup_f32 v1, v0, s5, v1
1645 ; GFX7-NEXT: v_mov_b32_e32 v0, s4
1646 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s0, v0, s0
1647 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1648 ; GFX7-NEXT: v_fma_f32 v7, -v5, v6, 1.0
1649 ; GFX7-NEXT: v_fma_f32 v6, v7, v6, v6
1650 ; GFX7-NEXT: v_mul_f32_e32 v7, v0, v6
1651 ; GFX7-NEXT: v_fma_f32 v8, -v5, v7, v0
1652 ; GFX7-NEXT: v_fma_f32 v7, v8, v6, v7
1653 ; GFX7-NEXT: v_fma_f32 v0, -v5, v7, v0
1654 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1655 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v6, v7
1656 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s4, v4
1657 ; GFX7-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1658 ; GFX7-NEXT: s_endpgm
1660 ; GFX8-LABEL: s_fdiv_v4f32:
1662 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
1663 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1664 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1665 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1666 ; GFX8-NEXT: v_mov_b32_e32 v0, s3
1667 ; GFX8-NEXT: v_div_scale_f32 v1, s[10:11], s7, s7, v0
1668 ; GFX8-NEXT: v_mov_b32_e32 v2, s7
1669 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s3, v2, s3
1670 ; GFX8-NEXT: v_mov_b32_e32 v4, s2
1671 ; GFX8-NEXT: v_mov_b32_e32 v7, s1
1672 ; GFX8-NEXT: v_mov_b32_e32 v8, s0
1673 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
1674 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1675 ; GFX8-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1676 ; GFX8-NEXT: v_fma_f32 v3, v5, v3, v3
1677 ; GFX8-NEXT: v_mul_f32_e32 v5, v2, v3
1678 ; GFX8-NEXT: v_fma_f32 v6, -v1, v5, v2
1679 ; GFX8-NEXT: v_fma_f32 v5, v6, v3, v5
1680 ; GFX8-NEXT: v_fma_f32 v1, -v1, v5, v2
1681 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1682 ; GFX8-NEXT: v_div_scale_f32 v2, s[10:11], s6, s6, v4
1683 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1684 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1685 ; GFX8-NEXT: v_div_scale_f32 v5, vcc, s2, v3, s2
1686 ; GFX8-NEXT: v_rcp_f32_e32 v6, v2
1687 ; GFX8-NEXT: v_div_fixup_f32 v3, v1, s7, v0
1688 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1689 ; GFX8-NEXT: v_fma_f32 v0, -v2, v6, 1.0
1690 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1691 ; GFX8-NEXT: v_mul_f32_e32 v1, v5, v0
1692 ; GFX8-NEXT: v_fma_f32 v6, -v2, v1, v5
1693 ; GFX8-NEXT: v_fma_f32 v1, v6, v0, v1
1694 ; GFX8-NEXT: v_fma_f32 v2, -v2, v1, v5
1695 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1696 ; GFX8-NEXT: v_div_scale_f32 v5, s[2:3], s5, s5, v7
1697 ; GFX8-NEXT: v_div_fmas_f32 v0, v2, v0, v1
1698 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
1699 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, s1, v1, s1
1700 ; GFX8-NEXT: v_rcp_f32_e32 v6, v5
1701 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s6, v4
1702 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1703 ; GFX8-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1704 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1705 ; GFX8-NEXT: v_mul_f32_e32 v4, v1, v0
1706 ; GFX8-NEXT: v_fma_f32 v6, -v5, v4, v1
1707 ; GFX8-NEXT: v_fma_f32 v4, v6, v0, v4
1708 ; GFX8-NEXT: v_fma_f32 v1, -v5, v4, v1
1709 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1710 ; GFX8-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v8
1711 ; GFX8-NEXT: v_div_fmas_f32 v0, v1, v0, v4
1712 ; GFX8-NEXT: v_mov_b32_e32 v1, s4
1713 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, s0, v1, s0
1714 ; GFX8-NEXT: v_rcp_f32_e32 v6, v5
1715 ; GFX8-NEXT: v_div_fixup_f32 v1, v0, s5, v7
1716 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1717 ; GFX8-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1718 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1719 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v0
1720 ; GFX8-NEXT: v_fma_f32 v7, -v5, v6, v4
1721 ; GFX8-NEXT: v_fma_f32 v6, v7, v0, v6
1722 ; GFX8-NEXT: v_fma_f32 v4, -v5, v6, v4
1723 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1724 ; GFX8-NEXT: v_div_fmas_f32 v0, v4, v0, v6
1725 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
1726 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
1727 ; GFX8-NEXT: v_div_fixup_f32 v0, v0, s4, v8
1728 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
1729 ; GFX8-NEXT: s_endpgm
1731 ; GFX10-LABEL: s_fdiv_v4f32:
1733 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
1734 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1735 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1736 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1737 ; GFX10-NEXT: v_div_scale_f32 v0, s10, s7, s7, s3
1738 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s3, s7, s3
1739 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
1740 ; GFX10-NEXT: s_denorm_mode 15
1741 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1742 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
1743 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
1744 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
1745 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
1746 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
1747 ; GFX10-NEXT: s_denorm_mode 12
1748 ; GFX10-NEXT: v_div_scale_f32 v2, s10, s6, s6, s2
1749 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1750 ; GFX10-NEXT: v_div_scale_f32 v1, vcc_lo, s2, s6, s2
1751 ; GFX10-NEXT: v_rcp_f32_e32 v4, v2
1752 ; GFX10-NEXT: v_div_fixup_f32 v3, v0, s7, s3
1753 ; GFX10-NEXT: s_denorm_mode 15
1754 ; GFX10-NEXT: v_fma_f32 v0, -v2, v4, 1.0
1755 ; GFX10-NEXT: v_fmac_f32_e32 v4, v0, v4
1756 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v4
1757 ; GFX10-NEXT: v_fma_f32 v5, -v2, v0, v1
1758 ; GFX10-NEXT: v_fmac_f32_e32 v0, v5, v4
1759 ; GFX10-NEXT: v_fma_f32 v1, -v2, v0, v1
1760 ; GFX10-NEXT: s_denorm_mode 12
1761 ; GFX10-NEXT: v_div_scale_f32 v5, s3, s5, s5, s1
1762 ; GFX10-NEXT: v_div_fmas_f32 v0, v1, v4, v0
1763 ; GFX10-NEXT: v_div_scale_f32 v1, vcc_lo, s1, s5, s1
1764 ; GFX10-NEXT: v_rcp_f32_e32 v6, v5
1765 ; GFX10-NEXT: v_div_fixup_f32 v2, v0, s6, s2
1766 ; GFX10-NEXT: s_denorm_mode 15
1767 ; GFX10-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1768 ; GFX10-NEXT: v_fmac_f32_e32 v6, v0, v6
1769 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v6
1770 ; GFX10-NEXT: v_fma_f32 v4, -v5, v0, v1
1771 ; GFX10-NEXT: v_fmac_f32_e32 v0, v4, v6
1772 ; GFX10-NEXT: v_fma_f32 v1, -v5, v0, v1
1773 ; GFX10-NEXT: s_denorm_mode 12
1774 ; GFX10-NEXT: v_div_scale_f32 v4, s2, s4, s4, s0
1775 ; GFX10-NEXT: v_div_fmas_f32 v0, v1, v6, v0
1776 ; GFX10-NEXT: v_rcp_f32_e32 v5, v4
1777 ; GFX10-NEXT: v_div_fixup_f32 v1, v0, s5, s1
1778 ; GFX10-NEXT: v_div_scale_f32 v0, vcc_lo, s0, s4, s0
1779 ; GFX10-NEXT: s_denorm_mode 15
1780 ; GFX10-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1781 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v5
1782 ; GFX10-NEXT: v_mul_f32_e32 v6, v0, v5
1783 ; GFX10-NEXT: v_fma_f32 v7, -v4, v6, v0
1784 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v5
1785 ; GFX10-NEXT: v_fma_f32 v0, -v4, v6, v0
1786 ; GFX10-NEXT: s_denorm_mode 12
1787 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
1788 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1789 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s4, s0
1790 ; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[8:9]
1791 ; GFX10-NEXT: s_endpgm
1793 ; GFX11-LABEL: s_fdiv_v4f32:
1795 ; GFX11-NEXT: s_load_b128 s[8:11], s[0:1], 0x24
1796 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1797 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
1798 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1799 ; GFX11-NEXT: v_div_scale_f32 v0, null, s7, s7, s3
1800 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s3, s7, s3
1801 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
1802 ; GFX11-NEXT: s_denorm_mode 15
1803 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1804 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1805 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
1806 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
1807 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
1808 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
1809 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
1810 ; GFX11-NEXT: s_denorm_mode 12
1811 ; GFX11-NEXT: v_div_scale_f32 v2, null, s6, s6, s2
1812 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1813 ; GFX11-NEXT: v_div_scale_f32 v1, vcc_lo, s2, s6, s2
1814 ; GFX11-NEXT: v_rcp_f32_e32 v4, v2
1815 ; GFX11-NEXT: v_div_fixup_f32 v3, v0, s7, s3
1816 ; GFX11-NEXT: s_denorm_mode 15
1817 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1818 ; GFX11-NEXT: v_fma_f32 v0, -v2, v4, 1.0
1819 ; GFX11-NEXT: v_fmac_f32_e32 v4, v0, v4
1820 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v4
1821 ; GFX11-NEXT: v_fma_f32 v5, -v2, v0, v1
1822 ; GFX11-NEXT: v_fmac_f32_e32 v0, v5, v4
1823 ; GFX11-NEXT: v_fma_f32 v1, -v2, v0, v1
1824 ; GFX11-NEXT: s_denorm_mode 12
1825 ; GFX11-NEXT: v_div_scale_f32 v5, null, s5, s5, s1
1826 ; GFX11-NEXT: v_div_fmas_f32 v0, v1, v4, v0
1827 ; GFX11-NEXT: v_div_scale_f32 v1, vcc_lo, s1, s5, s1
1828 ; GFX11-NEXT: v_rcp_f32_e32 v6, v5
1829 ; GFX11-NEXT: v_div_fixup_f32 v2, v0, s6, s2
1830 ; GFX11-NEXT: s_denorm_mode 15
1831 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1832 ; GFX11-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1833 ; GFX11-NEXT: v_fmac_f32_e32 v6, v0, v6
1834 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v6
1835 ; GFX11-NEXT: v_fma_f32 v4, -v5, v0, v1
1836 ; GFX11-NEXT: v_fmac_f32_e32 v0, v4, v6
1837 ; GFX11-NEXT: v_fma_f32 v1, -v5, v0, v1
1838 ; GFX11-NEXT: s_denorm_mode 12
1839 ; GFX11-NEXT: v_div_scale_f32 v4, null, s4, s4, s0
1840 ; GFX11-NEXT: v_div_fmas_f32 v0, v1, v6, v0
1841 ; GFX11-NEXT: v_rcp_f32_e32 v5, v4
1842 ; GFX11-NEXT: v_div_fixup_f32 v1, v0, s5, s1
1843 ; GFX11-NEXT: v_div_scale_f32 v0, vcc_lo, s0, s4, s0
1844 ; GFX11-NEXT: s_denorm_mode 15
1845 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1846 ; GFX11-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1847 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v5
1848 ; GFX11-NEXT: v_mul_f32_e32 v6, v0, v5
1849 ; GFX11-NEXT: v_fma_f32 v7, -v4, v6, v0
1850 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v5
1851 ; GFX11-NEXT: v_fma_f32 v0, -v4, v6, v0
1852 ; GFX11-NEXT: s_denorm_mode 12
1853 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
1854 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1855 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s4, s0
1856 ; GFX11-NEXT: global_store_b128 v4, v[0:3], s[8:9]
1857 ; GFX11-NEXT: s_nop 0
1858 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1859 ; GFX11-NEXT: s_endpgm
1861 ; EG-LABEL: s_fdiv_v4f32:
1863 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
1865 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
1866 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
1869 ; EG-NEXT: Fetch clause starting at 6:
1870 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
1871 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
1872 ; EG-NEXT: ALU clause starting at 10:
1873 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1874 ; EG-NEXT: ALU clause starting at 11:
1875 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
1876 ; EG-NEXT: MUL_IEEE T0.W, T0.W, PS,
1877 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
1878 ; EG-NEXT: MUL_IEEE T0.Z, T0.Z, PS,
1879 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
1880 ; EG-NEXT: MUL_IEEE T0.Y, T0.Y, PS,
1881 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
1882 ; EG-NEXT: MUL_IEEE T0.X, T0.X, PS,
1883 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1884 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1885 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
1886 %a = load <4 x float>, ptr addrspace(1) %in
1887 %b = load <4 x float>, ptr addrspace(1) %b_ptr
1888 %result = fdiv <4 x float> %a, %b
1889 store <4 x float> %result, ptr addrspace(1) %out
1893 define amdgpu_kernel void @s_fdiv_v4f32_fast_math(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
1894 ; GFX67-LABEL: s_fdiv_v4f32_fast_math:
1896 ; GFX67-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
1897 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1898 ; GFX67-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1899 ; GFX67-NEXT: s_mov_b32 s11, 0xf000
1900 ; GFX67-NEXT: s_mov_b32 s10, -1
1901 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1902 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1903 ; GFX67-NEXT: v_rcp_f32_e32 v1, s6
1904 ; GFX67-NEXT: v_rcp_f32_e32 v4, s5
1905 ; GFX67-NEXT: v_rcp_f32_e32 v5, s4
1906 ; GFX67-NEXT: v_mul_f32_e32 v3, s3, v0
1907 ; GFX67-NEXT: v_mul_f32_e32 v2, s2, v1
1908 ; GFX67-NEXT: v_mul_f32_e32 v1, s1, v4
1909 ; GFX67-NEXT: v_mul_f32_e32 v0, s0, v5
1910 ; GFX67-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1911 ; GFX67-NEXT: s_endpgm
1913 ; GFX8-LABEL: s_fdiv_v4f32_fast_math:
1915 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
1916 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1917 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1918 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
1919 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
1920 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1921 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1922 ; GFX8-NEXT: v_rcp_f32_e32 v1, s6
1923 ; GFX8-NEXT: v_rcp_f32_e32 v6, s5
1924 ; GFX8-NEXT: v_rcp_f32_e32 v7, s4
1925 ; GFX8-NEXT: v_mul_f32_e32 v3, s3, v0
1926 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v1
1927 ; GFX8-NEXT: v_mul_f32_e32 v1, s1, v6
1928 ; GFX8-NEXT: v_mul_f32_e32 v0, s0, v7
1929 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
1930 ; GFX8-NEXT: s_endpgm
1932 ; GFX10-LABEL: s_fdiv_v4f32_fast_math:
1934 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
1935 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
1936 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1937 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1938 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1939 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1940 ; GFX10-NEXT: v_rcp_f32_e32 v1, s6
1941 ; GFX10-NEXT: v_rcp_f32_e32 v4, s5
1942 ; GFX10-NEXT: v_rcp_f32_e32 v5, s4
1943 ; GFX10-NEXT: v_mul_f32_e32 v3, s3, v0
1944 ; GFX10-NEXT: v_mul_f32_e32 v2, s2, v1
1945 ; GFX10-NEXT: v_mul_f32_e32 v1, s1, v4
1946 ; GFX10-NEXT: v_mul_f32_e32 v0, s0, v5
1947 ; GFX10-NEXT: global_store_dwordx4 v6, v[0:3], s[8:9]
1948 ; GFX10-NEXT: s_endpgm
1950 ; GFX11-LABEL: s_fdiv_v4f32_fast_math:
1952 ; GFX11-NEXT: s_load_b128 s[8:11], s[0:1], 0x24
1953 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1954 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
1955 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1956 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1957 ; GFX11-NEXT: v_rcp_f32_e32 v1, s6
1958 ; GFX11-NEXT: v_rcp_f32_e32 v4, s5
1959 ; GFX11-NEXT: v_rcp_f32_e32 v5, s4
1960 ; GFX11-NEXT: v_dual_mov_b32 v6, 0 :: v_dual_mul_f32 v3, s3, v0
1961 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1962 ; GFX11-NEXT: v_dual_mul_f32 v2, s2, v1 :: v_dual_mul_f32 v1, s1, v4
1963 ; GFX11-NEXT: v_mul_f32_e32 v0, s0, v5
1964 ; GFX11-NEXT: global_store_b128 v6, v[0:3], s[8:9]
1965 ; GFX11-NEXT: s_nop 0
1966 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1967 ; GFX11-NEXT: s_endpgm
1969 ; EG-LABEL: s_fdiv_v4f32_fast_math:
1971 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
1973 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
1974 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
1977 ; EG-NEXT: Fetch clause starting at 6:
1978 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
1979 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
1980 ; EG-NEXT: ALU clause starting at 10:
1981 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1982 ; EG-NEXT: ALU clause starting at 11:
1983 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
1984 ; EG-NEXT: MUL_IEEE T0.W, PS, T0.W,
1985 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
1986 ; EG-NEXT: MUL_IEEE T0.Z, PS, T0.Z,
1987 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
1988 ; EG-NEXT: MUL_IEEE T0.Y, PS, T0.Y,
1989 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
1990 ; EG-NEXT: MUL_IEEE T0.X, PS, T0.X,
1991 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1992 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1993 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
1994 %a = load <4 x float>, ptr addrspace(1) %in
1995 %b = load <4 x float>, ptr addrspace(1) %b_ptr
1996 %result = fdiv fast <4 x float> %a, %b
1997 store <4 x float> %result, ptr addrspace(1) %out
2001 define amdgpu_kernel void @s_fdiv_v4f32_arcp_math(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
2002 ; GFX67-LABEL: s_fdiv_v4f32_arcp_math:
2004 ; GFX67-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
2005 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
2006 ; GFX67-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2007 ; GFX67-NEXT: s_mov_b32 s11, 0xf000
2008 ; GFX67-NEXT: s_mov_b32 s10, -1
2009 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
2010 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
2011 ; GFX67-NEXT: v_rcp_f32_e32 v1, s6
2012 ; GFX67-NEXT: v_rcp_f32_e32 v4, s5
2013 ; GFX67-NEXT: v_rcp_f32_e32 v5, s4
2014 ; GFX67-NEXT: v_mul_f32_e32 v3, s3, v0
2015 ; GFX67-NEXT: v_mul_f32_e32 v2, s2, v1
2016 ; GFX67-NEXT: v_mul_f32_e32 v1, s1, v4
2017 ; GFX67-NEXT: v_mul_f32_e32 v0, s0, v5
2018 ; GFX67-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
2019 ; GFX67-NEXT: s_endpgm
2021 ; GFX8-LABEL: s_fdiv_v4f32_arcp_math:
2023 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
2024 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2025 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2026 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
2027 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
2028 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2029 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
2030 ; GFX8-NEXT: v_rcp_f32_e32 v1, s6
2031 ; GFX8-NEXT: v_rcp_f32_e32 v6, s5
2032 ; GFX8-NEXT: v_rcp_f32_e32 v7, s4
2033 ; GFX8-NEXT: v_mul_f32_e32 v3, s3, v0
2034 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v1
2035 ; GFX8-NEXT: v_mul_f32_e32 v1, s1, v6
2036 ; GFX8-NEXT: v_mul_f32_e32 v0, s0, v7
2037 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
2038 ; GFX8-NEXT: s_endpgm
2040 ; GFX10-LABEL: s_fdiv_v4f32_arcp_math:
2042 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
2043 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
2044 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2045 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2046 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2047 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
2048 ; GFX10-NEXT: v_rcp_f32_e32 v1, s6
2049 ; GFX10-NEXT: v_rcp_f32_e32 v4, s5
2050 ; GFX10-NEXT: v_rcp_f32_e32 v5, s4
2051 ; GFX10-NEXT: v_mul_f32_e32 v3, s3, v0
2052 ; GFX10-NEXT: v_mul_f32_e32 v2, s2, v1
2053 ; GFX10-NEXT: v_mul_f32_e32 v1, s1, v4
2054 ; GFX10-NEXT: v_mul_f32_e32 v0, s0, v5
2055 ; GFX10-NEXT: global_store_dwordx4 v6, v[0:3], s[8:9]
2056 ; GFX10-NEXT: s_endpgm
2058 ; GFX11-LABEL: s_fdiv_v4f32_arcp_math:
2060 ; GFX11-NEXT: s_load_b128 s[8:11], s[0:1], 0x24
2061 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2062 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
2063 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2064 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
2065 ; GFX11-NEXT: v_rcp_f32_e32 v1, s6
2066 ; GFX11-NEXT: v_rcp_f32_e32 v4, s5
2067 ; GFX11-NEXT: v_rcp_f32_e32 v5, s4
2068 ; GFX11-NEXT: v_dual_mov_b32 v6, 0 :: v_dual_mul_f32 v3, s3, v0
2069 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2070 ; GFX11-NEXT: v_dual_mul_f32 v2, s2, v1 :: v_dual_mul_f32 v1, s1, v4
2071 ; GFX11-NEXT: v_mul_f32_e32 v0, s0, v5
2072 ; GFX11-NEXT: global_store_b128 v6, v[0:3], s[8:9]
2073 ; GFX11-NEXT: s_nop 0
2074 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2075 ; GFX11-NEXT: s_endpgm
2077 ; EG-LABEL: s_fdiv_v4f32_arcp_math:
2079 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
2081 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
2082 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
2085 ; EG-NEXT: Fetch clause starting at 6:
2086 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
2087 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
2088 ; EG-NEXT: ALU clause starting at 10:
2089 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
2090 ; EG-NEXT: ALU clause starting at 11:
2091 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
2092 ; EG-NEXT: MUL_IEEE T0.W, PS, T0.W,
2093 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
2094 ; EG-NEXT: MUL_IEEE T0.Z, PS, T0.Z,
2095 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
2096 ; EG-NEXT: MUL_IEEE T0.Y, PS, T0.Y,
2097 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
2098 ; EG-NEXT: MUL_IEEE T0.X, PS, T0.X,
2099 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
2100 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2101 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
2102 %a = load <4 x float>, ptr addrspace(1) %in
2103 %b = load <4 x float>, ptr addrspace(1) %b_ptr
2104 %result = fdiv arcp ninf <4 x float> %a, %b
2105 store <4 x float> %result, ptr addrspace(1) %out
2109 define amdgpu_kernel void @s_fdiv_f32_correctly_rounded_divide_sqrt(ptr addrspace(1) %out, float %a) #0 {
2110 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2111 ; GFX6-FASTFMA: ; %bb.0: ; %entry
2112 ; GFX6-FASTFMA-NEXT: s_load_dword s6, s[0:1], 0xb
2113 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2114 ; GFX6-FASTFMA-NEXT: s_mov_b32 s3, 0xf000
2115 ; GFX6-FASTFMA-NEXT: s_mov_b32 s2, -1
2116 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
2117 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2118 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v1, v0
2119 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2120 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2121 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2122 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, v3, v1, v1
2123 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v3, v2, v1
2124 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v0, v3, v2
2125 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v1, v3
2126 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v0, v3, v2
2127 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2128 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2129 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2130 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2131 ; GFX6-FASTFMA-NEXT: s_endpgm
2133 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2134 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
2135 ; GFX6-SLOWFMA-NEXT: s_load_dword s4, s[0:1], 0xb
2136 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2137 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2138 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v0, s[2:3], s4, s4, 1.0
2139 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2140 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s3, 0xf000
2141 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s2, -1
2142 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v2, v0
2143 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2144 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2145 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, v3, v2, v2
2146 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v3, v1, v2
2147 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v0, v3, v1
2148 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v2, v3
2149 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v0, v3, v1
2150 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2151 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2152 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2153 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2154 ; GFX6-SLOWFMA-NEXT: s_endpgm
2156 ; GFX7-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2157 ; GFX7: ; %bb.0: ; %entry
2158 ; GFX7-NEXT: s_load_dword s6, s[0:1], 0xb
2159 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2160 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2161 ; GFX7-NEXT: s_mov_b32 s2, -1
2162 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2163 ; GFX7-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2164 ; GFX7-NEXT: v_rcp_f32_e32 v1, v0
2165 ; GFX7-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2166 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2167 ; GFX7-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2168 ; GFX7-NEXT: v_fma_f32 v1, v3, v1, v1
2169 ; GFX7-NEXT: v_mul_f32_e32 v3, v2, v1
2170 ; GFX7-NEXT: v_fma_f32 v4, -v0, v3, v2
2171 ; GFX7-NEXT: v_fma_f32 v3, v4, v1, v3
2172 ; GFX7-NEXT: v_fma_f32 v0, -v0, v3, v2
2173 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2174 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2175 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2176 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
2177 ; GFX7-NEXT: s_endpgm
2179 ; GFX8-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2180 ; GFX8: ; %bb.0: ; %entry
2181 ; GFX8-NEXT: s_load_dword s4, s[0:1], 0x2c
2182 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
2183 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2184 ; GFX8-NEXT: v_div_scale_f32 v0, s[2:3], s4, s4, 1.0
2185 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2186 ; GFX8-NEXT: v_rcp_f32_e32 v2, v0
2187 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2188 ; GFX8-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2189 ; GFX8-NEXT: v_fma_f32 v2, v3, v2, v2
2190 ; GFX8-NEXT: v_mul_f32_e32 v3, v1, v2
2191 ; GFX8-NEXT: v_fma_f32 v4, -v0, v3, v1
2192 ; GFX8-NEXT: v_fma_f32 v3, v4, v2, v3
2193 ; GFX8-NEXT: v_fma_f32 v0, -v0, v3, v1
2194 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2195 ; GFX8-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2196 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s4, 1.0
2197 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2198 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2199 ; GFX8-NEXT: flat_store_dword v[0:1], v2
2200 ; GFX8-NEXT: s_endpgm
2202 ; GFX10-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2203 ; GFX10: ; %bb.0: ; %entry
2204 ; GFX10-NEXT: s_load_dword s2, s[0:1], 0x2c
2205 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2206 ; GFX10-NEXT: v_div_scale_f32 v0, s3, s2, s2, 1.0
2207 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s2, 1.0
2208 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
2209 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
2210 ; GFX10-NEXT: s_denorm_mode 15
2211 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2212 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
2213 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
2214 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
2215 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
2216 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
2217 ; GFX10-NEXT: s_denorm_mode 12
2218 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2219 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
2220 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s2, 1.0
2221 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2222 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
2223 ; GFX10-NEXT: s_endpgm
2225 ; GFX11-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2226 ; GFX11: ; %bb.0: ; %entry
2227 ; GFX11-NEXT: s_clause 0x1
2228 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
2229 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
2230 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2231 ; GFX11-NEXT: v_div_scale_f32 v0, null, s2, s2, 1.0
2232 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s2, 1.0
2233 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
2234 ; GFX11-NEXT: s_denorm_mode 15
2235 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2236 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2237 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
2238 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
2239 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
2240 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
2241 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
2242 ; GFX11-NEXT: s_denorm_mode 12
2243 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2244 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
2245 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s2, 1.0
2246 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
2247 ; GFX11-NEXT: s_nop 0
2248 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2249 ; GFX11-NEXT: s_endpgm
2251 ; EG-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2252 ; EG: ; %bb.0: ; %entry
2253 ; EG-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
2254 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2257 ; EG-NEXT: ALU clause starting at 4:
2258 ; EG-NEXT: LSHR T0.X, KC0[2].Y, literal.x,
2259 ; EG-NEXT: RECIP_IEEE * T1.X, KC0[2].Z,
2260 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2262 %fdiv = fdiv float 1.000000e+00, %a
2263 store float %fdiv, ptr addrspace(1) %out
2267 define amdgpu_kernel void @s_fdiv_f32_denorms_correctly_rounded_divide_sqrt(ptr addrspace(1) %out, float %a) #1 {
2268 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2269 ; GFX6-FASTFMA: ; %bb.0: ; %entry
2270 ; GFX6-FASTFMA-NEXT: s_load_dword s6, s[0:1], 0xb
2271 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2272 ; GFX6-FASTFMA-NEXT: s_mov_b32 s3, 0xf000
2273 ; GFX6-FASTFMA-NEXT: s_mov_b32 s2, -1
2274 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
2275 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2276 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v1, v0
2277 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2278 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2279 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, v3, v1, v1
2280 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v3, v2, v1
2281 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v0, v3, v2
2282 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v1, v3
2283 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v0, v3, v2
2284 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2285 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2286 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2287 ; GFX6-FASTFMA-NEXT: s_endpgm
2289 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2290 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
2291 ; GFX6-SLOWFMA-NEXT: s_load_dword s4, s[0:1], 0xb
2292 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2293 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2294 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v0, s[2:3], s4, s4, 1.0
2295 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2296 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s3, 0xf000
2297 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s2, -1
2298 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v2, v0
2299 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2300 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, v3, v2, v2
2301 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v3, v1, v2
2302 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v0, v3, v1
2303 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v2, v3
2304 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v0, v3, v1
2305 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2306 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2307 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2308 ; GFX6-SLOWFMA-NEXT: s_endpgm
2310 ; GFX7-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2311 ; GFX7: ; %bb.0: ; %entry
2312 ; GFX7-NEXT: s_load_dword s6, s[0:1], 0xb
2313 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
2314 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2315 ; GFX7-NEXT: s_mov_b32 s2, -1
2316 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2317 ; GFX7-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2318 ; GFX7-NEXT: v_rcp_f32_e32 v1, v0
2319 ; GFX7-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2320 ; GFX7-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2321 ; GFX7-NEXT: v_fma_f32 v1, v3, v1, v1
2322 ; GFX7-NEXT: v_mul_f32_e32 v3, v2, v1
2323 ; GFX7-NEXT: v_fma_f32 v4, -v0, v3, v2
2324 ; GFX7-NEXT: v_fma_f32 v3, v4, v1, v3
2325 ; GFX7-NEXT: v_fma_f32 v0, -v0, v3, v2
2326 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2327 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2328 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
2329 ; GFX7-NEXT: s_endpgm
2331 ; GFX8-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2332 ; GFX8: ; %bb.0: ; %entry
2333 ; GFX8-NEXT: s_load_dword s4, s[0:1], 0x2c
2334 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
2335 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2336 ; GFX8-NEXT: v_div_scale_f32 v0, s[2:3], s4, s4, 1.0
2337 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2338 ; GFX8-NEXT: v_rcp_f32_e32 v2, v0
2339 ; GFX8-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2340 ; GFX8-NEXT: v_fma_f32 v2, v3, v2, v2
2341 ; GFX8-NEXT: v_mul_f32_e32 v3, v1, v2
2342 ; GFX8-NEXT: v_fma_f32 v4, -v0, v3, v1
2343 ; GFX8-NEXT: v_fma_f32 v3, v4, v2, v3
2344 ; GFX8-NEXT: v_fma_f32 v0, -v0, v3, v1
2345 ; GFX8-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2346 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s4, 1.0
2347 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2348 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2349 ; GFX8-NEXT: flat_store_dword v[0:1], v2
2350 ; GFX8-NEXT: s_endpgm
2352 ; GFX10-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2353 ; GFX10: ; %bb.0: ; %entry
2354 ; GFX10-NEXT: s_load_dword s2, s[0:1], 0x2c
2355 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2356 ; GFX10-NEXT: v_div_scale_f32 v0, s3, s2, s2, 1.0
2357 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
2358 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
2359 ; GFX10-NEXT: v_fma_f32 v2, -v0, v1, 1.0
2360 ; GFX10-NEXT: v_fmac_f32_e32 v1, v2, v1
2361 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s2, 1.0
2362 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
2363 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
2364 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
2365 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
2366 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2367 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
2368 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s2, 1.0
2369 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2370 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
2371 ; GFX10-NEXT: s_endpgm
2373 ; GFX11-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2374 ; GFX11: ; %bb.0: ; %entry
2375 ; GFX11-NEXT: s_clause 0x1
2376 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
2377 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
2378 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2379 ; GFX11-NEXT: v_div_scale_f32 v0, null, s2, s2, 1.0
2380 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
2381 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2382 ; GFX11-NEXT: v_fma_f32 v2, -v0, v1, 1.0
2383 ; GFX11-NEXT: v_fmac_f32_e32 v1, v2, v1
2384 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s2, 1.0
2385 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
2386 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
2387 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
2388 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
2389 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2390 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
2391 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s2, 1.0
2392 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
2393 ; GFX11-NEXT: s_nop 0
2394 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2395 ; GFX11-NEXT: s_endpgm
2397 ; EG-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2398 ; EG: ; %bb.0: ; %entry
2399 ; EG-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
2400 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2403 ; EG-NEXT: ALU clause starting at 4:
2404 ; EG-NEXT: LSHR T0.X, KC0[2].Y, literal.x,
2405 ; EG-NEXT: RECIP_IEEE * T1.X, KC0[2].Z,
2406 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2408 %fdiv = fdiv float 1.000000e+00, %a
2409 store float %fdiv, ptr addrspace(1) %out
2413 define float @v_fdiv_f32_dynamic_denorm(float %a, float %b) #2 {
2414 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_denorm:
2415 ; GFX6-FASTFMA: ; %bb.0:
2416 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2417 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2418 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2419 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2420 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2421 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2422 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2423 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2424 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2425 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2426 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2427 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2428 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2429 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2430 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2431 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2433 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_denorm:
2434 ; GFX6-SLOWFMA: ; %bb.0:
2435 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2436 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2437 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2438 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2439 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2440 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2441 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2442 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2443 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2444 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2445 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2446 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2447 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2448 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2449 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2450 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2452 ; GFX7-LABEL: v_fdiv_f32_dynamic_denorm:
2454 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2455 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2456 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2457 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2458 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2459 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2460 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2461 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2462 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2463 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2464 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2465 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2466 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2467 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2468 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2469 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2471 ; GFX8-LABEL: v_fdiv_f32_dynamic_denorm:
2473 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2474 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2475 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2476 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2477 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2478 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2479 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2480 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2481 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2482 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2483 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2484 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2485 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2486 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2487 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2488 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2490 ; GFX10-LABEL: v_fdiv_f32_dynamic_denorm:
2492 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2493 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2494 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2495 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2496 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2497 ; GFX10-NEXT: s_denorm_mode 15
2498 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2499 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
2500 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2501 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2502 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2503 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2504 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2505 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2506 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2507 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2509 ; GFX11-LABEL: v_fdiv_f32_dynamic_denorm:
2511 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2512 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2513 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2514 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
2515 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2516 ; GFX11-NEXT: s_denorm_mode 15
2517 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2518 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2519 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
2520 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2521 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2522 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2523 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2524 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
2525 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2526 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2527 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2529 ; EG-LABEL: v_fdiv_f32_dynamic_denorm:
2533 %fdiv = fdiv float %a, %b
2537 define float @v_fdiv_f32_ieee(float %x, float %y) #1 {
2538 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee:
2539 ; GFX6-FASTFMA: ; %bb.0:
2540 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2541 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2542 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2543 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2544 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
2545 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2546 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2547 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2548 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2549 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2550 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2551 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2552 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2554 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee:
2555 ; GFX6-SLOWFMA: ; %bb.0:
2556 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2557 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2558 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2559 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2560 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2561 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2562 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2563 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2564 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2565 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2566 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2567 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2568 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2570 ; GFX7-LABEL: v_fdiv_f32_ieee:
2572 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2573 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2574 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2575 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2576 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
2577 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2578 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2579 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2580 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2581 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2582 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2583 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2584 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2586 ; GFX8-LABEL: v_fdiv_f32_ieee:
2588 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2589 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2590 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2591 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2592 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2593 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2594 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2595 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2596 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2597 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2598 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2599 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2600 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2602 ; GFX10-LABEL: v_fdiv_f32_ieee:
2604 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2605 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2606 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2607 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2608 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
2609 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2610 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2611 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2612 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2613 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2614 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2615 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2616 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2618 ; GFX11-LABEL: v_fdiv_f32_ieee:
2620 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2621 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2622 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2623 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2624 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2625 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
2626 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2627 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2628 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2629 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2630 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2631 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2632 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2633 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2635 ; EG-LABEL: v_fdiv_f32_ieee:
2639 %div = fdiv float %x, %y
2643 define float @v_fdiv_f32_ieee_25ulp(float %x, float %y) #1 {
2644 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp:
2646 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2647 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
2648 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
2649 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
2650 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
2651 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
2652 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
2653 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
2654 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2655 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
2656 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2657 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
2658 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
2659 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
2660 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2662 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp:
2664 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2665 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
2666 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
2667 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2668 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2669 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
2670 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
2671 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
2672 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
2673 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2675 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp:
2677 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2678 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
2679 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
2680 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2681 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2682 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
2683 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
2684 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
2685 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
2686 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2688 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp:
2690 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2691 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
2692 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2693 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
2694 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2695 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
2696 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2697 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
2698 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
2699 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2701 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp:
2703 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2704 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
2705 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2706 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
2707 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2708 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
2709 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2710 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2711 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
2712 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
2713 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2715 ; EG-LABEL: v_fdiv_f32_ieee_25ulp:
2719 %div = fdiv float %x, %y, !fpmath !0
2723 define float @v_fdiv_f32_dynamic(float %x, float %y) #2 {
2724 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic:
2725 ; GFX6-FASTFMA: ; %bb.0:
2726 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2727 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2728 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2729 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2730 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2731 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2732 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2733 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2734 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2735 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2736 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2737 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2738 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2739 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2740 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2741 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2743 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic:
2744 ; GFX6-SLOWFMA: ; %bb.0:
2745 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2746 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2747 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2748 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2749 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2750 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2751 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2752 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2753 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2754 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2755 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2756 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2757 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2758 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2759 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2760 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2762 ; GFX7-LABEL: v_fdiv_f32_dynamic:
2764 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2765 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2766 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2767 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2768 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2769 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2770 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2771 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2772 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2773 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2774 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2775 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2776 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2777 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2778 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2779 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2781 ; GFX8-LABEL: v_fdiv_f32_dynamic:
2783 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2784 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2785 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2786 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2787 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2788 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2789 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2790 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2791 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2792 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2793 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2794 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2795 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2796 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2797 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2798 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2800 ; GFX10-LABEL: v_fdiv_f32_dynamic:
2802 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2803 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2804 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2805 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2806 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2807 ; GFX10-NEXT: s_denorm_mode 15
2808 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2809 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
2810 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2811 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2812 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2813 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2814 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2815 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2816 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2817 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2819 ; GFX11-LABEL: v_fdiv_f32_dynamic:
2821 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2822 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2823 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2824 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
2825 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2826 ; GFX11-NEXT: s_denorm_mode 15
2827 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2828 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2829 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
2830 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2831 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2832 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2833 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2834 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
2835 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2836 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2837 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2839 ; EG-LABEL: v_fdiv_f32_dynamic:
2843 %div = fdiv float %x, %y
2847 define float @v_fdiv_f32_dynamic_25ulp(float %x, float %y) #2 {
2848 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp:
2850 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2851 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
2852 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
2853 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
2854 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
2855 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
2856 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
2857 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
2858 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2859 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
2860 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2861 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
2862 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
2863 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
2864 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2866 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp:
2868 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2869 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
2870 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
2871 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2872 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2873 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
2874 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
2875 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
2876 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
2877 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2879 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp:
2881 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2882 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
2883 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
2884 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2885 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2886 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
2887 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
2888 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
2889 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
2890 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2892 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp:
2894 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2895 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
2896 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2897 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
2898 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2899 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
2900 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2901 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
2902 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
2903 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2905 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp:
2907 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2908 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
2909 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2910 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
2911 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2912 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
2913 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2914 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2915 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
2916 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
2917 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2919 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp:
2923 %div = fdiv float %x, %y, !fpmath !0
2927 define float @v_fdiv_f32_daz(float %x, float %y) #0 {
2928 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz:
2929 ; GFX6-FASTFMA: ; %bb.0:
2930 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2931 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2932 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2933 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2934 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2935 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2936 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2937 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2938 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2939 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2940 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2941 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2942 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2943 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2944 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2946 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz:
2947 ; GFX6-SLOWFMA: ; %bb.0:
2948 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2949 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2950 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2951 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2952 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2953 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2954 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2955 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2956 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2957 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2958 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2959 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2960 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2961 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2962 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2964 ; GFX7-LABEL: v_fdiv_f32_daz:
2966 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2967 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2968 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2969 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2970 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2971 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2972 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2973 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2974 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2975 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2976 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2977 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2978 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2979 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2980 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2982 ; GFX8-LABEL: v_fdiv_f32_daz:
2984 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2985 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2986 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2987 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2988 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2989 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2990 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2991 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2992 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2993 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2994 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2995 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2996 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2997 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2998 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3000 ; GFX10-LABEL: v_fdiv_f32_daz:
3002 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3003 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3004 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3005 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3006 ; GFX10-NEXT: s_denorm_mode 15
3007 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3008 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
3009 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3010 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3011 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3012 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3013 ; GFX10-NEXT: s_denorm_mode 12
3014 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3015 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3016 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3018 ; GFX11-LABEL: v_fdiv_f32_daz:
3020 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3021 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3022 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3023 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3024 ; GFX11-NEXT: s_denorm_mode 15
3025 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3026 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3027 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
3028 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3029 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3030 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3031 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3032 ; GFX11-NEXT: s_denorm_mode 12
3033 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3034 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3035 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3037 ; EG-LABEL: v_fdiv_f32_daz:
3041 %div = fdiv float %x, %y
3045 define float @v_fdiv_f32_daz_25ulp(float %x, float %y) #0 {
3046 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp:
3048 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3049 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
3050 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
3051 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
3052 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
3053 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
3054 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
3055 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
3056 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
3057 ; GFX678-NEXT: s_setpc_b64 s[30:31]
3059 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp:
3061 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3062 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
3063 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
3064 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
3065 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
3066 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
3067 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
3068 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3070 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp:
3072 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3073 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
3074 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
3075 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
3076 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
3077 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3078 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
3079 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
3080 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3082 ; EG-LABEL: v_fdiv_f32_daz_25ulp:
3086 %div = fdiv float %x, %y, !fpmath !0
3090 ; If we emit an fmul, make sure it fuses into the user.
3091 define float @v_fdiv_f32_ieee_contractable_user(float %x, float %y, float %z) #1 {
3092 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_contractable_user:
3093 ; GFX6-FASTFMA: ; %bb.0:
3094 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3095 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3096 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3097 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3098 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3099 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3100 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3101 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3102 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3103 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3104 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3105 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3106 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3107 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3109 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_contractable_user:
3110 ; GFX6-SLOWFMA: ; %bb.0:
3111 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3112 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3113 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3114 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3115 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3116 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3117 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3118 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3119 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3120 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3121 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3122 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3123 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3124 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3126 ; GFX7-LABEL: v_fdiv_f32_ieee_contractable_user:
3128 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3129 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3130 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3131 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3132 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
3133 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3134 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3135 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3136 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3137 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3138 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3139 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3140 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3141 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3143 ; GFX8-LABEL: v_fdiv_f32_ieee_contractable_user:
3145 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3146 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3147 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3148 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3149 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3150 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3151 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3152 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3153 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3154 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3155 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3156 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3157 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3158 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3160 ; GFX10-LABEL: v_fdiv_f32_ieee_contractable_user:
3162 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3163 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3164 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3165 ; GFX10-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3166 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v4
3167 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3168 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3169 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3170 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3171 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3172 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3173 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3174 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3175 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3177 ; GFX11-LABEL: v_fdiv_f32_ieee_contractable_user:
3179 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3180 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3181 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3182 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3183 ; GFX11-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3184 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v4
3185 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3186 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3187 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3188 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3189 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3190 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3191 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3192 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3193 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3195 ; EG-LABEL: v_fdiv_f32_ieee_contractable_user:
3199 %div = fdiv contract float %x, %y
3200 %add = fadd contract float %div, %z
3204 define float @v_fdiv_f32_ieee_25ulp_contractable_user(float %x, float %y, float %z) #1 {
3205 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3207 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3208 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3209 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
3210 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3211 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
3212 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
3213 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
3214 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3215 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3216 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
3217 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3218 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
3219 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3220 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
3221 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
3222 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3224 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3226 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3227 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
3228 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
3229 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3230 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3231 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3232 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
3233 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
3234 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3235 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3236 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3238 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3240 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3241 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
3242 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
3243 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3244 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3245 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3246 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
3247 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
3248 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3249 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3250 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3252 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3254 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3255 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
3256 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3257 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
3258 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3259 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
3260 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3261 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
3262 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
3263 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3264 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3266 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3268 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3269 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
3270 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3271 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
3272 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3273 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
3274 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3275 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3276 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
3277 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
3278 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3279 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3281 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3285 %div = fdiv contract float %x, %y, !fpmath !0
3286 %add = fadd contract float %div, %z
3290 define float @v_fdiv_f32_dynamic_contractable_user(float %x, float %y, float %z) #2 {
3291 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_contractable_user:
3292 ; GFX6-FASTFMA: ; %bb.0:
3293 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3294 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3295 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3296 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3297 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3298 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3299 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
3300 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3301 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3302 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3303 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3304 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3305 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3306 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3307 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3308 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3309 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3311 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_contractable_user:
3312 ; GFX6-SLOWFMA: ; %bb.0:
3313 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3314 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3315 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3316 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3317 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3318 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3319 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3320 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3321 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3322 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3323 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3324 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3325 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3326 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3327 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3328 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3329 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3331 ; GFX7-LABEL: v_fdiv_f32_dynamic_contractable_user:
3333 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3334 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3335 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3336 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3337 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3338 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3339 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
3340 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3341 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3342 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3343 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3344 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3345 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3346 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3347 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3348 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3349 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3351 ; GFX8-LABEL: v_fdiv_f32_dynamic_contractable_user:
3353 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3354 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3355 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3356 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3357 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3358 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3359 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3360 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3361 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3362 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3363 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3364 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3365 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3366 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3367 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3368 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3369 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3371 ; GFX10-LABEL: v_fdiv_f32_dynamic_contractable_user:
3373 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3374 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3375 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3376 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3377 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3378 ; GFX10-NEXT: s_denorm_mode 15
3379 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3380 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
3381 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3382 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3383 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3384 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3385 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3386 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3387 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3388 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3389 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3391 ; GFX11-LABEL: v_fdiv_f32_dynamic_contractable_user:
3393 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3394 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3395 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3396 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
3397 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3398 ; GFX11-NEXT: s_denorm_mode 15
3399 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3400 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3401 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
3402 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3403 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3404 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3405 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3406 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
3407 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3408 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3409 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3410 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3412 ; EG-LABEL: v_fdiv_f32_dynamic_contractable_user:
3416 %div = fdiv contract float %x, %y
3417 %add = fadd contract float %div, %z
3421 define float @v_fdiv_f32_dynamic_25ulp_contractable_user(float %x, float %y, float %z) #2 {
3422 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3424 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3425 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3426 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
3427 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3428 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
3429 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
3430 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
3431 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3432 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3433 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
3434 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3435 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
3436 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3437 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
3438 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
3439 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3441 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3443 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3444 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
3445 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
3446 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3447 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3448 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3449 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
3450 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
3451 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3452 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3453 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3455 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3457 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3458 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
3459 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
3460 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3461 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3462 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3463 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
3464 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
3465 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3466 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3467 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3469 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3471 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3472 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
3473 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3474 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
3475 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3476 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
3477 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3478 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
3479 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
3480 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3481 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3483 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3485 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3486 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
3487 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3488 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
3489 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3490 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
3491 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3492 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3493 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
3494 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
3495 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3496 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3498 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3502 %div = fdiv contract float %x, %y, !fpmath !0
3503 %add = fadd contract float %div, %z
3507 define float @v_fdiv_f32_daz_contractable_user(float %x, float %y, float %z) #0 {
3508 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_contractable_user:
3509 ; GFX6-FASTFMA: ; %bb.0:
3510 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3511 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3512 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3513 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3514 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3515 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3516 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
3517 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3518 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3519 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3520 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3521 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3522 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3523 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3524 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3525 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3527 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_contractable_user:
3528 ; GFX6-SLOWFMA: ; %bb.0:
3529 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3530 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3531 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3532 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3533 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3534 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3535 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3536 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3537 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3538 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3539 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3540 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3541 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3542 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3543 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3544 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3546 ; GFX7-LABEL: v_fdiv_f32_daz_contractable_user:
3548 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3549 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3550 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3551 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3552 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3553 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3554 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
3555 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3556 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3557 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3558 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3559 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3560 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3561 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3562 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3563 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3565 ; GFX8-LABEL: v_fdiv_f32_daz_contractable_user:
3567 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3568 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3569 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3570 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3571 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3572 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3573 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3574 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3575 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3576 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3577 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3578 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3579 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3580 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3581 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3582 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3584 ; GFX10-LABEL: v_fdiv_f32_daz_contractable_user:
3586 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3587 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3588 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3589 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3590 ; GFX10-NEXT: s_denorm_mode 15
3591 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3592 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
3593 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3594 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3595 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3596 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3597 ; GFX10-NEXT: s_denorm_mode 12
3598 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3599 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3600 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3601 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3603 ; GFX11-LABEL: v_fdiv_f32_daz_contractable_user:
3605 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3606 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3607 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3608 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3609 ; GFX11-NEXT: s_denorm_mode 15
3610 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3611 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3612 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
3613 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3614 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3615 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3616 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3617 ; GFX11-NEXT: s_denorm_mode 12
3618 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3619 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3620 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3621 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3623 ; EG-LABEL: v_fdiv_f32_daz_contractable_user:
3627 %div = fdiv contract float %x, %y
3628 %add = fadd contract float %div, %z
3632 define float @v_fdiv_f32_daz_25ulp_contractable_user(float %x, float %y, float %z) #0 {
3633 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3635 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3636 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
3637 ; GFX678-NEXT: v_mov_b32_e32 v3, 0x2f800000
3638 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
3639 ; GFX678-NEXT: v_cndmask_b32_e32 v3, 1.0, v3, vcc
3640 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v3
3641 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
3642 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
3643 ; GFX678-NEXT: v_mad_f32 v0, v3, v0, v2
3644 ; GFX678-NEXT: s_setpc_b64 s[30:31]
3646 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3648 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3649 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
3650 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s4
3651 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
3652 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
3653 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
3654 ; GFX10-NEXT: v_mad_f32 v0, v3, v0, v2
3655 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3657 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3659 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3660 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
3661 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s0
3662 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v3
3663 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
3664 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3665 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
3666 ; GFX11-NEXT: v_fma_f32 v0, v3, v0, v2
3667 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3669 ; EG-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3673 %div = fdiv contract float %x, %y, !fpmath !0
3674 %add = fadd contract float %div, %z
3678 define float @v_fdiv_f32_ieee__nnan_ninf(float %x, float %y, float %z) #1 {
3679 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3680 ; GFX6-FASTFMA: ; %bb.0:
3681 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3682 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3683 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
3684 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3685 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
3686 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3687 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
3688 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
3689 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
3690 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
3691 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3692 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3693 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3695 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3696 ; GFX6-SLOWFMA: ; %bb.0:
3697 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3698 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3699 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3700 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
3701 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3702 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3703 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
3704 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
3705 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
3706 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
3707 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3708 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3709 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3711 ; GFX7-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3713 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3714 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3715 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
3716 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3717 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
3718 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3719 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
3720 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
3721 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
3722 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
3723 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3724 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3725 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3727 ; GFX8-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3729 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3730 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3731 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3732 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
3733 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3734 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
3735 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
3736 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
3737 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
3738 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
3739 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3740 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3741 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3743 ; GFX10-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3745 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3746 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3747 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3748 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3749 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
3750 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3751 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3752 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3753 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3754 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3755 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3756 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3757 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3759 ; GFX11-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3761 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3762 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3763 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3764 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3765 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3766 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
3767 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3768 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3769 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3770 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3771 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3772 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3773 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3774 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3776 ; EG-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3780 %div = fdiv nnan ninf float %x, %y
3784 define float @v_fdiv_f32_ieee_25ulp__nnan_ninf(float %x, float %y, float %z) #1 {
3785 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3787 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3788 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3789 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
3790 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3791 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
3792 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
3793 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
3794 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3795 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3796 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
3797 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3798 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
3799 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3800 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
3801 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3803 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3805 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3806 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
3807 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
3808 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3809 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
3810 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3811 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
3812 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
3813 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3814 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3816 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3818 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3819 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
3820 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
3821 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3822 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
3823 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3824 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
3825 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
3826 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3827 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3829 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3831 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3832 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
3833 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3834 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
3835 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3836 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
3837 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3838 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
3839 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
3840 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3842 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3844 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3845 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
3846 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3847 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
3848 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3849 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
3850 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3851 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3852 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
3853 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
3854 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3856 ; EG-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3860 %div = fdiv nnan ninf float %x, %y, !fpmath !0
3864 define float @v_fdiv_f32_dynamic__nnan_ninf(float %x, float %y, float %z) #2 {
3865 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3866 ; GFX6-FASTFMA: ; %bb.0:
3867 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3868 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3869 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
3870 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3871 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3872 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3873 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
3874 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
3875 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
3876 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3877 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
3878 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
3879 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3880 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3881 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3882 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3884 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3885 ; GFX6-SLOWFMA: ; %bb.0:
3886 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3887 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3888 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3889 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3890 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
3891 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3892 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3893 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3894 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
3895 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
3896 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
3897 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
3898 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3899 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3900 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3901 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3903 ; GFX7-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3905 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3906 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3907 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
3908 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3909 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3910 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3911 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
3912 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
3913 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
3914 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3915 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
3916 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
3917 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3918 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3919 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3920 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3922 ; GFX8-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3924 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3925 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3926 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3927 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3928 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
3929 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3930 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3931 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
3932 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
3933 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
3934 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
3935 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
3936 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3937 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3938 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3939 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3941 ; GFX10-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3943 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3944 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3945 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3946 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3947 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3948 ; GFX10-NEXT: s_denorm_mode 15
3949 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3950 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
3951 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3952 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3953 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3954 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3955 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3956 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3957 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3958 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3960 ; GFX11-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3962 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3963 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3964 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3965 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
3966 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3967 ; GFX11-NEXT: s_denorm_mode 15
3968 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3969 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3970 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
3971 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3972 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3973 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3974 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3975 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
3976 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3977 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3978 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3980 ; EG-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3984 %div = fdiv nnan ninf float %x, %y
3988 define float @v_fdiv_f32_dynamic_25ulp__nnan_ninf(float %x, float %y, float %z) #2 {
3989 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
3991 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3992 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3993 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
3994 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3995 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
3996 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
3997 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
3998 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3999 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4000 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
4001 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4002 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
4003 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4004 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
4005 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4007 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4009 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4010 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
4011 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
4012 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4013 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4014 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4015 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
4016 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
4017 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4018 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4020 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4022 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4023 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
4024 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
4025 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4026 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4027 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4028 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
4029 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
4030 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4031 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4033 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4035 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4036 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
4037 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4038 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
4039 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4040 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
4041 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4042 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
4043 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
4044 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4046 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4048 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4049 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
4050 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4051 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
4052 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4053 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
4054 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4055 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4056 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
4057 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
4058 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4060 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4064 %div = fdiv nnan ninf float %x, %y, !fpmath !0
4068 define float @v_fdiv_f32_daz__nnan_ninf(float %x, float %y, float %z) #0 {
4069 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz__nnan_ninf:
4070 ; GFX6-FASTFMA: ; %bb.0:
4071 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4072 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4073 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
4074 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4075 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4076 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4077 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
4078 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
4079 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
4080 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
4081 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
4082 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4083 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4084 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4085 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4087 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz__nnan_ninf:
4088 ; GFX6-SLOWFMA: ; %bb.0:
4089 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4090 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4091 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
4092 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
4093 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4094 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4095 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4096 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
4097 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
4098 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
4099 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
4100 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4101 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4102 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4103 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4105 ; GFX7-LABEL: v_fdiv_f32_daz__nnan_ninf:
4107 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4108 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4109 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
4110 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4111 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4112 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4113 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
4114 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
4115 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
4116 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
4117 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
4118 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4119 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4120 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4121 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4123 ; GFX8-LABEL: v_fdiv_f32_daz__nnan_ninf:
4125 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4126 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4127 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
4128 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
4129 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4130 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4131 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
4132 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
4133 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
4134 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
4135 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
4136 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4137 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4138 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4139 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4141 ; GFX10-LABEL: v_fdiv_f32_daz__nnan_ninf:
4143 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4144 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
4145 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
4146 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
4147 ; GFX10-NEXT: s_denorm_mode 15
4148 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4149 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
4150 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
4151 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
4152 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
4153 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
4154 ; GFX10-NEXT: s_denorm_mode 12
4155 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4156 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4157 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4159 ; GFX11-LABEL: v_fdiv_f32_daz__nnan_ninf:
4161 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4162 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
4163 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
4164 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
4165 ; GFX11-NEXT: s_denorm_mode 15
4166 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4167 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4168 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
4169 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
4170 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
4171 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
4172 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
4173 ; GFX11-NEXT: s_denorm_mode 12
4174 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4175 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4176 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4178 ; EG-LABEL: v_fdiv_f32_daz__nnan_ninf:
4182 %div = fdiv nnan ninf float %x, %y
4186 define float @v_fdiv_f32_daz_25ulp__nnan_ninf(float %x, float %y, float %z) #0 {
4187 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4189 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4190 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
4191 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
4192 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
4193 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
4194 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
4195 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
4196 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
4197 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
4198 ; GFX678-NEXT: s_setpc_b64 s[30:31]
4200 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4202 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4203 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
4204 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
4205 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
4206 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
4207 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
4208 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
4209 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4211 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4213 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4214 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
4215 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
4216 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
4217 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
4218 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4219 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
4220 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
4221 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4223 ; EG-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4227 %div = fdiv nnan ninf float %x, %y, !fpmath !0
4231 define float @v_fdiv_f32_ieee__nnan_ninf_contractable_user(float %x, float %y, float %z) #1 {
4232 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4233 ; GFX6-FASTFMA: ; %bb.0:
4234 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4235 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4236 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4237 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4238 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4239 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4240 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4241 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4242 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4243 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4244 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4245 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4246 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4247 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4249 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4250 ; GFX6-SLOWFMA: ; %bb.0:
4251 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4252 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4253 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4254 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4255 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4256 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4257 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4258 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4259 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4260 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4261 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4262 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4263 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4264 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4266 ; GFX7-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4268 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4269 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4270 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4271 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4272 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
4273 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4274 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4275 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4276 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4277 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4278 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4279 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4280 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4281 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4283 ; GFX8-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4285 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4286 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4287 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4288 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4289 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4290 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4291 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4292 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4293 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4294 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4295 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4296 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4297 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4298 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4300 ; GFX10-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4302 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4303 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4304 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4305 ; GFX10-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4306 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v4
4307 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4308 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4309 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4310 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4311 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4312 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4313 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4314 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4315 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4317 ; GFX11-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4319 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4320 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4321 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4322 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4323 ; GFX11-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4324 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v4
4325 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4326 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4327 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4328 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4329 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4330 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4331 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4332 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4333 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4335 ; EG-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4339 %div = fdiv nnan ninf contract float %x, %y
4340 %add = fadd contract float %div, %z
4344 define float @v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #1 {
4345 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4347 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4348 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4349 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
4350 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4351 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
4352 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
4353 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
4354 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
4355 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4356 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
4357 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4358 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
4359 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4360 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
4361 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
4362 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4364 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4366 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4367 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
4368 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
4369 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4370 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4371 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4372 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
4373 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
4374 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4375 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4376 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4378 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4380 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4381 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
4382 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
4383 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4384 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4385 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4386 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
4387 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
4388 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4389 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4390 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4392 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4394 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4395 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
4396 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4397 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
4398 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4399 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
4400 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4401 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
4402 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
4403 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4404 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4406 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4408 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4409 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
4410 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4411 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
4412 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4413 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
4414 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4415 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4416 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
4417 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
4418 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4419 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4421 ; EG-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4425 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4426 %add = fadd contract float %div, %z
4430 define float @v_fdiv_f32_dynamic__nnan_ninf_contractable_user(float %x, float %y, float %z) #2 {
4431 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4432 ; GFX6-FASTFMA: ; %bb.0:
4433 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4434 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4435 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4436 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4437 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4438 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4439 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
4440 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4441 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4442 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4443 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4444 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4445 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4446 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4447 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4448 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4449 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4451 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4452 ; GFX6-SLOWFMA: ; %bb.0:
4453 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4454 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4455 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4456 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4457 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4458 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4459 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4460 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4461 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4462 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4463 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4464 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4465 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4466 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4467 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4468 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4469 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4471 ; GFX7-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4473 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4474 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4475 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4476 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4477 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4478 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4479 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
4480 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4481 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4482 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4483 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4484 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4485 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4486 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4487 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4488 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4489 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4491 ; GFX8-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4493 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4494 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4495 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4496 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4497 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4498 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4499 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4500 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4501 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4502 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4503 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4504 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4505 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4506 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4507 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4508 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4509 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4511 ; GFX10-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4513 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4514 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4515 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4516 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4517 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4518 ; GFX10-NEXT: s_denorm_mode 15
4519 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4520 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
4521 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4522 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4523 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4524 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4525 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4526 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4527 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4528 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4529 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4531 ; GFX11-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4533 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4534 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4535 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4536 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
4537 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4538 ; GFX11-NEXT: s_denorm_mode 15
4539 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4540 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4541 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
4542 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4543 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4544 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4545 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4546 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
4547 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4548 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4549 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4550 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4552 ; EG-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4556 %div = fdiv nnan ninf contract float %x, %y
4557 %add = fadd contract float %div, %z
4561 define float @v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #2 {
4562 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4564 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4565 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4566 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
4567 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4568 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
4569 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
4570 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
4571 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
4572 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4573 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
4574 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4575 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
4576 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4577 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
4578 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
4579 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4581 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4583 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4584 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
4585 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
4586 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4587 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4588 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4589 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
4590 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
4591 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4592 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4593 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4595 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4597 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4598 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
4599 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
4600 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4601 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4602 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4603 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
4604 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
4605 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4606 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4607 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4609 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4611 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4612 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
4613 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4614 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
4615 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4616 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
4617 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4618 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
4619 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
4620 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4621 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4623 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4625 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4626 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
4627 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4628 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
4629 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4630 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
4631 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4632 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4633 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
4634 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
4635 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4636 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4638 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4642 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4643 %add = fadd contract float %div, %z
4647 define float @v_fdiv_f32_daz__nnan_ninf_contractable_user(float %x, float %y, float %z) #0 {
4648 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4649 ; GFX6-FASTFMA: ; %bb.0:
4650 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4651 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4652 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4653 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4654 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4655 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4656 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
4657 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4658 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4659 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4660 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4661 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4662 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4663 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4664 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4665 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4667 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4668 ; GFX6-SLOWFMA: ; %bb.0:
4669 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4670 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4671 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4672 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4673 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4674 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4675 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4676 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4677 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4678 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4679 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4680 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4681 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4682 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4683 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4684 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4686 ; GFX7-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4688 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4689 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4690 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4691 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4692 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4693 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4694 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
4695 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4696 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4697 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4698 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4699 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4700 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4701 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4702 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4703 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4705 ; GFX8-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4707 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4708 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4709 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4710 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4711 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4712 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4713 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4714 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4715 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4716 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4717 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4718 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4719 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4720 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4721 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4722 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4724 ; GFX10-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4726 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4727 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4728 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4729 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4730 ; GFX10-NEXT: s_denorm_mode 15
4731 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4732 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
4733 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4734 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4735 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4736 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4737 ; GFX10-NEXT: s_denorm_mode 12
4738 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4739 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4740 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4741 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4743 ; GFX11-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4745 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4746 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4747 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4748 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4749 ; GFX11-NEXT: s_denorm_mode 15
4750 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4751 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4752 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
4753 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4754 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4755 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4756 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4757 ; GFX11-NEXT: s_denorm_mode 12
4758 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4759 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4760 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4761 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4763 ; EG-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4767 %div = fdiv nnan ninf contract float %x, %y
4768 %add = fadd contract float %div, %z
4772 define float @v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #0 {
4773 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4775 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4776 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
4777 ; GFX678-NEXT: v_mov_b32_e32 v3, 0x2f800000
4778 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
4779 ; GFX678-NEXT: v_cndmask_b32_e32 v3, 1.0, v3, vcc
4780 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v3
4781 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
4782 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
4783 ; GFX678-NEXT: v_mad_f32 v0, v3, v0, v2
4784 ; GFX678-NEXT: s_setpc_b64 s[30:31]
4786 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4788 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4789 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
4790 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s4
4791 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
4792 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
4793 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
4794 ; GFX10-NEXT: v_mad_f32 v0, v3, v0, v2
4795 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4797 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4799 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4800 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
4801 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s0
4802 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v3
4803 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
4804 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4805 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
4806 ; GFX11-NEXT: v_fma_f32 v0, v3, v0, v2
4807 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4809 ; EG-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4813 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4814 %add = fadd contract float %div, %z
4818 define float @v_fdiv_neglhs_f32_ieee(float %x, float %y) #1 {
4819 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_ieee:
4820 ; GFX6-FASTFMA: ; %bb.0:
4821 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4822 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4823 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
4824 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4825 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
4826 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
4827 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
4828 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
4829 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
4830 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
4831 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4832 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4833 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4835 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_ieee:
4836 ; GFX6-SLOWFMA: ; %bb.0:
4837 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4838 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4839 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
4840 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
4841 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4842 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4843 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
4844 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
4845 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
4846 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
4847 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4848 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4849 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4851 ; GFX7-LABEL: v_fdiv_neglhs_f32_ieee:
4853 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4854 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4855 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
4856 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4857 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
4858 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
4859 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
4860 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
4861 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
4862 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
4863 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4864 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4865 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4867 ; GFX8-LABEL: v_fdiv_neglhs_f32_ieee:
4869 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4870 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4871 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
4872 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
4873 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4874 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
4875 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
4876 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
4877 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
4878 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
4879 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4880 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4881 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4883 ; GFX10-LABEL: v_fdiv_neglhs_f32_ieee:
4885 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4886 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
4887 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
4888 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4889 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
4890 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
4891 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
4892 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
4893 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
4894 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
4895 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4896 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4897 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4899 ; GFX11-LABEL: v_fdiv_neglhs_f32_ieee:
4901 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4902 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
4903 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
4904 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4905 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4906 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
4907 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
4908 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
4909 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
4910 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
4911 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
4912 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4913 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4914 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4916 ; EG-LABEL: v_fdiv_neglhs_f32_ieee:
4920 %neg.x = fneg float %x
4921 %div = fdiv float %neg.x, %y
4925 define float @v_fdiv_neglhs_f32_ieee_25ulp(float %x, float %y) #1 {
4926 ; GFX6-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4928 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4929 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4930 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
4931 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4932 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
4933 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
4934 ; GFX6-NEXT: v_frexp_mant_f32_e64 v3, -v0
4935 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, s4
4936 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4937 ; GFX6-NEXT: v_cndmask_b32_e64 v3, -v0, v3, s[4:5]
4938 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4939 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
4940 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4941 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
4942 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4944 ; GFX7-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4946 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4947 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
4948 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
4949 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4950 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4951 ; GFX7-NEXT: v_frexp_mant_f32_e64 v0, -v0
4952 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
4953 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
4954 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4955 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4957 ; GFX8-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4959 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4960 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
4961 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
4962 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4963 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4964 ; GFX8-NEXT: v_frexp_mant_f32_e64 v0, -v0
4965 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
4966 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
4967 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4968 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4970 ; GFX10-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4972 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4973 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
4974 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4975 ; GFX10-NEXT: v_frexp_mant_f32_e64 v3, -v0
4976 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4977 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
4978 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4979 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
4980 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
4981 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4983 ; GFX11-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4985 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4986 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
4987 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4988 ; GFX11-NEXT: v_frexp_mant_f32_e64 v3, -v0
4989 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4990 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
4991 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4992 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4993 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
4994 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
4995 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4997 ; EG-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
5001 %neg.x = fneg float %x
5002 %div = fdiv float %neg.x, %y, !fpmath !0
5006 define float @v_fdiv_neglhs_f32_dynamic(float %x, float %y) #2 {
5007 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_dynamic:
5008 ; GFX6-FASTFMA: ; %bb.0:
5009 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5010 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5011 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5012 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5013 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5014 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5015 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5016 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5017 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5018 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5019 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5020 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5021 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5022 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5023 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5024 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5026 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_dynamic:
5027 ; GFX6-SLOWFMA: ; %bb.0:
5028 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5029 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5030 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5031 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5032 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5033 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5034 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5035 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5036 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5037 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5038 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5039 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5040 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5041 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5042 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5043 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5045 ; GFX7-LABEL: v_fdiv_neglhs_f32_dynamic:
5047 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5048 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5049 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5050 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5051 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5052 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5053 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5054 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5055 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5056 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5057 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5058 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5059 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5060 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5061 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5062 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5064 ; GFX8-LABEL: v_fdiv_neglhs_f32_dynamic:
5066 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5067 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5068 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5069 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5070 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5071 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5072 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5073 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5074 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5075 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5076 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5077 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5078 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5079 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5080 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5081 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5083 ; GFX10-LABEL: v_fdiv_neglhs_f32_dynamic:
5085 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5086 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
5087 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5088 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5089 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5090 ; GFX10-NEXT: s_denorm_mode 15
5091 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5092 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5093 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5094 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5095 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5096 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5097 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5098 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5099 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5100 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5102 ; GFX11-LABEL: v_fdiv_neglhs_f32_dynamic:
5104 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5105 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
5106 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5107 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
5108 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5109 ; GFX11-NEXT: s_denorm_mode 15
5110 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5111 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5112 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5113 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5114 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5115 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5116 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5117 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
5118 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5119 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5120 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5122 ; EG-LABEL: v_fdiv_neglhs_f32_dynamic:
5126 %neg.x = fneg float %x
5127 %div = fdiv float %neg.x, %y
5131 define float @v_fdiv_neglhs_f32_dynamic_25ulp(float %x, float %y) #2 {
5132 ; GFX6-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5134 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5135 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
5136 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
5137 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
5138 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
5139 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5140 ; GFX6-NEXT: v_frexp_mant_f32_e64 v3, -v0
5141 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, s4
5142 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5143 ; GFX6-NEXT: v_cndmask_b32_e64 v3, -v0, v3, s[4:5]
5144 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5145 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5146 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5147 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5148 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5150 ; GFX7-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5152 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5153 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
5154 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5155 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5156 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5157 ; GFX7-NEXT: v_frexp_mant_f32_e64 v0, -v0
5158 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5159 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5160 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5161 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5163 ; GFX8-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5165 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5166 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
5167 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5168 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5169 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5170 ; GFX8-NEXT: v_frexp_mant_f32_e64 v0, -v0
5171 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5172 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5173 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5174 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5176 ; GFX10-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5178 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5179 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
5180 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5181 ; GFX10-NEXT: v_frexp_mant_f32_e64 v3, -v0
5182 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5183 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5184 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5185 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5186 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5187 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5189 ; GFX11-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5191 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5192 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
5193 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5194 ; GFX11-NEXT: v_frexp_mant_f32_e64 v3, -v0
5195 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5196 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5197 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5198 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5199 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5200 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5201 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5203 ; EG-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5207 %neg.x = fneg float %x
5208 %div = fdiv float %neg.x, %y, !fpmath !0
5212 define float @v_fdiv_neglhs_f32_daz(float %x, float %y) #0 {
5213 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_daz:
5214 ; GFX6-FASTFMA: ; %bb.0:
5215 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5216 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5217 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5218 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5219 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5220 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5221 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5222 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5223 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5224 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5225 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5226 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5227 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5228 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5229 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5231 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_daz:
5232 ; GFX6-SLOWFMA: ; %bb.0:
5233 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5234 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5235 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5236 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5237 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5238 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5239 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5240 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5241 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5242 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5243 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5244 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5245 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5246 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5247 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5249 ; GFX7-LABEL: v_fdiv_neglhs_f32_daz:
5251 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5252 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5253 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5254 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5255 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5256 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5257 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5258 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5259 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5260 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5261 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5262 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5263 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5264 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5265 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5267 ; GFX8-LABEL: v_fdiv_neglhs_f32_daz:
5269 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5270 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5271 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5272 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5273 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5274 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5275 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5276 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5277 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5278 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5279 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5280 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5281 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5282 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5283 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5285 ; GFX10-LABEL: v_fdiv_neglhs_f32_daz:
5287 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5288 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
5289 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5290 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5291 ; GFX10-NEXT: s_denorm_mode 15
5292 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5293 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5294 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5295 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5296 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5297 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5298 ; GFX10-NEXT: s_denorm_mode 12
5299 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5300 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5301 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5303 ; GFX11-LABEL: v_fdiv_neglhs_f32_daz:
5305 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5306 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
5307 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5308 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5309 ; GFX11-NEXT: s_denorm_mode 15
5310 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5311 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5312 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5313 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5314 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5315 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5316 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5317 ; GFX11-NEXT: s_denorm_mode 12
5318 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5319 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5320 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5322 ; EG-LABEL: v_fdiv_neglhs_f32_daz:
5326 %neg.x = fneg float %x
5327 %div = fdiv float %neg.x, %y
5331 define float @v_fdiv_neglhs_f32_daz_25ulp(float %x, float %y) #0 {
5332 ; GFX678-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5334 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5335 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
5336 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
5337 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
5338 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
5339 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
5340 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
5341 ; GFX678-NEXT: v_mul_f32_e64 v0, -v0, v1
5342 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
5343 ; GFX678-NEXT: s_setpc_b64 s[30:31]
5345 ; GFX10-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5347 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5348 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
5349 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
5350 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
5351 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
5352 ; GFX10-NEXT: v_mul_f32_e64 v0, -v0, v1
5353 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
5354 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5356 ; GFX11-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5358 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5359 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
5360 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
5361 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
5362 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
5363 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5364 ; GFX11-NEXT: v_mul_f32_e64 v0, -v0, v1
5365 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
5366 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5368 ; EG-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5372 %neg.x = fneg float %x
5373 %div = fdiv float %neg.x, %y, !fpmath !0
5377 define float @v_fdiv_negrhs_f32_ieee(float %x, float %y) #1 {
5378 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_ieee:
5379 ; GFX6-FASTFMA: ; %bb.0:
5380 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5381 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5382 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5383 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5384 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
5385 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5386 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5387 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5388 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5389 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5390 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5391 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5392 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5394 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_ieee:
5395 ; GFX6-SLOWFMA: ; %bb.0:
5396 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5397 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5398 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5399 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5400 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5401 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5402 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5403 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5404 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5405 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5406 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5407 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5408 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5410 ; GFX7-LABEL: v_fdiv_negrhs_f32_ieee:
5412 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5413 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5414 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5415 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5416 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
5417 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5418 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5419 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5420 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5421 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5422 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5423 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5424 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5426 ; GFX8-LABEL: v_fdiv_negrhs_f32_ieee:
5428 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5429 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5430 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5431 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5432 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5433 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5434 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5435 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5436 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5437 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5438 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5439 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5440 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5442 ; GFX10-LABEL: v_fdiv_negrhs_f32_ieee:
5444 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5445 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5446 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5447 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5448 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
5449 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5450 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5451 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5452 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5453 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5454 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5455 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5456 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5458 ; GFX11-LABEL: v_fdiv_negrhs_f32_ieee:
5460 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5461 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5462 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5463 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5464 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5465 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
5466 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5467 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5468 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5469 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5470 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5471 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5472 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5473 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5475 ; EG-LABEL: v_fdiv_negrhs_f32_ieee:
5479 %neg.y = fneg float %y
5480 %div = fdiv float %x, %neg.y
5484 define float @v_fdiv_negrhs_f32_ieee_25ulp(float %x, float %y) #1 {
5485 ; GFX6-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5487 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5488 ; GFX6-NEXT: s_mov_b32 s6, 0x7f800000
5489 ; GFX6-NEXT: v_frexp_mant_f32_e64 v2, -v1
5490 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v1|, s6
5491 ; GFX6-NEXT: v_cndmask_b32_e64 v2, -v1, v2, s[4:5]
5492 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5493 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
5494 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s6
5495 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5496 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
5497 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5498 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5499 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5500 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5501 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5503 ; GFX7-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5505 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5506 ; GFX7-NEXT: v_frexp_mant_f32_e64 v2, -v1
5507 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5508 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5509 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5510 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
5511 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5512 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5513 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5514 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5516 ; GFX8-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5518 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5519 ; GFX8-NEXT: v_frexp_mant_f32_e64 v2, -v1
5520 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5521 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5522 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5523 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
5524 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5525 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5526 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5527 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5529 ; GFX10-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5531 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5532 ; GFX10-NEXT: v_frexp_mant_f32_e64 v2, -v1
5533 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5534 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
5535 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5536 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5537 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5538 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5539 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5540 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5542 ; GFX11-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5544 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5545 ; GFX11-NEXT: v_frexp_mant_f32_e64 v2, -v1
5546 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5547 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
5548 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5549 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5550 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5551 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5552 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5553 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5554 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5556 ; EG-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5560 %neg.y = fneg float %y
5561 %div = fdiv float %x, %neg.y, !fpmath !0
5565 define float @v_fdiv_negrhs_f32_dynamic(float %x, float %y) #2 {
5566 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_dynamic:
5567 ; GFX6-FASTFMA: ; %bb.0:
5568 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5569 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5570 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5571 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5572 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5573 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5574 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5575 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5576 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5577 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5578 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5579 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5580 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5581 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5582 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5583 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5585 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_dynamic:
5586 ; GFX6-SLOWFMA: ; %bb.0:
5587 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5588 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5589 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5590 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5591 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5592 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5593 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5594 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5595 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5596 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5597 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5598 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5599 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5600 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5601 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5602 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5604 ; GFX7-LABEL: v_fdiv_negrhs_f32_dynamic:
5606 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5607 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5608 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5609 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5610 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5611 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5612 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5613 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5614 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5615 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5616 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5617 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5618 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5619 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5620 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5621 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5623 ; GFX8-LABEL: v_fdiv_negrhs_f32_dynamic:
5625 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5626 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5627 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5628 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5629 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5630 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5631 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5632 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5633 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5634 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5635 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5636 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5637 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5638 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5639 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5640 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5642 ; GFX10-LABEL: v_fdiv_negrhs_f32_dynamic:
5644 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5645 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5646 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5647 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5648 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5649 ; GFX10-NEXT: s_denorm_mode 15
5650 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5651 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5652 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5653 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5654 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5655 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5656 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5657 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5658 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5659 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5661 ; GFX11-LABEL: v_fdiv_negrhs_f32_dynamic:
5663 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5664 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5665 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5666 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
5667 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5668 ; GFX11-NEXT: s_denorm_mode 15
5669 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5670 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5671 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5672 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5673 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5674 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5675 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5676 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
5677 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5678 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5679 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5681 ; EG-LABEL: v_fdiv_negrhs_f32_dynamic:
5685 %neg.y = fneg float %y
5686 %div = fdiv float %x, %neg.y
5690 define float @v_fdiv_negrhs_f32_dynamic_25ulp(float %x, float %y) #2 {
5691 ; GFX6-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5693 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5694 ; GFX6-NEXT: s_mov_b32 s6, 0x7f800000
5695 ; GFX6-NEXT: v_frexp_mant_f32_e64 v2, -v1
5696 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v1|, s6
5697 ; GFX6-NEXT: v_cndmask_b32_e64 v2, -v1, v2, s[4:5]
5698 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5699 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
5700 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s6
5701 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5702 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
5703 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5704 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5705 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5706 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5707 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5709 ; GFX7-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5711 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5712 ; GFX7-NEXT: v_frexp_mant_f32_e64 v2, -v1
5713 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5714 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5715 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5716 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
5717 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5718 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5719 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5720 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5722 ; GFX8-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5724 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5725 ; GFX8-NEXT: v_frexp_mant_f32_e64 v2, -v1
5726 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5727 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5728 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5729 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
5730 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5731 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5732 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5733 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5735 ; GFX10-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5737 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5738 ; GFX10-NEXT: v_frexp_mant_f32_e64 v2, -v1
5739 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5740 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
5741 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5742 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5743 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5744 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5745 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5746 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5748 ; GFX11-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5750 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5751 ; GFX11-NEXT: v_frexp_mant_f32_e64 v2, -v1
5752 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5753 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
5754 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5755 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5756 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5757 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5758 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5759 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5760 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5762 ; EG-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5766 %neg.y = fneg float %y
5767 %div = fdiv float %x, %neg.y, !fpmath !0
5771 define float @v_fdiv_negrhs_f32_daz(float %x, float %y) #0 {
5772 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_daz:
5773 ; GFX6-FASTFMA: ; %bb.0:
5774 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5775 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5776 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5777 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5778 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5779 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5780 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5781 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5782 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5783 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5784 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5785 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5786 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5787 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5788 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5790 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_daz:
5791 ; GFX6-SLOWFMA: ; %bb.0:
5792 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5793 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5794 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5795 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5796 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5797 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5798 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5799 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5800 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5801 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5802 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5803 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5804 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5805 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5806 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5808 ; GFX7-LABEL: v_fdiv_negrhs_f32_daz:
5810 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5811 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5812 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5813 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5814 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5815 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5816 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5817 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5818 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5819 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5820 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5821 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5822 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5823 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5824 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5826 ; GFX8-LABEL: v_fdiv_negrhs_f32_daz:
5828 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5829 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5830 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5831 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5832 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5833 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5834 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5835 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5836 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5837 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5838 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5839 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5840 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5841 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5842 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5844 ; GFX10-LABEL: v_fdiv_negrhs_f32_daz:
5846 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5847 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5848 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5849 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5850 ; GFX10-NEXT: s_denorm_mode 15
5851 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5852 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5853 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5854 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5855 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5856 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5857 ; GFX10-NEXT: s_denorm_mode 12
5858 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5859 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5860 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5862 ; GFX11-LABEL: v_fdiv_negrhs_f32_daz:
5864 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5865 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5866 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5867 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5868 ; GFX11-NEXT: s_denorm_mode 15
5869 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5870 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5871 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5872 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5873 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5874 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5875 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5876 ; GFX11-NEXT: s_denorm_mode 12
5877 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5878 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5879 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5881 ; EG-LABEL: v_fdiv_negrhs_f32_daz:
5885 %neg.y = fneg float %y
5886 %div = fdiv float %x, %neg.y
5890 define float @v_fdiv_negrhs_f32_daz_25ulp(float %x, float %y) #0 {
5891 ; GFX678-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5893 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5894 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
5895 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
5896 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
5897 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
5898 ; GFX678-NEXT: v_mul_f32_e64 v1, -v1, v2
5899 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
5900 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
5901 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
5902 ; GFX678-NEXT: s_setpc_b64 s[30:31]
5904 ; GFX10-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5906 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5907 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
5908 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
5909 ; GFX10-NEXT: v_mul_f32_e64 v1, -v1, v2
5910 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
5911 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
5912 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
5913 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5915 ; GFX11-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5917 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5918 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
5919 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
5920 ; GFX11-NEXT: v_mul_f32_e64 v1, -v1, v2
5921 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
5922 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5923 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
5924 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
5925 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5927 ; EG-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5931 %neg.y = fneg float %y
5932 %div = fdiv float %x, %neg.y, !fpmath !0
5936 define float @v_fdiv_f32_constrhs0_ieee(float %x) #1 {
5937 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_ieee:
5938 ; GFX6-FASTFMA: ; %bb.0:
5939 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5940 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
5941 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5942 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
5943 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v1, v2, 1.0
5944 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v3, v2, v2
5945 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
5946 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
5947 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
5948 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
5949 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
5950 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
5951 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5952 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5954 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_ieee:
5955 ; GFX6-SLOWFMA: ; %bb.0:
5956 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5957 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
5958 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5959 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
5960 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
5961 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
5962 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
5963 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
5964 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
5965 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
5966 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
5967 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
5968 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5969 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5971 ; GFX7-LABEL: v_fdiv_f32_constrhs0_ieee:
5973 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5974 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
5975 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5976 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
5977 ; GFX7-NEXT: v_fma_f32 v3, -v1, v2, 1.0
5978 ; GFX7-NEXT: v_fma_f32 v2, v3, v2, v2
5979 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
5980 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
5981 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
5982 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
5983 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
5984 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
5985 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5986 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5988 ; GFX8-LABEL: v_fdiv_f32_constrhs0_ieee:
5990 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5991 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
5992 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5993 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
5994 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
5995 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
5996 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
5997 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
5998 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
5999 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6000 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6001 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6002 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6003 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6005 ; GFX10-LABEL: v_fdiv_f32_constrhs0_ieee:
6007 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6008 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6009 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6010 ; GFX10-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6011 ; GFX10-NEXT: v_fmac_f32_e32 v2, v3, v2
6012 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6013 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6014 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6015 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6016 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6017 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6018 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6019 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6021 ; GFX11-LABEL: v_fdiv_f32_constrhs0_ieee:
6023 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6024 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6025 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6026 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6027 ; GFX11-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6028 ; GFX11-NEXT: v_fmac_f32_e32 v2, v3, v2
6029 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6030 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6031 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6032 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6033 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6034 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6035 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6036 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6038 ; EG-LABEL: v_fdiv_f32_constrhs0_ieee:
6042 %div = fdiv float %x, 12345.0
6046 define float @v_fdiv_f32_constrhs0_ieee_25ulp(float %x) #1 {
6047 ; GFX6-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6049 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6050 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6051 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v0
6052 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6053 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, 0x4640e400
6054 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v0, v2, vcc
6055 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6056 ; GFX6-NEXT: v_mul_f32_e32 v2, 0x3fa9e0f0, v2
6057 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
6058 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
6059 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6061 ; GFX7-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6063 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6064 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6065 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
6066 ; GFX7-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6067 ; GFX7-NEXT: v_add_i32_e32 v1, vcc, -14, v1
6068 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
6069 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6071 ; GFX8-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6073 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6074 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6075 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
6076 ; GFX8-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6077 ; GFX8-NEXT: v_add_u32_e32 v1, vcc, -14, v1
6078 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
6079 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6081 ; GFX10-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6083 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6084 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6085 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6086 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3fa9e0f0, v1
6087 ; GFX10-NEXT: v_add_nc_u32_e32 v0, -14, v0
6088 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6089 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6091 ; GFX11-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6093 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6094 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6095 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6096 ; GFX11-NEXT: v_dual_mul_f32 v1, 0x3fa9e0f0, v1 :: v_dual_add_nc_u32 v0, -14, v0
6097 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6098 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6100 ; EG-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6104 %div = fdiv float %x, 12345.0, !fpmath !0
6108 define float @v_fdiv_f32_constrhs0_dynamic(float %x) #2 {
6109 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_dynamic:
6110 ; GFX6-FASTFMA: ; %bb.0:
6111 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6112 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6113 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6114 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6115 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6116 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6117 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6118 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6119 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6120 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6121 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6122 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6123 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6124 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6125 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6126 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6127 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6129 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_dynamic:
6130 ; GFX6-SLOWFMA: ; %bb.0:
6131 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6132 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6133 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6134 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6135 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6136 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6137 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6138 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6139 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6140 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6141 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6142 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6143 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6144 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6145 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6146 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6147 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6149 ; GFX7-LABEL: v_fdiv_f32_constrhs0_dynamic:
6151 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6152 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6153 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6154 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6155 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6156 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6157 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6158 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6159 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6160 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6161 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6162 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6163 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6164 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6165 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6166 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6167 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6169 ; GFX8-LABEL: v_fdiv_f32_constrhs0_dynamic:
6171 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6172 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6173 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6174 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6175 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6176 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6177 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6178 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6179 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6180 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6181 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6182 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6183 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6184 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6185 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6186 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6187 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6189 ; GFX10-LABEL: v_fdiv_f32_constrhs0_dynamic:
6191 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6192 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6193 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6194 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6195 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6196 ; GFX10-NEXT: s_denorm_mode 15
6197 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6198 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6199 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6200 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6201 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6202 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6203 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6204 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6205 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6206 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6208 ; GFX11-LABEL: v_fdiv_f32_constrhs0_dynamic:
6210 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6211 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6212 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6213 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
6214 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6215 ; GFX11-NEXT: s_denorm_mode 15
6216 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6217 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6218 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6219 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6220 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6221 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6222 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6223 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
6224 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6225 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6226 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6228 ; EG-LABEL: v_fdiv_f32_constrhs0_dynamic:
6232 %div = fdiv float %x, 12345.0
6236 define float @v_fdiv_f32_constrhs0_dynamic_25ulp(float %x) #2 {
6237 ; GFX6-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6239 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6240 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6241 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v0
6242 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6243 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, 0x4640e400
6244 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v0, v2, vcc
6245 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6246 ; GFX6-NEXT: v_mul_f32_e32 v2, 0x3fa9e0f0, v2
6247 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
6248 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
6249 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6251 ; GFX7-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6253 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6254 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6255 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
6256 ; GFX7-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6257 ; GFX7-NEXT: v_add_i32_e32 v1, vcc, -14, v1
6258 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
6259 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6261 ; GFX8-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6263 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6264 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6265 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
6266 ; GFX8-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6267 ; GFX8-NEXT: v_add_u32_e32 v1, vcc, -14, v1
6268 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
6269 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6271 ; GFX10-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6273 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6274 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6275 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6276 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3fa9e0f0, v1
6277 ; GFX10-NEXT: v_add_nc_u32_e32 v0, -14, v0
6278 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6279 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6281 ; GFX11-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6283 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6284 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6285 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6286 ; GFX11-NEXT: v_dual_mul_f32 v1, 0x3fa9e0f0, v1 :: v_dual_add_nc_u32 v0, -14, v0
6287 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6288 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6290 ; EG-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6294 %div = fdiv float %x, 12345.0, !fpmath !0
6298 define float @v_fdiv_f32_constrhs0_daz(float %x) #0 {
6299 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_daz:
6300 ; GFX6-FASTFMA: ; %bb.0:
6301 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6302 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6303 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6304 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6305 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6306 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6307 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6308 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6309 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6310 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6311 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6312 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6313 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6314 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6315 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6316 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6318 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_daz:
6319 ; GFX6-SLOWFMA: ; %bb.0:
6320 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6321 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6322 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6323 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6324 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6325 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6326 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6327 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6328 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6329 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6330 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6331 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6332 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6333 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6334 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6335 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6337 ; GFX7-LABEL: v_fdiv_f32_constrhs0_daz:
6339 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6340 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6341 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6342 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6343 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6344 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6345 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6346 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6347 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6348 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6349 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6350 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6351 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6352 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6353 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6354 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6356 ; GFX8-LABEL: v_fdiv_f32_constrhs0_daz:
6358 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6359 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6360 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6361 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6362 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6363 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6364 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6365 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6366 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6367 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6368 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6369 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6370 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6371 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6372 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6373 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6375 ; GFX10-LABEL: v_fdiv_f32_constrhs0_daz:
6377 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6378 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6379 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6380 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6381 ; GFX10-NEXT: s_denorm_mode 15
6382 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6383 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6384 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6385 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6386 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6387 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6388 ; GFX10-NEXT: s_denorm_mode 12
6389 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6390 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6391 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6393 ; GFX11-LABEL: v_fdiv_f32_constrhs0_daz:
6395 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6396 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6397 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6398 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6399 ; GFX11-NEXT: s_denorm_mode 15
6400 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6401 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6402 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6403 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6404 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6405 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6406 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6407 ; GFX11-NEXT: s_denorm_mode 12
6408 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6409 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6410 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6412 ; EG-LABEL: v_fdiv_f32_constrhs0_daz:
6416 %div = fdiv float %x, 12345.0
6420 define float @v_fdiv_f32_constrhs0_daz_25ulp(float %x) #0 {
6421 ; GCN-LABEL: v_fdiv_f32_constrhs0_daz_25ulp:
6423 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6424 ; GCN-NEXT: v_mul_f32_e32 v0, 0x38a9e0f0, v0
6425 ; GCN-NEXT: s_setpc_b64 s[30:31]
6427 ; EG-LABEL: v_fdiv_f32_constrhs0_daz_25ulp:
6431 %div = fdiv float %x, 12345.0, !fpmath !0
6435 define float @v_fdiv_f32_constlhs0_ieee(float %x) #1 {
6436 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_ieee:
6437 ; GFX6-FASTFMA: ; %bb.0:
6438 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6439 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6440 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6441 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6442 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6443 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v3, v2, v2
6444 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6445 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6446 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6447 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6448 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6449 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6450 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6451 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6453 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_ieee:
6454 ; GFX6-SLOWFMA: ; %bb.0:
6455 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6456 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6457 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6458 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6459 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6460 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6461 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6462 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6463 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6464 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6465 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6466 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6467 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6468 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6470 ; GFX7-LABEL: v_fdiv_f32_constlhs0_ieee:
6472 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6473 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6474 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6475 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6476 ; GFX7-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6477 ; GFX7-NEXT: v_fma_f32 v2, v3, v2, v2
6478 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6479 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6480 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6481 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6482 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6483 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6484 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6485 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6487 ; GFX8-LABEL: v_fdiv_f32_constlhs0_ieee:
6489 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6490 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6491 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6492 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6493 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6494 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6495 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6496 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6497 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6498 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6499 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6500 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6501 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6502 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6504 ; GFX10-LABEL: v_fdiv_f32_constlhs0_ieee:
6506 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6507 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6508 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6509 ; GFX10-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6510 ; GFX10-NEXT: v_fmac_f32_e32 v2, v3, v2
6511 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6512 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6513 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6514 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6515 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6516 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6517 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6518 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6520 ; GFX11-LABEL: v_fdiv_f32_constlhs0_ieee:
6522 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6523 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6524 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6525 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6526 ; GFX11-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6527 ; GFX11-NEXT: v_fmac_f32_e32 v2, v3, v2
6528 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6529 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6530 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6531 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6532 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6533 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6534 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6535 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6537 ; EG-LABEL: v_fdiv_f32_constlhs0_ieee:
6541 %div = fdiv float 12345.0, %x
6545 define float @v_fdiv_f32_constlhs0_ieee_25ulp(float %x) #1 {
6546 ; GFX6-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6548 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6549 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6550 ; GFX6-NEXT: v_frexp_mant_f32_e32 v1, v0
6551 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6552 ; GFX6-NEXT: v_cndmask_b32_e32 v1, v0, v1, vcc
6553 ; GFX6-NEXT: v_rcp_f32_e32 v1, v1
6554 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6555 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v2, 0x4640e400
6556 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v2, v0
6557 ; GFX6-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6558 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v1, v0
6559 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6561 ; GFX7-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6563 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6564 ; GFX7-NEXT: v_frexp_mant_f32_e32 v1, v0
6565 ; GFX7-NEXT: v_rcp_f32_e32 v1, v1
6566 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6567 ; GFX7-NEXT: v_sub_i32_e32 v0, vcc, 14, v0
6568 ; GFX7-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6569 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v1, v0
6570 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6572 ; GFX8-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6574 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6575 ; GFX8-NEXT: v_frexp_mant_f32_e32 v1, v0
6576 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
6577 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6578 ; GFX8-NEXT: v_sub_u32_e32 v0, vcc, 14, v0
6579 ; GFX8-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6580 ; GFX8-NEXT: v_ldexp_f32 v0, v1, v0
6581 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6583 ; GFX10-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6585 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6586 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6587 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6588 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
6589 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6590 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6591 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6592 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6594 ; GFX11-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6596 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6597 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6598 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6599 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
6600 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6601 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6602 ; GFX11-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6603 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6604 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6606 ; EG-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6610 %div = fdiv float 12345.0, %x, !fpmath !0
6614 define float @v_fdiv_f32_constlhs0_dynamic(float %x) #2 {
6615 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_dynamic:
6616 ; GFX6-FASTFMA: ; %bb.0:
6617 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6618 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6619 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6620 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6621 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6622 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6623 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6624 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6625 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6626 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6627 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6628 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6629 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6630 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6631 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6632 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6633 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6635 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_dynamic:
6636 ; GFX6-SLOWFMA: ; %bb.0:
6637 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6638 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6639 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6640 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6641 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6642 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6643 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6644 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6645 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6646 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6647 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6648 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6649 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6650 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6651 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6652 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6653 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6655 ; GFX7-LABEL: v_fdiv_f32_constlhs0_dynamic:
6657 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6658 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6659 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6660 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6661 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6662 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6663 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6664 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6665 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6666 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6667 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6668 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6669 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6670 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6671 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6672 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6673 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6675 ; GFX8-LABEL: v_fdiv_f32_constlhs0_dynamic:
6677 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6678 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6679 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6680 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6681 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6682 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6683 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6684 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6685 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6686 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6687 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6688 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6689 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6690 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6691 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6692 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6693 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6695 ; GFX10-LABEL: v_fdiv_f32_constlhs0_dynamic:
6697 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6698 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6699 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6700 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6701 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6702 ; GFX10-NEXT: s_denorm_mode 15
6703 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6704 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6705 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6706 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6707 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6708 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6709 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6710 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6711 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6712 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6714 ; GFX11-LABEL: v_fdiv_f32_constlhs0_dynamic:
6716 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6717 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6718 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6719 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
6720 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6721 ; GFX11-NEXT: s_denorm_mode 15
6722 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6723 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6724 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6725 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6726 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6727 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6728 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6729 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
6730 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6731 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6732 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6734 ; EG-LABEL: v_fdiv_f32_constlhs0_dynamic:
6738 %div = fdiv float 12345.0, %x
6742 define float @v_fdiv_f32_constlhs0_dynamic_25ulp(float %x) #2 {
6743 ; GFX6-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6745 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6746 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6747 ; GFX6-NEXT: v_frexp_mant_f32_e32 v1, v0
6748 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6749 ; GFX6-NEXT: v_cndmask_b32_e32 v1, v0, v1, vcc
6750 ; GFX6-NEXT: v_rcp_f32_e32 v1, v1
6751 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6752 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v2, 0x4640e400
6753 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v2, v0
6754 ; GFX6-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6755 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v1, v0
6756 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6758 ; GFX7-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6760 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6761 ; GFX7-NEXT: v_frexp_mant_f32_e32 v1, v0
6762 ; GFX7-NEXT: v_rcp_f32_e32 v1, v1
6763 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6764 ; GFX7-NEXT: v_sub_i32_e32 v0, vcc, 14, v0
6765 ; GFX7-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6766 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v1, v0
6767 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6769 ; GFX8-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6771 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6772 ; GFX8-NEXT: v_frexp_mant_f32_e32 v1, v0
6773 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
6774 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6775 ; GFX8-NEXT: v_sub_u32_e32 v0, vcc, 14, v0
6776 ; GFX8-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6777 ; GFX8-NEXT: v_ldexp_f32 v0, v1, v0
6778 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6780 ; GFX10-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6782 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6783 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6784 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6785 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
6786 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6787 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6788 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6789 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6791 ; GFX11-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6793 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6794 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6795 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6796 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
6797 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6798 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6799 ; GFX11-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6800 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6801 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6803 ; EG-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6807 %div = fdiv float 12345.0, %x, !fpmath !0
6811 define float @v_fdiv_f32_constlhs0_daz(float %x) #0 {
6812 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_daz:
6813 ; GFX6-FASTFMA: ; %bb.0:
6814 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6815 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6816 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6817 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6818 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6819 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6820 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6821 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6822 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6823 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6824 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6825 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6826 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6827 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6828 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6829 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6831 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_daz:
6832 ; GFX6-SLOWFMA: ; %bb.0:
6833 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6834 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6835 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6836 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6837 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6838 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6839 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6840 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6841 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6842 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6843 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6844 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6845 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6846 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6847 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6848 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6850 ; GFX7-LABEL: v_fdiv_f32_constlhs0_daz:
6852 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6853 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6854 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6855 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6856 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6857 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6858 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6859 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6860 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6861 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6862 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6863 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6864 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6865 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6866 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6867 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6869 ; GFX8-LABEL: v_fdiv_f32_constlhs0_daz:
6871 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6872 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6873 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6874 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6875 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6876 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6877 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6878 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6879 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6880 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6881 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6882 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6883 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6884 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6885 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6886 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6888 ; GFX10-LABEL: v_fdiv_f32_constlhs0_daz:
6890 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6891 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6892 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6893 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6894 ; GFX10-NEXT: s_denorm_mode 15
6895 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6896 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6897 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6898 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6899 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6900 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6901 ; GFX10-NEXT: s_denorm_mode 12
6902 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6903 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6904 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6906 ; GFX11-LABEL: v_fdiv_f32_constlhs0_daz:
6908 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6909 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6910 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6911 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6912 ; GFX11-NEXT: s_denorm_mode 15
6913 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6914 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6915 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6916 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6917 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6918 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6919 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6920 ; GFX11-NEXT: s_denorm_mode 12
6921 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6922 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6923 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6925 ; EG-LABEL: v_fdiv_f32_constlhs0_daz:
6929 %div = fdiv float 12345.0, %x
6933 define float @v_fdiv_f32_constlhs0_daz_25ulp(float %x) #0 {
6934 ; GFX678-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6936 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6937 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
6938 ; GFX678-NEXT: v_mov_b32_e32 v1, 0x2f800000
6939 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v0|, s4
6940 ; GFX678-NEXT: v_cndmask_b32_e32 v1, 1.0, v1, vcc
6941 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
6942 ; GFX678-NEXT: v_rcp_f32_e32 v0, v0
6943 ; GFX678-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6944 ; GFX678-NEXT: v_mul_f32_e32 v0, v1, v0
6945 ; GFX678-NEXT: s_setpc_b64 s[30:31]
6947 ; GFX10-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6949 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6950 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v0|
6951 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 1.0, 0x2f800000, s4
6952 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
6953 ; GFX10-NEXT: v_rcp_f32_e32 v0, v0
6954 ; GFX10-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6955 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v0
6956 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6958 ; GFX11-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6960 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6961 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v0|
6962 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 1.0, 0x2f800000, s0
6963 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
6964 ; GFX11-NEXT: v_rcp_f32_e32 v0, v0
6965 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6966 ; GFX11-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6967 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v0
6968 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6970 ; EG-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6974 %div = fdiv float 12345.0, %x, !fpmath !0
6978 define float @v_fdiv_f32_ieee_nodenorm_x(float nofpclass(sub) %x, float %y) #1 {
6979 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_nodenorm_x:
6980 ; GFX6-FASTFMA: ; %bb.0:
6981 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6982 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
6983 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
6984 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
6985 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6986 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
6987 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
6988 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
6989 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
6990 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
6991 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
6992 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
6993 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6995 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_nodenorm_x:
6996 ; GFX6-SLOWFMA: ; %bb.0:
6997 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6998 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
6999 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7000 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7001 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7002 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7003 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7004 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7005 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7006 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7007 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7008 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7009 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7011 ; GFX7-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7013 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7014 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7015 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7016 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7017 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
7018 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7019 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7020 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7021 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7022 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7023 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7024 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7025 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7027 ; GFX8-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7029 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7030 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7031 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7032 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7033 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7034 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7035 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7036 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7037 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7038 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7039 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7040 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7041 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7043 ; GFX10-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7045 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7046 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7047 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7048 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7049 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
7050 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7051 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7052 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7053 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7054 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7055 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7056 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7057 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7059 ; GFX11-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7061 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7062 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7063 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7064 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7065 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7066 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
7067 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7068 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7069 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7070 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7071 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7072 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7073 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7074 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7076 ; EG-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7080 %div = fdiv float %x, %y
7084 define float @v_fdiv_f32_ieee_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #1 {
7085 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7087 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7088 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7089 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7090 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7091 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7092 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7093 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7094 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7095 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7096 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7097 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7098 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7099 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7100 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7101 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7103 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7105 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7106 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7107 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7108 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7109 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7110 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7111 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7112 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7113 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7114 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7116 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7118 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7119 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7120 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7121 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7122 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7123 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7124 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7125 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7126 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7127 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7129 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7131 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7132 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7133 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7134 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7135 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7136 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7137 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7138 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7139 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7140 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7142 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7144 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7145 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7146 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7147 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7148 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7149 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7150 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7151 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7152 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7153 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7154 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7156 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7160 %div = fdiv float %x, %y, !fpmath !0
7164 define float @v_fdiv_f32_dynamic_nodenorm_x(float nofpclass(sub) %x, float %y) #2 {
7165 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7166 ; GFX6-FASTFMA: ; %bb.0:
7167 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7168 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7169 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7170 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7171 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7172 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7173 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7174 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7175 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7176 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7177 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7178 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7179 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7180 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7181 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7182 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7184 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7185 ; GFX6-SLOWFMA: ; %bb.0:
7186 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7187 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7188 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7189 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7190 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7191 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7192 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7193 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7194 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7195 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7196 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7197 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7198 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7199 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7200 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7201 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7203 ; GFX7-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7205 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7206 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7207 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7208 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7209 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7210 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7211 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7212 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7213 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7214 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7215 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7216 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7217 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7218 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7219 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7220 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7222 ; GFX8-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7224 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7225 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7226 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7227 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7228 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7229 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7230 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7231 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7232 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7233 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7234 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7235 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7236 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7237 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7238 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7239 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7241 ; GFX10-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7243 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7244 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7245 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7246 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7247 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7248 ; GFX10-NEXT: s_denorm_mode 15
7249 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7250 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7251 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7252 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7253 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7254 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7255 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7256 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7257 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7258 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7260 ; GFX11-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7262 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7263 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7264 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7265 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
7266 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7267 ; GFX11-NEXT: s_denorm_mode 15
7268 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7269 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7270 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7271 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7272 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7273 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7274 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7275 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
7276 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7277 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7278 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7280 ; EG-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7284 %div = fdiv float %x, %y
7288 define float @v_fdiv_f32_dynamic_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #2 {
7289 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7291 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7292 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7293 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7294 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7295 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7296 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7297 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7298 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7299 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7300 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7301 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7302 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7303 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7304 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7305 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7307 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7309 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7310 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7311 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7312 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7313 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7314 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7315 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7316 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7317 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7318 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7320 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7322 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7323 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7324 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7325 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7326 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7327 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7328 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7329 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7330 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7331 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7333 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7335 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7336 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7337 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7338 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7339 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7340 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7341 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7342 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7343 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7344 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7346 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7348 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7349 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7350 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7351 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7352 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7353 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7354 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7355 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7356 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7357 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7358 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7360 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7364 %div = fdiv float %x, %y, !fpmath !0
7368 define float @v_fdiv_f32_daz_nodenorm_x(float nofpclass(sub) %x, float %y) #0 {
7369 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_nodenorm_x:
7370 ; GFX6-FASTFMA: ; %bb.0:
7371 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7372 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7373 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7374 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7375 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7376 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7377 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7378 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7379 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7380 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7381 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7382 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7383 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7384 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7385 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7387 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_nodenorm_x:
7388 ; GFX6-SLOWFMA: ; %bb.0:
7389 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7390 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7391 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7392 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7393 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7394 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7395 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7396 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7397 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7398 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7399 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7400 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7401 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7402 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7403 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7405 ; GFX7-LABEL: v_fdiv_f32_daz_nodenorm_x:
7407 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7408 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7409 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7410 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7411 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7412 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7413 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7414 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7415 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7416 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7417 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7418 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7419 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7420 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7421 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7423 ; GFX8-LABEL: v_fdiv_f32_daz_nodenorm_x:
7425 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7426 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7427 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7428 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7429 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7430 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7431 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7432 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7433 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7434 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7435 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7436 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7437 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7438 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7439 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7441 ; GFX10-LABEL: v_fdiv_f32_daz_nodenorm_x:
7443 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7444 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7445 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7446 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7447 ; GFX10-NEXT: s_denorm_mode 15
7448 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7449 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7450 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7451 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7452 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7453 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7454 ; GFX10-NEXT: s_denorm_mode 12
7455 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7456 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7457 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7459 ; GFX11-LABEL: v_fdiv_f32_daz_nodenorm_x:
7461 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7462 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7463 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7464 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7465 ; GFX11-NEXT: s_denorm_mode 15
7466 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7467 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7468 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7469 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7470 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7471 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7472 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7473 ; GFX11-NEXT: s_denorm_mode 12
7474 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7475 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7476 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7478 ; EG-LABEL: v_fdiv_f32_daz_nodenorm_x:
7482 %div = fdiv float %x, %y
7486 define float @v_fdiv_f32_daz_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #0 {
7487 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7489 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7490 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
7491 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
7492 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
7493 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
7494 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
7495 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
7496 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
7497 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
7498 ; GFX678-NEXT: s_setpc_b64 s[30:31]
7500 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7502 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7503 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
7504 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
7505 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
7506 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
7507 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
7508 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
7509 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7511 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7513 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7514 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
7515 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
7516 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
7517 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
7518 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7519 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
7520 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
7521 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7523 ; EG-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7527 %div = fdiv float %x, %y, !fpmath !0
7531 define float @v_fdiv_f32_ieee_nodenorm_y(float %x, float nofpclass(sub) %y) #1 {
7532 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7533 ; GFX6-FASTFMA: ; %bb.0:
7534 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7535 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7536 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7537 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7538 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
7539 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7540 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7541 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7542 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7543 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7544 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7545 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7546 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7548 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7549 ; GFX6-SLOWFMA: ; %bb.0:
7550 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7551 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7552 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7553 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7554 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7555 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7556 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7557 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7558 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7559 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7560 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7561 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7562 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7564 ; GFX7-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7566 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7567 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7568 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7569 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7570 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
7571 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7572 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7573 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7574 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7575 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7576 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7577 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7578 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7580 ; GFX8-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7582 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7583 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7584 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7585 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7586 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7587 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7588 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7589 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7590 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7591 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7592 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7593 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7594 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7596 ; GFX10-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7598 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7599 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7600 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7601 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7602 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
7603 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7604 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7605 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7606 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7607 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7608 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7609 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7610 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7612 ; GFX11-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7614 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7615 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7616 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7617 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7618 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7619 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
7620 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7621 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7622 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7623 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7624 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7625 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7626 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7627 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7629 ; EG-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7633 %div = fdiv float %x, %y
7637 define float @v_fdiv_f32_ieee_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #1 {
7638 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7640 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7641 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7642 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7643 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7644 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7645 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7646 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7647 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7648 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7649 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7650 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7651 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7652 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7653 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7654 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7656 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7658 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7659 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7660 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7661 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7662 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7663 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7664 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7665 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7666 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7667 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7669 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7671 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7672 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7673 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7674 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7675 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7676 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7677 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7678 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7679 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7680 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7682 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7684 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7685 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7686 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7687 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7688 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7689 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7690 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7691 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7692 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7693 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7695 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7697 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7698 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7699 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7700 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7701 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7702 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7703 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7704 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7705 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7706 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7707 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7709 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7713 %div = fdiv float %x, %y, !fpmath !0
7717 define float @v_fdiv_f32_dynamic_nodenorm_y(float %x, float nofpclass(sub) %y) #2 {
7718 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7719 ; GFX6-FASTFMA: ; %bb.0:
7720 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7721 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7722 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7723 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7724 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7725 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7726 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7727 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7728 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7729 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7730 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7731 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7732 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7733 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7734 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7735 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7737 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7738 ; GFX6-SLOWFMA: ; %bb.0:
7739 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7740 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7741 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7742 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7743 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7744 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7745 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7746 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7747 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7748 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7749 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7750 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7751 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7752 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7753 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7754 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7756 ; GFX7-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7758 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7759 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7760 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7761 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7762 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7763 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7764 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7765 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7766 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7767 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7768 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7769 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7770 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7771 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7772 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7773 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7775 ; GFX8-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7777 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7778 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7779 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7780 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7781 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7782 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7783 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7784 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7785 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7786 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7787 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7788 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7789 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7790 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7791 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7792 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7794 ; GFX10-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7796 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7797 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7798 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7799 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7800 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7801 ; GFX10-NEXT: s_denorm_mode 15
7802 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7803 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7804 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7805 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7806 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7807 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7808 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7809 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7810 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7811 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7813 ; GFX11-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7815 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7816 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7817 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7818 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
7819 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7820 ; GFX11-NEXT: s_denorm_mode 15
7821 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7822 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7823 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7824 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7825 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7826 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7827 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7828 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
7829 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7830 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7831 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7833 ; EG-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7837 %div = fdiv float %x, %y
7841 define float @v_fdiv_f32_dynamic_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #2 {
7842 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7844 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7845 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7846 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7847 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7848 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7849 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7850 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7851 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7852 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7853 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7854 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7855 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7856 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7857 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7858 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7860 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7862 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7863 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7864 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7865 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7866 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7867 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7868 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7869 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7870 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7871 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7873 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7875 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7876 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7877 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7878 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7879 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7880 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7881 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7882 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7883 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7884 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7886 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7888 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7889 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7890 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7891 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7892 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7893 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7894 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7895 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7896 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7897 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7899 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7901 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7902 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7903 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7904 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7905 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7906 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7907 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7908 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7909 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7910 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7911 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7913 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7917 %div = fdiv float %x, %y, !fpmath !0
7921 define float @v_fdiv_f32_daz_nodenorm_y(float %x, float nofpclass(sub) %y) #0 {
7922 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_nodenorm_y:
7923 ; GFX6-FASTFMA: ; %bb.0:
7924 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7925 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7926 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7927 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7928 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7929 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7930 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7931 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7932 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7933 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7934 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7935 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7936 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7937 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7938 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7940 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_nodenorm_y:
7941 ; GFX6-SLOWFMA: ; %bb.0:
7942 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7943 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7944 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7945 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7946 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7947 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7948 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7949 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7950 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7951 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7952 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7953 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7954 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7955 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7956 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7958 ; GFX7-LABEL: v_fdiv_f32_daz_nodenorm_y:
7960 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7961 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7962 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7963 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7964 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7965 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7966 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7967 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7968 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7969 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7970 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7971 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7972 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7973 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7974 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7976 ; GFX8-LABEL: v_fdiv_f32_daz_nodenorm_y:
7978 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7979 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7980 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7981 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7982 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7983 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7984 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7985 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7986 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7987 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7988 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7989 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7990 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7991 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7992 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7994 ; GFX10-LABEL: v_fdiv_f32_daz_nodenorm_y:
7996 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7997 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7998 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7999 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
8000 ; GFX10-NEXT: s_denorm_mode 15
8001 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
8002 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
8003 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
8004 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
8005 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
8006 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
8007 ; GFX10-NEXT: s_denorm_mode 12
8008 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
8009 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
8010 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8012 ; GFX11-LABEL: v_fdiv_f32_daz_nodenorm_y:
8014 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8015 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
8016 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
8017 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
8018 ; GFX11-NEXT: s_denorm_mode 15
8019 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
8020 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
8021 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
8022 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
8023 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
8024 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
8025 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
8026 ; GFX11-NEXT: s_denorm_mode 12
8027 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
8028 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
8029 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8031 ; EG-LABEL: v_fdiv_f32_daz_nodenorm_y:
8035 %div = fdiv float %x, %y
8039 define float @v_fdiv_f32_daz_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #0 {
8040 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8042 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8043 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
8044 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
8045 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
8046 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
8047 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
8048 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
8049 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
8050 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
8051 ; GFX678-NEXT: s_setpc_b64 s[30:31]
8053 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8055 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8056 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
8057 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
8058 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
8059 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
8060 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
8061 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
8062 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8064 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8066 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8067 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
8068 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
8069 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
8070 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
8071 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
8072 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
8073 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
8074 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8076 ; EG-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8080 %div = fdiv float %x, %y, !fpmath !0
8084 attributes #0 = { "denormal-fp-math-f32"="preserve-sign,preserve-sign" }
8085 attributes #1 = { "denormal-fp-math-f32"="ieee,ieee" }
8086 attributes #2 = { "denormal-fp-math-f32"="dynamic,dynamic" }
8088 !0 = !{float 2.500000e+00}