1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX6,GFX6-FASTFMA %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=pitcairn < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX6,GFX6-SLOWFMA %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=hawaii < %s | FileCheck -check-prefixes=GCN,GFX678,GFX67,GFX7 %s
5 ; RUN: llc -mtriple=amdgcn -mcpu=fiji < %s | FileCheck -check-prefixes=GCN,GFX678,GFX8 %s
6 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GCN,GFX10 %s
7 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefixes=GCN,GFX11 %s
8 ; RUN: llc -mtriple=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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 0x24
122 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
123 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s7, s7, s6
124 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s6, s7, s6
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, s7, s6
137 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 0x24
279 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
280 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s7, s7, s6
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, s6, s7, s6
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, s7, s6
292 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 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 s0, 0x6f800000, |s7|
377 ; GFX10-NEXT: v_cndmask_b32_e64 v0, 1.0, 0x2f800000, s0
378 ; GFX10-NEXT: v_mul_f32_e32 v1, s7, v0
379 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
380 ; GFX10-NEXT: v_mul_f32_e32 v1, s6, v1
381 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
382 ; GFX10-NEXT: global_store_dword v2, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 0x24
486 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
487 ; GFX10-NEXT: v_frexp_mant_f32_e32 v0, s7
488 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, s7
489 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, s6
490 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v3, s6
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[4:5]
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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 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, s7
566 ; GFX10-NEXT: v_mul_f32_e32 v0, s6, v0
567 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 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, s7
630 ; GFX10-NEXT: v_mul_f32_e32 v0, s6, v0
631 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 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, s7
694 ; GFX10-NEXT: v_mul_f32_e32 v0, s6, v0
695 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 0x24
833 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
834 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s7, s7, s6
835 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s6, s7, s6
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, s7, s6
848 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 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[2:3], 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[4:7], s[2:3], 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, s7
923 ; GFX10-NEXT: v_mul_f32_e32 v0, s6, v0
924 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
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[2:3], 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[2:3], 0xb
960 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 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[2:3], 0xb
1000 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1001 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s5
1002 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[0:1], s7, s7, v0
1003 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s7
1004 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s5, v2, s5
1005 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v4, s4
1006 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
1007 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1008 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1009 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v5, v3, v3
1010 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v2, v3
1011 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v1, v5, v2
1012 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v3, v5
1013 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v5, v2
1014 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1015 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[0:1], s6, s6, v4
1016 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1017 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v3, s6
1018 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, s4, v3, s4
1019 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
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: s_waitcnt lgkmcnt(0)
1035 ; GFX6-SLOWFMA-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1036 ; GFX6-SLOWFMA-NEXT: s_endpgm
1038 ; GFX7-LABEL: s_fdiv_v2f32:
1039 ; GFX7: ; %bb.0: ; %entry
1040 ; GFX7-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0xb
1041 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
1042 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
1043 ; GFX7-NEXT: s_mov_b32 s2, -1
1044 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1045 ; GFX7-NEXT: v_mov_b32_e32 v1, s5
1046 ; GFX7-NEXT: v_div_scale_f32 v2, s[8:9], s7, s7, v1
1047 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
1048 ; GFX7-NEXT: v_mov_b32_e32 v0, s7
1049 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s5, v0, s5
1050 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1051 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1052 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
1053 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
1054 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
1055 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
1056 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
1057 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1058 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
1059 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1060 ; GFX7-NEXT: v_div_scale_f32 v3, s[8:9], s6, s6, v2
1061 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
1062 ; GFX7-NEXT: v_div_fixup_f32 v1, v0, s7, v1
1063 ; GFX7-NEXT: v_mov_b32_e32 v0, s6
1064 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s4, v0, s4
1065 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1066 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
1067 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
1068 ; GFX7-NEXT: v_mul_f32_e32 v5, v0, v4
1069 ; GFX7-NEXT: v_fma_f32 v6, -v3, v5, v0
1070 ; GFX7-NEXT: v_fma_f32 v5, v6, v4, v5
1071 ; GFX7-NEXT: v_fma_f32 v0, -v3, v5, v0
1072 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1073 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1074 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, v2
1075 ; GFX7-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1076 ; GFX7-NEXT: s_endpgm
1078 ; GFX8-LABEL: s_fdiv_v2f32:
1079 ; GFX8: ; %bb.0: ; %entry
1080 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
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[0:1], 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[0:1], 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: s_load_dwordx2 s[0:1], s[2:3], 0x24
1101 ; GFX8-NEXT: v_rcp_f32_e32 v5, v2
1102 ; GFX8-NEXT: v_div_fixup_f32 v1, v1, s7, v0
1103 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1104 ; GFX8-NEXT: v_fma_f32 v0, -v2, v5, 1.0
1105 ; GFX8-NEXT: v_fma_f32 v0, v0, v5, v5
1106 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v0
1107 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
1108 ; GFX8-NEXT: v_fma_f32 v5, v6, v0, v5
1109 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
1110 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1111 ; GFX8-NEXT: v_div_fmas_f32 v0, v2, v0, v5
1112 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1113 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1114 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1115 ; GFX8-NEXT: v_div_fixup_f32 v0, v0, s6, v4
1116 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1117 ; GFX8-NEXT: s_endpgm
1119 ; GFX10-LABEL: s_fdiv_v2f32:
1120 ; GFX10: ; %bb.0: ; %entry
1121 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1122 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1123 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s7, s7, s5
1124 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s5, s7, s5
1125 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
1126 ; GFX10-NEXT: s_denorm_mode 15
1127 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1128 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
1129 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
1130 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
1131 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
1132 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
1133 ; GFX10-NEXT: s_denorm_mode 12
1134 ; GFX10-NEXT: v_div_scale_f32 v2, s0, s6, s6, s4
1135 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1136 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1137 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
1138 ; GFX10-NEXT: v_div_fixup_f32 v1, v0, s7, s5
1139 ; GFX10-NEXT: v_div_scale_f32 v0, vcc_lo, s4, s6, s4
1140 ; GFX10-NEXT: s_denorm_mode 15
1141 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1142 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
1143 ; GFX10-NEXT: v_mul_f32_e32 v4, v0, v3
1144 ; GFX10-NEXT: v_fma_f32 v5, -v2, v4, v0
1145 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v3
1146 ; GFX10-NEXT: v_fma_f32 v0, -v2, v4, v0
1147 ; GFX10-NEXT: s_denorm_mode 12
1148 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
1149 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1150 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s6, s4
1151 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1152 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1153 ; GFX10-NEXT: s_endpgm
1155 ; GFX11-LABEL: s_fdiv_v2f32:
1156 ; GFX11: ; %bb.0: ; %entry
1157 ; GFX11-NEXT: s_clause 0x1
1158 ; GFX11-NEXT: s_load_b128 s[4:7], s[2:3], 0x2c
1159 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
1160 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1161 ; GFX11-NEXT: v_div_scale_f32 v0, null, s7, s7, s5
1162 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s5, s7, s5
1163 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
1164 ; GFX11-NEXT: s_denorm_mode 15
1165 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1166 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1167 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
1168 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
1169 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
1170 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
1171 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
1172 ; GFX11-NEXT: s_denorm_mode 12
1173 ; GFX11-NEXT: v_div_scale_f32 v2, null, s6, s6, s4
1174 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1175 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
1176 ; GFX11-NEXT: v_div_fixup_f32 v1, v0, s7, s5
1177 ; GFX11-NEXT: v_div_scale_f32 v0, vcc_lo, s4, s6, s4
1178 ; GFX11-NEXT: s_denorm_mode 15
1179 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1180 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1181 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
1182 ; GFX11-NEXT: v_mul_f32_e32 v4, v0, v3
1183 ; GFX11-NEXT: v_fma_f32 v5, -v2, v4, v0
1184 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v3
1185 ; GFX11-NEXT: v_fma_f32 v0, -v2, v4, v0
1186 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1187 ; GFX11-NEXT: s_denorm_mode 12
1188 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1189 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s6, s4
1190 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1191 ; GFX11-NEXT: s_nop 0
1192 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1193 ; GFX11-NEXT: s_endpgm
1195 ; EG-LABEL: s_fdiv_v2f32:
1196 ; EG: ; %bb.0: ; %entry
1197 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1198 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1201 ; EG-NEXT: ALU clause starting at 4:
1202 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1203 ; EG-NEXT: MUL_IEEE T0.Y, KC0[3].X, PS,
1204 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1205 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].W, PS,
1206 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1207 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1209 %fdiv = fdiv <2 x float> %a, %b
1210 store <2 x float> %fdiv, ptr addrspace(1) %out
1214 define amdgpu_kernel void @s_fdiv_ulp25_v2f32(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1215 ; GFX67-LABEL: s_fdiv_ulp25_v2f32:
1216 ; GFX67: ; %bb.0: ; %entry
1217 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0xb
1218 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
1219 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1220 ; GFX67-NEXT: s_mov_b32 s2, -1
1221 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1222 ; GFX67-NEXT: v_rcp_f32_e32 v0, s6
1223 ; GFX67-NEXT: v_rcp_f32_e32 v1, s7
1224 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v0
1225 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v1
1226 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1227 ; GFX67-NEXT: s_endpgm
1229 ; GFX8-LABEL: s_fdiv_ulp25_v2f32:
1230 ; GFX8: ; %bb.0: ; %entry
1231 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1232 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1233 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1234 ; GFX8-NEXT: v_rcp_f32_e32 v0, s6
1235 ; GFX8-NEXT: v_rcp_f32_e32 v1, s7
1236 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1237 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1238 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v0
1239 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v1
1240 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1241 ; GFX8-NEXT: s_endpgm
1243 ; GFX10-LABEL: s_fdiv_ulp25_v2f32:
1244 ; GFX10: ; %bb.0: ; %entry
1245 ; GFX10-NEXT: s_clause 0x1
1246 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1247 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1248 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
1249 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1250 ; GFX10-NEXT: v_rcp_f32_e32 v0, s6
1251 ; GFX10-NEXT: v_rcp_f32_e32 v1, s7
1252 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v0
1253 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v1
1254 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1255 ; GFX10-NEXT: s_endpgm
1257 ; GFX11-LABEL: s_fdiv_ulp25_v2f32:
1258 ; GFX11: ; %bb.0: ; %entry
1259 ; GFX11-NEXT: s_clause 0x1
1260 ; GFX11-NEXT: s_load_b128 s[4:7], s[2:3], 0x2c
1261 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
1262 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1263 ; GFX11-NEXT: v_rcp_f32_e32 v0, s6
1264 ; GFX11-NEXT: v_rcp_f32_e32 v1, s7
1265 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1266 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1267 ; GFX11-NEXT: v_dual_mul_f32 v0, s4, v0 :: v_dual_mul_f32 v1, s5, v1
1268 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1269 ; GFX11-NEXT: s_nop 0
1270 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1271 ; GFX11-NEXT: s_endpgm
1273 ; EG-LABEL: s_fdiv_ulp25_v2f32:
1274 ; EG: ; %bb.0: ; %entry
1275 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1276 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1279 ; EG-NEXT: ALU clause starting at 4:
1280 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1281 ; EG-NEXT: MUL_IEEE T0.Y, KC0[3].X, PS,
1282 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1283 ; EG-NEXT: MUL_IEEE T0.X, KC0[2].W, PS,
1284 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1285 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1287 %fdiv = fdiv arcp <2 x float> %a, %b, !fpmath !0
1288 store <2 x float> %fdiv, ptr addrspace(1) %out
1292 define amdgpu_kernel void @s_fdiv_v2f32_fast_math(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1293 ; GFX67-LABEL: s_fdiv_v2f32_fast_math:
1294 ; GFX67: ; %bb.0: ; %entry
1295 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0xb
1296 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
1297 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1298 ; GFX67-NEXT: s_mov_b32 s2, -1
1299 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1300 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1301 ; GFX67-NEXT: v_rcp_f32_e32 v2, s6
1302 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v0
1303 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v2
1304 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1305 ; GFX67-NEXT: s_endpgm
1307 ; GFX8-LABEL: s_fdiv_v2f32_fast_math:
1308 ; GFX8: ; %bb.0: ; %entry
1309 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1310 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1311 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1312 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1313 ; GFX8-NEXT: v_rcp_f32_e32 v2, s6
1314 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v0
1315 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v2
1316 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1317 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1318 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1319 ; GFX8-NEXT: s_endpgm
1321 ; GFX10-LABEL: s_fdiv_v2f32_fast_math:
1322 ; GFX10: ; %bb.0: ; %entry
1323 ; GFX10-NEXT: s_clause 0x1
1324 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1325 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1326 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
1327 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1328 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1329 ; GFX10-NEXT: v_rcp_f32_e32 v2, s6
1330 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v0
1331 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v2
1332 ; GFX10-NEXT: global_store_dwordx2 v3, v[0:1], s[0:1]
1333 ; GFX10-NEXT: s_endpgm
1335 ; GFX11-LABEL: s_fdiv_v2f32_fast_math:
1336 ; GFX11: ; %bb.0: ; %entry
1337 ; GFX11-NEXT: s_clause 0x1
1338 ; GFX11-NEXT: s_load_b128 s[4:7], s[2:3], 0x2c
1339 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
1340 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1341 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1342 ; GFX11-NEXT: v_rcp_f32_e32 v2, s6
1343 ; GFX11-NEXT: v_mov_b32_e32 v3, 0
1344 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1345 ; GFX11-NEXT: v_dual_mul_f32 v1, s5, v0 :: v_dual_mul_f32 v0, s4, v2
1346 ; GFX11-NEXT: global_store_b64 v3, v[0:1], s[0:1]
1347 ; GFX11-NEXT: s_nop 0
1348 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1349 ; GFX11-NEXT: s_endpgm
1351 ; EG-LABEL: s_fdiv_v2f32_fast_math:
1352 ; EG: ; %bb.0: ; %entry
1353 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1354 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1357 ; EG-NEXT: ALU clause starting at 4:
1358 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1359 ; EG-NEXT: MUL_IEEE T0.Y, PS, KC0[3].X,
1360 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1361 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].W,
1362 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1363 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1365 %fdiv = fdiv fast <2 x float> %a, %b
1366 store <2 x float> %fdiv, ptr addrspace(1) %out
1370 define amdgpu_kernel void @s_fdiv_v2f32_arcp_math(ptr addrspace(1) %out, <2 x float> %a, <2 x float> %b) #0 {
1371 ; GFX67-LABEL: s_fdiv_v2f32_arcp_math:
1372 ; GFX67: ; %bb.0: ; %entry
1373 ; GFX67-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0xb
1374 ; GFX67-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
1375 ; GFX67-NEXT: s_mov_b32 s3, 0xf000
1376 ; GFX67-NEXT: s_mov_b32 s2, -1
1377 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1378 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1379 ; GFX67-NEXT: v_rcp_f32_e32 v2, s6
1380 ; GFX67-NEXT: v_mul_f32_e32 v1, s5, v0
1381 ; GFX67-NEXT: v_mul_f32_e32 v0, s4, v2
1382 ; GFX67-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1383 ; GFX67-NEXT: s_endpgm
1385 ; GFX8-LABEL: s_fdiv_v2f32_arcp_math:
1386 ; GFX8: ; %bb.0: ; %entry
1387 ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1388 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1389 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1390 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1391 ; GFX8-NEXT: v_rcp_f32_e32 v2, s6
1392 ; GFX8-NEXT: v_mul_f32_e32 v1, s5, v0
1393 ; GFX8-NEXT: v_mul_f32_e32 v0, s4, v2
1394 ; GFX8-NEXT: v_mov_b32_e32 v3, s1
1395 ; GFX8-NEXT: v_mov_b32_e32 v2, s0
1396 ; GFX8-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1397 ; GFX8-NEXT: s_endpgm
1399 ; GFX10-LABEL: s_fdiv_v2f32_arcp_math:
1400 ; GFX10: ; %bb.0: ; %entry
1401 ; GFX10-NEXT: s_clause 0x1
1402 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x2c
1403 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
1404 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
1405 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1406 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1407 ; GFX10-NEXT: v_rcp_f32_e32 v2, s6
1408 ; GFX10-NEXT: v_mul_f32_e32 v1, s5, v0
1409 ; GFX10-NEXT: v_mul_f32_e32 v0, s4, v2
1410 ; GFX10-NEXT: global_store_dwordx2 v3, v[0:1], s[0:1]
1411 ; GFX10-NEXT: s_endpgm
1413 ; GFX11-LABEL: s_fdiv_v2f32_arcp_math:
1414 ; GFX11: ; %bb.0: ; %entry
1415 ; GFX11-NEXT: s_clause 0x1
1416 ; GFX11-NEXT: s_load_b128 s[4:7], s[2:3], 0x2c
1417 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
1418 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1419 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1420 ; GFX11-NEXT: v_rcp_f32_e32 v2, s6
1421 ; GFX11-NEXT: v_mov_b32_e32 v3, 0
1422 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1423 ; GFX11-NEXT: v_dual_mul_f32 v1, s5, v0 :: v_dual_mul_f32 v0, s4, v2
1424 ; GFX11-NEXT: global_store_b64 v3, v[0:1], s[0:1]
1425 ; GFX11-NEXT: s_nop 0
1426 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1427 ; GFX11-NEXT: s_endpgm
1429 ; EG-LABEL: s_fdiv_v2f32_arcp_math:
1430 ; EG: ; %bb.0: ; %entry
1431 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
1432 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1435 ; EG-NEXT: ALU clause starting at 4:
1436 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Z,
1437 ; EG-NEXT: MUL_IEEE T0.Y, PS, KC0[3].X,
1438 ; EG-NEXT: RECIP_IEEE * T0.X, KC0[3].Y,
1439 ; EG-NEXT: MUL_IEEE T0.X, PS, KC0[2].W,
1440 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1441 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1443 %fdiv = fdiv arcp ninf <2 x float> %a, %b
1444 store <2 x float> %fdiv, ptr addrspace(1) %out
1448 define amdgpu_kernel void @s_fdiv_v4f32(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
1449 ; GFX6-FASTFMA-LABEL: s_fdiv_v4f32:
1450 ; GFX6-FASTFMA: ; %bb.0:
1451 ; GFX6-FASTFMA-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x9
1452 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
1453 ; GFX6-FASTFMA-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1454 ; GFX6-FASTFMA-NEXT: s_mov_b32 s11, 0xf000
1455 ; GFX6-FASTFMA-NEXT: s_mov_b32 s10, -1
1456 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
1457 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s3
1458 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[12:13], s7, s7, v1
1459 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
1460 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s7
1461 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s3, v0, s3
1462 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1463 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1464 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
1465 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v0, v3
1466 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, v0
1467 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v3, v4
1468 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v4, v0
1469 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1470 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1471 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v3, v0, s7, v1
1472 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s2
1473 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[12:13], s6, s6, v1
1474 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v2
1475 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s6
1476 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
1477 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1478 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
1479 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
1480 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v0, v4
1481 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v0
1482 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v4, v5
1483 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v2, v5, v0
1484 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1485 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1486 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v2, v0, s6, v1
1487 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v1, s1
1488 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, s[2:3], s5, s5, v1
1489 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v5, v4
1490 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s5
1491 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s1, v0, s1
1492 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1493 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1494 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v5, v5
1495 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v0, v5
1496 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v4, v6, v0
1497 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v5, v6
1498 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v4, v6, v0
1499 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1500 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v4, s0
1501 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1502 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v4
1503 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v6, v5
1504 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v1, v0, s5, v1
1505 ; GFX6-FASTFMA-NEXT: v_mov_b32_e32 v0, s4
1506 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, vcc, s0, v0, s0
1507 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1508 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v5, v6, 1.0
1509 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v6, v6
1510 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v7, v0, v6
1511 ; GFX6-FASTFMA-NEXT: v_fma_f32 v8, -v5, v7, v0
1512 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, v8, v6, v7
1513 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v5, v7, v0
1514 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1515 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v6, v7
1516 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s4, v4
1517 ; GFX6-FASTFMA-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1518 ; GFX6-FASTFMA-NEXT: s_endpgm
1520 ; GFX6-SLOWFMA-LABEL: s_fdiv_v4f32:
1521 ; GFX6-SLOWFMA: ; %bb.0:
1522 ; GFX6-SLOWFMA-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x9
1523 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1524 ; GFX6-SLOWFMA-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1525 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
1526 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v0, s3
1527 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[10:11], s7, s7, v0
1528 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v2, s7
1529 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s3, v2, s3
1530 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v4, s2
1531 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v7, s1
1532 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v8, s0
1533 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
1534 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1535 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1536 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v5, v3, v3
1537 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v2, v3
1538 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v1, v5, v2
1539 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v3, v5
1540 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v5, v2
1541 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1542 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[10:11], s6, s6, v4
1543 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1544 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v3, s6
1545 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, vcc, s2, v3, s2
1546 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s11, 0xf000
1547 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s10, -1
1548 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v2
1549 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v3, v1, s7, v0
1550 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1551 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v2, v6, 1.0
1552 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1553 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v1, v5, v0
1554 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v1, v5
1555 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, v6, v0, v1
1556 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v1, v5
1557 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1558 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, s[2:3], s5, s5, v7
1559 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v2, v0, v1
1560 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v1, s5
1561 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, s1, v1, s1
1562 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v5
1563 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v2, v0, s6, v4
1564 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1565 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1566 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1567 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v1, v0
1568 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v5, v4, v1
1569 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v6, v0, v4
1570 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v5, v4, v1
1571 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1572 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v8
1573 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v1, v0, v4
1574 ; GFX6-SLOWFMA-NEXT: v_mov_b32_e32 v1, s4
1575 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, s0, v1, s0
1576 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v6, v5
1577 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v1, v0, s5, v7
1578 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1579 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1580 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, v0, v6, v6
1581 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v0
1582 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v5, v6, v4
1583 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v0, v6
1584 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v5, v6, v4
1585 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1586 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v4, v0, v6
1587 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, v8
1588 ; GFX6-SLOWFMA-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1589 ; GFX6-SLOWFMA-NEXT: s_endpgm
1591 ; GFX7-LABEL: s_fdiv_v4f32:
1593 ; GFX7-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x9
1594 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1595 ; GFX7-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1596 ; GFX7-NEXT: s_mov_b32 s11, 0xf000
1597 ; GFX7-NEXT: s_mov_b32 s10, -1
1598 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
1599 ; GFX7-NEXT: v_mov_b32_e32 v1, s3
1600 ; GFX7-NEXT: v_div_scale_f32 v2, s[12:13], s7, s7, v1
1601 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
1602 ; GFX7-NEXT: v_mov_b32_e32 v0, s7
1603 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s3, v0, s3
1604 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1605 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
1606 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
1607 ; GFX7-NEXT: v_mul_f32_e32 v4, v0, v3
1608 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, v0
1609 ; GFX7-NEXT: v_fma_f32 v4, v5, v3, v4
1610 ; GFX7-NEXT: v_fma_f32 v0, -v2, v4, v0
1611 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1612 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v3, v4
1613 ; GFX7-NEXT: v_div_fixup_f32 v3, v0, s7, v1
1614 ; GFX7-NEXT: v_mov_b32_e32 v1, s2
1615 ; GFX7-NEXT: v_div_scale_f32 v2, s[12:13], s6, s6, v1
1616 ; GFX7-NEXT: v_rcp_f32_e32 v4, v2
1617 ; GFX7-NEXT: v_mov_b32_e32 v0, s6
1618 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s2, v0, s2
1619 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1620 ; GFX7-NEXT: v_fma_f32 v5, -v2, v4, 1.0
1621 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
1622 ; GFX7-NEXT: v_mul_f32_e32 v5, v0, v4
1623 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v0
1624 ; GFX7-NEXT: v_fma_f32 v5, v6, v4, v5
1625 ; GFX7-NEXT: v_fma_f32 v0, -v2, v5, v0
1626 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1627 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v4, v5
1628 ; GFX7-NEXT: v_div_fixup_f32 v2, v0, s6, v1
1629 ; GFX7-NEXT: v_mov_b32_e32 v1, s1
1630 ; GFX7-NEXT: v_div_scale_f32 v4, s[2:3], s5, s5, v1
1631 ; GFX7-NEXT: v_rcp_f32_e32 v5, v4
1632 ; GFX7-NEXT: v_mov_b32_e32 v0, s5
1633 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s1, v0, s1
1634 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1635 ; GFX7-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1636 ; GFX7-NEXT: v_fma_f32 v5, v6, v5, v5
1637 ; GFX7-NEXT: v_mul_f32_e32 v6, v0, v5
1638 ; GFX7-NEXT: v_fma_f32 v7, -v4, v6, v0
1639 ; GFX7-NEXT: v_fma_f32 v6, v7, v5, v6
1640 ; GFX7-NEXT: v_fma_f32 v0, -v4, v6, v0
1641 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1642 ; GFX7-NEXT: v_mov_b32_e32 v4, s0
1643 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1644 ; GFX7-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v4
1645 ; GFX7-NEXT: v_rcp_f32_e32 v6, v5
1646 ; GFX7-NEXT: v_div_fixup_f32 v1, v0, s5, v1
1647 ; GFX7-NEXT: v_mov_b32_e32 v0, s4
1648 ; GFX7-NEXT: v_div_scale_f32 v0, vcc, s0, v0, s0
1649 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1650 ; GFX7-NEXT: v_fma_f32 v7, -v5, v6, 1.0
1651 ; GFX7-NEXT: v_fma_f32 v6, v7, v6, v6
1652 ; GFX7-NEXT: v_mul_f32_e32 v7, v0, v6
1653 ; GFX7-NEXT: v_fma_f32 v8, -v5, v7, v0
1654 ; GFX7-NEXT: v_fma_f32 v7, v8, v6, v7
1655 ; GFX7-NEXT: v_fma_f32 v0, -v5, v7, v0
1656 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1657 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v6, v7
1658 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s4, v4
1659 ; GFX7-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1660 ; GFX7-NEXT: s_endpgm
1662 ; GFX8-LABEL: s_fdiv_v4f32:
1664 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
1665 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1666 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1667 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1668 ; GFX8-NEXT: v_mov_b32_e32 v0, s3
1669 ; GFX8-NEXT: v_div_scale_f32 v1, s[10:11], s7, s7, v0
1670 ; GFX8-NEXT: v_mov_b32_e32 v2, s7
1671 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s3, v2, s3
1672 ; GFX8-NEXT: v_mov_b32_e32 v4, s2
1673 ; GFX8-NEXT: v_mov_b32_e32 v7, s1
1674 ; GFX8-NEXT: v_mov_b32_e32 v8, s0
1675 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
1676 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1677 ; GFX8-NEXT: v_fma_f32 v5, -v1, v3, 1.0
1678 ; GFX8-NEXT: v_fma_f32 v3, v5, v3, v3
1679 ; GFX8-NEXT: v_mul_f32_e32 v5, v2, v3
1680 ; GFX8-NEXT: v_fma_f32 v6, -v1, v5, v2
1681 ; GFX8-NEXT: v_fma_f32 v5, v6, v3, v5
1682 ; GFX8-NEXT: v_fma_f32 v1, -v1, v5, v2
1683 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1684 ; GFX8-NEXT: v_div_scale_f32 v2, s[10:11], s6, s6, v4
1685 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v5
1686 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1687 ; GFX8-NEXT: v_div_scale_f32 v5, vcc, s2, v3, s2
1688 ; GFX8-NEXT: v_rcp_f32_e32 v6, v2
1689 ; GFX8-NEXT: v_div_fixup_f32 v3, v1, s7, v0
1690 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1691 ; GFX8-NEXT: v_fma_f32 v0, -v2, v6, 1.0
1692 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1693 ; GFX8-NEXT: v_mul_f32_e32 v1, v5, v0
1694 ; GFX8-NEXT: v_fma_f32 v6, -v2, v1, v5
1695 ; GFX8-NEXT: v_fma_f32 v1, v6, v0, v1
1696 ; GFX8-NEXT: v_fma_f32 v2, -v2, v1, v5
1697 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1698 ; GFX8-NEXT: v_div_scale_f32 v5, s[2:3], s5, s5, v7
1699 ; GFX8-NEXT: v_div_fmas_f32 v0, v2, v0, v1
1700 ; GFX8-NEXT: v_mov_b32_e32 v1, s5
1701 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, s1, v1, s1
1702 ; GFX8-NEXT: v_rcp_f32_e32 v6, v5
1703 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s6, v4
1704 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1705 ; GFX8-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1706 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1707 ; GFX8-NEXT: v_mul_f32_e32 v4, v1, v0
1708 ; GFX8-NEXT: v_fma_f32 v6, -v5, v4, v1
1709 ; GFX8-NEXT: v_fma_f32 v4, v6, v0, v4
1710 ; GFX8-NEXT: v_fma_f32 v1, -v5, v4, v1
1711 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1712 ; GFX8-NEXT: v_div_scale_f32 v5, s[2:3], s4, s4, v8
1713 ; GFX8-NEXT: v_div_fmas_f32 v0, v1, v0, v4
1714 ; GFX8-NEXT: v_mov_b32_e32 v1, s4
1715 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, s0, v1, s0
1716 ; GFX8-NEXT: v_rcp_f32_e32 v6, v5
1717 ; GFX8-NEXT: v_div_fixup_f32 v1, v0, s5, v7
1718 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
1719 ; GFX8-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1720 ; GFX8-NEXT: v_fma_f32 v0, v0, v6, v6
1721 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v0
1722 ; GFX8-NEXT: v_fma_f32 v7, -v5, v6, v4
1723 ; GFX8-NEXT: v_fma_f32 v6, v7, v0, v6
1724 ; GFX8-NEXT: v_fma_f32 v4, -v5, v6, v4
1725 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
1726 ; GFX8-NEXT: v_div_fmas_f32 v0, v4, v0, v6
1727 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
1728 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
1729 ; GFX8-NEXT: v_div_fixup_f32 v0, v0, s4, v8
1730 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
1731 ; GFX8-NEXT: s_endpgm
1733 ; GFX10-LABEL: s_fdiv_v4f32:
1735 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
1736 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1737 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1738 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1739 ; GFX10-NEXT: v_div_scale_f32 v0, s10, s7, s7, s3
1740 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, s3, s7, s3
1741 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
1742 ; GFX10-NEXT: s_denorm_mode 15
1743 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1744 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
1745 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
1746 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
1747 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
1748 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
1749 ; GFX10-NEXT: s_denorm_mode 12
1750 ; GFX10-NEXT: v_div_scale_f32 v2, s10, s6, s6, s2
1751 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1752 ; GFX10-NEXT: v_div_scale_f32 v1, vcc_lo, s2, s6, s2
1753 ; GFX10-NEXT: v_rcp_f32_e32 v4, v2
1754 ; GFX10-NEXT: v_div_fixup_f32 v3, v0, s7, s3
1755 ; GFX10-NEXT: s_denorm_mode 15
1756 ; GFX10-NEXT: v_fma_f32 v0, -v2, v4, 1.0
1757 ; GFX10-NEXT: v_fmac_f32_e32 v4, v0, v4
1758 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v4
1759 ; GFX10-NEXT: v_fma_f32 v5, -v2, v0, v1
1760 ; GFX10-NEXT: v_fmac_f32_e32 v0, v5, v4
1761 ; GFX10-NEXT: v_fma_f32 v1, -v2, v0, v1
1762 ; GFX10-NEXT: s_denorm_mode 12
1763 ; GFX10-NEXT: v_div_scale_f32 v5, s3, s5, s5, s1
1764 ; GFX10-NEXT: v_div_fmas_f32 v0, v1, v4, v0
1765 ; GFX10-NEXT: v_div_scale_f32 v1, vcc_lo, s1, s5, s1
1766 ; GFX10-NEXT: v_rcp_f32_e32 v6, v5
1767 ; GFX10-NEXT: v_div_fixup_f32 v2, v0, s6, s2
1768 ; GFX10-NEXT: s_denorm_mode 15
1769 ; GFX10-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1770 ; GFX10-NEXT: v_fmac_f32_e32 v6, v0, v6
1771 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v6
1772 ; GFX10-NEXT: v_fma_f32 v4, -v5, v0, v1
1773 ; GFX10-NEXT: v_fmac_f32_e32 v0, v4, v6
1774 ; GFX10-NEXT: v_fma_f32 v1, -v5, v0, v1
1775 ; GFX10-NEXT: s_denorm_mode 12
1776 ; GFX10-NEXT: v_div_scale_f32 v4, s2, s4, s4, s0
1777 ; GFX10-NEXT: v_div_fmas_f32 v0, v1, v6, v0
1778 ; GFX10-NEXT: v_rcp_f32_e32 v5, v4
1779 ; GFX10-NEXT: v_div_fixup_f32 v1, v0, s5, s1
1780 ; GFX10-NEXT: v_div_scale_f32 v0, vcc_lo, s0, s4, s0
1781 ; GFX10-NEXT: s_denorm_mode 15
1782 ; GFX10-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1783 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v5
1784 ; GFX10-NEXT: v_mul_f32_e32 v6, v0, v5
1785 ; GFX10-NEXT: v_fma_f32 v7, -v4, v6, v0
1786 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v5
1787 ; GFX10-NEXT: v_fma_f32 v0, -v4, v6, v0
1788 ; GFX10-NEXT: s_denorm_mode 12
1789 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
1790 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1791 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s4, s0
1792 ; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[8:9]
1793 ; GFX10-NEXT: s_endpgm
1795 ; GFX11-LABEL: s_fdiv_v4f32:
1797 ; GFX11-NEXT: s_load_b128 s[8:11], s[2:3], 0x24
1798 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1799 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
1800 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1801 ; GFX11-NEXT: v_div_scale_f32 v0, null, s7, s7, s3
1802 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, s3, s7, s3
1803 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
1804 ; GFX11-NEXT: s_denorm_mode 15
1805 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1806 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
1807 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
1808 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
1809 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
1810 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
1811 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
1812 ; GFX11-NEXT: s_denorm_mode 12
1813 ; GFX11-NEXT: v_div_scale_f32 v2, null, s6, s6, s2
1814 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
1815 ; GFX11-NEXT: v_div_scale_f32 v1, vcc_lo, s2, s6, s2
1816 ; GFX11-NEXT: v_rcp_f32_e32 v4, v2
1817 ; GFX11-NEXT: v_div_fixup_f32 v3, v0, s7, s3
1818 ; GFX11-NEXT: s_denorm_mode 15
1819 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1820 ; GFX11-NEXT: v_fma_f32 v0, -v2, v4, 1.0
1821 ; GFX11-NEXT: v_fmac_f32_e32 v4, v0, v4
1822 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v4
1823 ; GFX11-NEXT: v_fma_f32 v5, -v2, v0, v1
1824 ; GFX11-NEXT: v_fmac_f32_e32 v0, v5, v4
1825 ; GFX11-NEXT: v_fma_f32 v1, -v2, v0, v1
1826 ; GFX11-NEXT: s_denorm_mode 12
1827 ; GFX11-NEXT: v_div_scale_f32 v5, null, s5, s5, s1
1828 ; GFX11-NEXT: v_div_fmas_f32 v0, v1, v4, v0
1829 ; GFX11-NEXT: v_div_scale_f32 v1, vcc_lo, s1, s5, s1
1830 ; GFX11-NEXT: v_rcp_f32_e32 v6, v5
1831 ; GFX11-NEXT: v_div_fixup_f32 v2, v0, s6, s2
1832 ; GFX11-NEXT: s_denorm_mode 15
1833 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1834 ; GFX11-NEXT: v_fma_f32 v0, -v5, v6, 1.0
1835 ; GFX11-NEXT: v_fmac_f32_e32 v6, v0, v6
1836 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v6
1837 ; GFX11-NEXT: v_fma_f32 v4, -v5, v0, v1
1838 ; GFX11-NEXT: v_fmac_f32_e32 v0, v4, v6
1839 ; GFX11-NEXT: v_fma_f32 v1, -v5, v0, v1
1840 ; GFX11-NEXT: s_denorm_mode 12
1841 ; GFX11-NEXT: v_div_scale_f32 v4, null, s4, s4, s0
1842 ; GFX11-NEXT: v_div_fmas_f32 v0, v1, v6, v0
1843 ; GFX11-NEXT: v_rcp_f32_e32 v5, v4
1844 ; GFX11-NEXT: v_div_fixup_f32 v1, v0, s5, s1
1845 ; GFX11-NEXT: v_div_scale_f32 v0, vcc_lo, s0, s4, s0
1846 ; GFX11-NEXT: s_denorm_mode 15
1847 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1848 ; GFX11-NEXT: v_fma_f32 v6, -v4, v5, 1.0
1849 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v5
1850 ; GFX11-NEXT: v_mul_f32_e32 v6, v0, v5
1851 ; GFX11-NEXT: v_fma_f32 v7, -v4, v6, v0
1852 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v5
1853 ; GFX11-NEXT: v_fma_f32 v0, -v4, v6, v0
1854 ; GFX11-NEXT: s_denorm_mode 12
1855 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
1856 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v5, v6
1857 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s4, s0
1858 ; GFX11-NEXT: global_store_b128 v4, v[0:3], s[8:9]
1859 ; GFX11-NEXT: s_nop 0
1860 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1861 ; GFX11-NEXT: s_endpgm
1863 ; EG-LABEL: s_fdiv_v4f32:
1865 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
1867 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
1868 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
1871 ; EG-NEXT: Fetch clause starting at 6:
1872 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
1873 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
1874 ; EG-NEXT: ALU clause starting at 10:
1875 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1876 ; EG-NEXT: ALU clause starting at 11:
1877 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
1878 ; EG-NEXT: MUL_IEEE T0.W, T0.W, PS,
1879 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
1880 ; EG-NEXT: MUL_IEEE T0.Z, T0.Z, PS,
1881 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
1882 ; EG-NEXT: MUL_IEEE T0.Y, T0.Y, PS,
1883 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
1884 ; EG-NEXT: MUL_IEEE T0.X, T0.X, PS,
1885 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1886 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1887 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
1888 %a = load <4 x float>, ptr addrspace(1) %in
1889 %b = load <4 x float>, ptr addrspace(1) %b_ptr
1890 %result = fdiv <4 x float> %a, %b
1891 store <4 x float> %result, ptr addrspace(1) %out
1895 define amdgpu_kernel void @s_fdiv_v4f32_fast_math(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
1896 ; GFX67-LABEL: s_fdiv_v4f32_fast_math:
1898 ; GFX67-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x9
1899 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1900 ; GFX67-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1901 ; GFX67-NEXT: s_mov_b32 s11, 0xf000
1902 ; GFX67-NEXT: s_mov_b32 s10, -1
1903 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
1904 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
1905 ; GFX67-NEXT: v_rcp_f32_e32 v1, s6
1906 ; GFX67-NEXT: v_rcp_f32_e32 v4, s5
1907 ; GFX67-NEXT: v_rcp_f32_e32 v5, s4
1908 ; GFX67-NEXT: v_mul_f32_e32 v3, s3, v0
1909 ; GFX67-NEXT: v_mul_f32_e32 v2, s2, v1
1910 ; GFX67-NEXT: v_mul_f32_e32 v1, s1, v4
1911 ; GFX67-NEXT: v_mul_f32_e32 v0, s0, v5
1912 ; GFX67-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
1913 ; GFX67-NEXT: s_endpgm
1915 ; GFX8-LABEL: s_fdiv_v4f32_fast_math:
1917 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
1918 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1919 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1920 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
1921 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
1922 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
1923 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
1924 ; GFX8-NEXT: v_rcp_f32_e32 v1, s6
1925 ; GFX8-NEXT: v_rcp_f32_e32 v6, s5
1926 ; GFX8-NEXT: v_rcp_f32_e32 v7, s4
1927 ; GFX8-NEXT: v_mul_f32_e32 v3, s3, v0
1928 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v1
1929 ; GFX8-NEXT: v_mul_f32_e32 v1, s1, v6
1930 ; GFX8-NEXT: v_mul_f32_e32 v0, s0, v7
1931 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
1932 ; GFX8-NEXT: s_endpgm
1934 ; GFX10-LABEL: s_fdiv_v4f32_fast_math:
1936 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
1937 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
1938 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1939 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
1940 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
1941 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
1942 ; GFX10-NEXT: v_rcp_f32_e32 v1, s6
1943 ; GFX10-NEXT: v_rcp_f32_e32 v4, s5
1944 ; GFX10-NEXT: v_rcp_f32_e32 v5, s4
1945 ; GFX10-NEXT: v_mul_f32_e32 v3, s3, v0
1946 ; GFX10-NEXT: v_mul_f32_e32 v2, s2, v1
1947 ; GFX10-NEXT: v_mul_f32_e32 v1, s1, v4
1948 ; GFX10-NEXT: v_mul_f32_e32 v0, s0, v5
1949 ; GFX10-NEXT: global_store_dwordx4 v6, v[0:3], s[8:9]
1950 ; GFX10-NEXT: s_endpgm
1952 ; GFX11-LABEL: s_fdiv_v4f32_fast_math:
1954 ; GFX11-NEXT: s_load_b128 s[8:11], s[2:3], 0x24
1955 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1956 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
1957 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1958 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
1959 ; GFX11-NEXT: v_rcp_f32_e32 v1, s6
1960 ; GFX11-NEXT: v_rcp_f32_e32 v4, s5
1961 ; GFX11-NEXT: v_rcp_f32_e32 v5, s4
1962 ; GFX11-NEXT: v_dual_mov_b32 v6, 0 :: v_dual_mul_f32 v3, s3, v0
1963 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
1964 ; GFX11-NEXT: v_dual_mul_f32 v2, s2, v1 :: v_dual_mul_f32 v1, s1, v4
1965 ; GFX11-NEXT: v_mul_f32_e32 v0, s0, v5
1966 ; GFX11-NEXT: global_store_b128 v6, v[0:3], s[8:9]
1967 ; GFX11-NEXT: s_nop 0
1968 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1969 ; GFX11-NEXT: s_endpgm
1971 ; EG-LABEL: s_fdiv_v4f32_fast_math:
1973 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
1975 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
1976 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
1979 ; EG-NEXT: Fetch clause starting at 6:
1980 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
1981 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
1982 ; EG-NEXT: ALU clause starting at 10:
1983 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1984 ; EG-NEXT: ALU clause starting at 11:
1985 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
1986 ; EG-NEXT: MUL_IEEE T0.W, PS, T0.W,
1987 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
1988 ; EG-NEXT: MUL_IEEE T0.Z, PS, T0.Z,
1989 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
1990 ; EG-NEXT: MUL_IEEE T0.Y, PS, T0.Y,
1991 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
1992 ; EG-NEXT: MUL_IEEE T0.X, PS, T0.X,
1993 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1994 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1995 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
1996 %a = load <4 x float>, ptr addrspace(1) %in
1997 %b = load <4 x float>, ptr addrspace(1) %b_ptr
1998 %result = fdiv fast <4 x float> %a, %b
1999 store <4 x float> %result, ptr addrspace(1) %out
2003 define amdgpu_kernel void @s_fdiv_v4f32_arcp_math(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
2004 ; GFX67-LABEL: s_fdiv_v4f32_arcp_math:
2006 ; GFX67-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x9
2007 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
2008 ; GFX67-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2009 ; GFX67-NEXT: s_mov_b32 s11, 0xf000
2010 ; GFX67-NEXT: s_mov_b32 s10, -1
2011 ; GFX67-NEXT: s_waitcnt lgkmcnt(0)
2012 ; GFX67-NEXT: v_rcp_f32_e32 v0, s7
2013 ; GFX67-NEXT: v_rcp_f32_e32 v1, s6
2014 ; GFX67-NEXT: v_rcp_f32_e32 v4, s5
2015 ; GFX67-NEXT: v_rcp_f32_e32 v5, s4
2016 ; GFX67-NEXT: v_mul_f32_e32 v3, s3, v0
2017 ; GFX67-NEXT: v_mul_f32_e32 v2, s2, v1
2018 ; GFX67-NEXT: v_mul_f32_e32 v1, s1, v4
2019 ; GFX67-NEXT: v_mul_f32_e32 v0, s0, v5
2020 ; GFX67-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
2021 ; GFX67-NEXT: s_endpgm
2023 ; GFX8-LABEL: s_fdiv_v4f32_arcp_math:
2025 ; GFX8-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
2026 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2027 ; GFX8-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2028 ; GFX8-NEXT: v_mov_b32_e32 v4, s8
2029 ; GFX8-NEXT: v_mov_b32_e32 v5, s9
2030 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2031 ; GFX8-NEXT: v_rcp_f32_e32 v0, s7
2032 ; GFX8-NEXT: v_rcp_f32_e32 v1, s6
2033 ; GFX8-NEXT: v_rcp_f32_e32 v6, s5
2034 ; GFX8-NEXT: v_rcp_f32_e32 v7, s4
2035 ; GFX8-NEXT: v_mul_f32_e32 v3, s3, v0
2036 ; GFX8-NEXT: v_mul_f32_e32 v2, s2, v1
2037 ; GFX8-NEXT: v_mul_f32_e32 v1, s1, v6
2038 ; GFX8-NEXT: v_mul_f32_e32 v0, s0, v7
2039 ; GFX8-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
2040 ; GFX8-NEXT: s_endpgm
2042 ; GFX10-LABEL: s_fdiv_v4f32_arcp_math:
2044 ; GFX10-NEXT: s_load_dwordx4 s[8:11], s[2:3], 0x24
2045 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
2046 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2047 ; GFX10-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
2048 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2049 ; GFX10-NEXT: v_rcp_f32_e32 v0, s7
2050 ; GFX10-NEXT: v_rcp_f32_e32 v1, s6
2051 ; GFX10-NEXT: v_rcp_f32_e32 v4, s5
2052 ; GFX10-NEXT: v_rcp_f32_e32 v5, s4
2053 ; GFX10-NEXT: v_mul_f32_e32 v3, s3, v0
2054 ; GFX10-NEXT: v_mul_f32_e32 v2, s2, v1
2055 ; GFX10-NEXT: v_mul_f32_e32 v1, s1, v4
2056 ; GFX10-NEXT: v_mul_f32_e32 v0, s0, v5
2057 ; GFX10-NEXT: global_store_dwordx4 v6, v[0:3], s[8:9]
2058 ; GFX10-NEXT: s_endpgm
2060 ; GFX11-LABEL: s_fdiv_v4f32_arcp_math:
2062 ; GFX11-NEXT: s_load_b128 s[8:11], s[2:3], 0x24
2063 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2064 ; GFX11-NEXT: s_load_b256 s[0:7], s[10:11], 0x0
2065 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2066 ; GFX11-NEXT: v_rcp_f32_e32 v0, s7
2067 ; GFX11-NEXT: v_rcp_f32_e32 v1, s6
2068 ; GFX11-NEXT: v_rcp_f32_e32 v4, s5
2069 ; GFX11-NEXT: v_rcp_f32_e32 v5, s4
2070 ; GFX11-NEXT: v_dual_mov_b32 v6, 0 :: v_dual_mul_f32 v3, s3, v0
2071 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2072 ; GFX11-NEXT: v_dual_mul_f32 v2, s2, v1 :: v_dual_mul_f32 v1, s1, v4
2073 ; GFX11-NEXT: v_mul_f32_e32 v0, s0, v5
2074 ; GFX11-NEXT: global_store_b128 v6, v[0:3], s[8:9]
2075 ; GFX11-NEXT: s_nop 0
2076 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2077 ; GFX11-NEXT: s_endpgm
2079 ; EG-LABEL: s_fdiv_v4f32_arcp_math:
2081 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
2083 ; EG-NEXT: ALU 9, @11, KC0[CB0:0-32], KC1[]
2084 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
2087 ; EG-NEXT: Fetch clause starting at 6:
2088 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
2089 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
2090 ; EG-NEXT: ALU clause starting at 10:
2091 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
2092 ; EG-NEXT: ALU clause starting at 11:
2093 ; EG-NEXT: RECIP_IEEE * T1.W, T1.W,
2094 ; EG-NEXT: MUL_IEEE T0.W, PS, T0.W,
2095 ; EG-NEXT: RECIP_IEEE * T1.Z, T1.Z,
2096 ; EG-NEXT: MUL_IEEE T0.Z, PS, T0.Z,
2097 ; EG-NEXT: RECIP_IEEE * T1.Y, T1.Y,
2098 ; EG-NEXT: MUL_IEEE T0.Y, PS, T0.Y,
2099 ; EG-NEXT: RECIP_IEEE * T1.X, T1.X,
2100 ; EG-NEXT: MUL_IEEE T0.X, PS, T0.X,
2101 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
2102 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2103 %b_ptr = getelementptr <4 x float>, ptr addrspace(1) %in, i32 1
2104 %a = load <4 x float>, ptr addrspace(1) %in
2105 %b = load <4 x float>, ptr addrspace(1) %b_ptr
2106 %result = fdiv arcp ninf <4 x float> %a, %b
2107 store <4 x float> %result, ptr addrspace(1) %out
2111 define amdgpu_kernel void @s_fdiv_f32_correctly_rounded_divide_sqrt(ptr addrspace(1) %out, float %a) #0 {
2112 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2113 ; GFX6-FASTFMA: ; %bb.0: ; %entry
2114 ; GFX6-FASTFMA-NEXT: s_load_dword s6, s[2:3], 0xb
2115 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2116 ; GFX6-FASTFMA-NEXT: s_mov_b32 s3, 0xf000
2117 ; GFX6-FASTFMA-NEXT: s_mov_b32 s2, -1
2118 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
2119 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2120 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v1, v0
2121 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2122 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2123 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2124 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, v3, v1, v1
2125 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v3, v2, v1
2126 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v0, v3, v2
2127 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v1, v3
2128 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v0, v3, v2
2129 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2130 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2131 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2132 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2133 ; GFX6-FASTFMA-NEXT: s_endpgm
2135 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2136 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
2137 ; GFX6-SLOWFMA-NEXT: s_load_dword s4, s[2:3], 0xb
2138 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2139 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v0, s[0:1], s4, s4, 1.0
2140 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2141 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2142 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s3, 0xf000
2143 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s2, -1
2144 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v2, v0
2145 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2146 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2147 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, v3, v2, v2
2148 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v3, v1, v2
2149 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v0, v3, v1
2150 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v2, v3
2151 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v0, v3, v1
2152 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2153 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2154 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2155 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2156 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2157 ; GFX6-SLOWFMA-NEXT: s_endpgm
2159 ; GFX7-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2160 ; GFX7: ; %bb.0: ; %entry
2161 ; GFX7-NEXT: s_load_dword s6, s[2:3], 0xb
2162 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2163 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2164 ; GFX7-NEXT: s_mov_b32 s2, -1
2165 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2166 ; GFX7-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2167 ; GFX7-NEXT: v_rcp_f32_e32 v1, v0
2168 ; GFX7-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2169 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2170 ; GFX7-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2171 ; GFX7-NEXT: v_fma_f32 v1, v3, v1, v1
2172 ; GFX7-NEXT: v_mul_f32_e32 v3, v2, v1
2173 ; GFX7-NEXT: v_fma_f32 v4, -v0, v3, v2
2174 ; GFX7-NEXT: v_fma_f32 v3, v4, v1, v3
2175 ; GFX7-NEXT: v_fma_f32 v0, -v0, v3, v2
2176 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2177 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2178 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2179 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
2180 ; GFX7-NEXT: s_endpgm
2182 ; GFX8-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2183 ; GFX8: ; %bb.0: ; %entry
2184 ; GFX8-NEXT: s_load_dword s4, s[2:3], 0x2c
2185 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2186 ; GFX8-NEXT: v_div_scale_f32 v0, s[0:1], s4, s4, 1.0
2187 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2188 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2189 ; GFX8-NEXT: v_rcp_f32_e32 v2, v0
2190 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2191 ; GFX8-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2192 ; GFX8-NEXT: v_fma_f32 v2, v3, v2, v2
2193 ; GFX8-NEXT: v_mul_f32_e32 v3, v1, v2
2194 ; GFX8-NEXT: v_fma_f32 v4, -v0, v3, v1
2195 ; GFX8-NEXT: v_fma_f32 v3, v4, v2, v3
2196 ; GFX8-NEXT: v_fma_f32 v0, -v0, v3, v1
2197 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2198 ; GFX8-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2199 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s4, 1.0
2200 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2201 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2202 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2203 ; GFX8-NEXT: flat_store_dword v[0:1], v2
2204 ; GFX8-NEXT: s_endpgm
2206 ; GFX10-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2207 ; GFX10: ; %bb.0: ; %entry
2208 ; GFX10-NEXT: s_load_dword s4, s[2:3], 0x2c
2209 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2210 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s4, s4, 1.0
2211 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s4, 1.0
2212 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2213 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
2214 ; GFX10-NEXT: s_denorm_mode 15
2215 ; GFX10-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2216 ; GFX10-NEXT: v_fmac_f32_e32 v1, v3, v1
2217 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
2218 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
2219 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
2220 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
2221 ; GFX10-NEXT: s_denorm_mode 12
2222 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2223 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
2224 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2225 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2226 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
2227 ; GFX10-NEXT: s_endpgm
2229 ; GFX11-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2230 ; GFX11: ; %bb.0: ; %entry
2231 ; GFX11-NEXT: s_clause 0x1
2232 ; GFX11-NEXT: s_load_b32 s4, s[2:3], 0x2c
2233 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2234 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2235 ; GFX11-NEXT: v_div_scale_f32 v0, null, s4, s4, 1.0
2236 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s4, 1.0
2237 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
2238 ; GFX11-NEXT: s_denorm_mode 15
2239 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2240 ; GFX11-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2241 ; GFX11-NEXT: v_fmac_f32_e32 v1, v3, v1
2242 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
2243 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
2244 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
2245 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
2246 ; GFX11-NEXT: s_denorm_mode 12
2247 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2248 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
2249 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2250 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
2251 ; GFX11-NEXT: s_nop 0
2252 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2253 ; GFX11-NEXT: s_endpgm
2255 ; EG-LABEL: s_fdiv_f32_correctly_rounded_divide_sqrt:
2256 ; EG: ; %bb.0: ; %entry
2257 ; EG-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
2258 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2261 ; EG-NEXT: ALU clause starting at 4:
2262 ; EG-NEXT: LSHR T0.X, KC0[2].Y, literal.x,
2263 ; EG-NEXT: RECIP_IEEE * T1.X, KC0[2].Z,
2264 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2266 %fdiv = fdiv float 1.000000e+00, %a
2267 store float %fdiv, ptr addrspace(1) %out
2271 define amdgpu_kernel void @s_fdiv_f32_denorms_correctly_rounded_divide_sqrt(ptr addrspace(1) %out, float %a) #1 {
2272 ; GFX6-FASTFMA-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2273 ; GFX6-FASTFMA: ; %bb.0: ; %entry
2274 ; GFX6-FASTFMA-NEXT: s_load_dword s6, s[2:3], 0xb
2275 ; GFX6-FASTFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2276 ; GFX6-FASTFMA-NEXT: s_mov_b32 s3, 0xf000
2277 ; GFX6-FASTFMA-NEXT: s_mov_b32 s2, -1
2278 ; GFX6-FASTFMA-NEXT: s_waitcnt lgkmcnt(0)
2279 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2280 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v1, v0
2281 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2282 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2283 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, v3, v1, v1
2284 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v3, v2, v1
2285 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v0, v3, v2
2286 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v1, v3
2287 ; GFX6-FASTFMA-NEXT: v_fma_f32 v0, -v0, v3, v2
2288 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2289 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2290 ; GFX6-FASTFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2291 ; GFX6-FASTFMA-NEXT: s_endpgm
2293 ; GFX6-SLOWFMA-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2294 ; GFX6-SLOWFMA: ; %bb.0: ; %entry
2295 ; GFX6-SLOWFMA-NEXT: s_load_dword s4, s[2:3], 0xb
2296 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2297 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v0, s[0:1], s4, s4, 1.0
2298 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2299 ; GFX6-SLOWFMA-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2300 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s3, 0xf000
2301 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s2, -1
2302 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v2, v0
2303 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2304 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, v3, v2, v2
2305 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v3, v1, v2
2306 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v0, v3, v1
2307 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v2, v3
2308 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v0, -v0, v3, v1
2309 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2310 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2311 ; GFX6-SLOWFMA-NEXT: s_waitcnt lgkmcnt(0)
2312 ; GFX6-SLOWFMA-NEXT: buffer_store_dword v0, off, s[0:3], 0
2313 ; GFX6-SLOWFMA-NEXT: s_endpgm
2315 ; GFX7-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2316 ; GFX7: ; %bb.0: ; %entry
2317 ; GFX7-NEXT: s_load_dword s6, s[2:3], 0xb
2318 ; GFX7-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x9
2319 ; GFX7-NEXT: s_mov_b32 s3, 0xf000
2320 ; GFX7-NEXT: s_mov_b32 s2, -1
2321 ; GFX7-NEXT: s_waitcnt lgkmcnt(0)
2322 ; GFX7-NEXT: v_div_scale_f32 v0, s[4:5], s6, s6, 1.0
2323 ; GFX7-NEXT: v_rcp_f32_e32 v1, v0
2324 ; GFX7-NEXT: v_div_scale_f32 v2, vcc, 1.0, s6, 1.0
2325 ; GFX7-NEXT: v_fma_f32 v3, -v0, v1, 1.0
2326 ; GFX7-NEXT: v_fma_f32 v1, v3, v1, v1
2327 ; GFX7-NEXT: v_mul_f32_e32 v3, v2, v1
2328 ; GFX7-NEXT: v_fma_f32 v4, -v0, v3, v2
2329 ; GFX7-NEXT: v_fma_f32 v3, v4, v1, v3
2330 ; GFX7-NEXT: v_fma_f32 v0, -v0, v3, v2
2331 ; GFX7-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2332 ; GFX7-NEXT: v_div_fixup_f32 v0, v0, s6, 1.0
2333 ; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
2334 ; GFX7-NEXT: s_endpgm
2336 ; GFX8-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2337 ; GFX8: ; %bb.0: ; %entry
2338 ; GFX8-NEXT: s_load_dword s4, s[2:3], 0x2c
2339 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2340 ; GFX8-NEXT: v_div_scale_f32 v0, s[0:1], s4, s4, 1.0
2341 ; GFX8-NEXT: v_div_scale_f32 v1, vcc, 1.0, s4, 1.0
2342 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2343 ; GFX8-NEXT: v_rcp_f32_e32 v2, v0
2344 ; GFX8-NEXT: v_fma_f32 v3, -v0, v2, 1.0
2345 ; GFX8-NEXT: v_fma_f32 v2, v3, v2, v2
2346 ; GFX8-NEXT: v_mul_f32_e32 v3, v1, v2
2347 ; GFX8-NEXT: v_fma_f32 v4, -v0, v3, v1
2348 ; GFX8-NEXT: v_fma_f32 v3, v4, v2, v3
2349 ; GFX8-NEXT: v_fma_f32 v0, -v0, v3, v1
2350 ; GFX8-NEXT: v_div_fmas_f32 v0, v0, v2, v3
2351 ; GFX8-NEXT: v_div_fixup_f32 v2, v0, s4, 1.0
2352 ; GFX8-NEXT: s_waitcnt lgkmcnt(0)
2353 ; GFX8-NEXT: v_mov_b32_e32 v0, s0
2354 ; GFX8-NEXT: v_mov_b32_e32 v1, s1
2355 ; GFX8-NEXT: flat_store_dword v[0:1], v2
2356 ; GFX8-NEXT: s_endpgm
2358 ; GFX10-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2359 ; GFX10: ; %bb.0: ; %entry
2360 ; GFX10-NEXT: s_load_dword s4, s[2:3], 0x2c
2361 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2362 ; GFX10-NEXT: v_div_scale_f32 v0, s0, s4, s4, 1.0
2363 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2364 ; GFX10-NEXT: v_rcp_f32_e32 v1, v0
2365 ; GFX10-NEXT: v_fma_f32 v2, -v0, v1, 1.0
2366 ; GFX10-NEXT: v_fmac_f32_e32 v1, v2, v1
2367 ; GFX10-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s4, 1.0
2368 ; GFX10-NEXT: v_mul_f32_e32 v3, v2, v1
2369 ; GFX10-NEXT: v_fma_f32 v4, -v0, v3, v2
2370 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v1
2371 ; GFX10-NEXT: v_fma_f32 v0, -v0, v3, v2
2372 ; GFX10-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2373 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
2374 ; GFX10-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2375 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2376 ; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
2377 ; GFX10-NEXT: s_endpgm
2379 ; GFX11-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2380 ; GFX11: ; %bb.0: ; %entry
2381 ; GFX11-NEXT: s_clause 0x1
2382 ; GFX11-NEXT: s_load_b32 s4, s[2:3], 0x2c
2383 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2384 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2385 ; GFX11-NEXT: v_div_scale_f32 v0, null, s4, s4, 1.0
2386 ; GFX11-NEXT: v_rcp_f32_e32 v1, v0
2387 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2388 ; GFX11-NEXT: v_fma_f32 v2, -v0, v1, 1.0
2389 ; GFX11-NEXT: v_fmac_f32_e32 v1, v2, v1
2390 ; GFX11-NEXT: v_div_scale_f32 v2, vcc_lo, 1.0, s4, 1.0
2391 ; GFX11-NEXT: v_mul_f32_e32 v3, v2, v1
2392 ; GFX11-NEXT: v_fma_f32 v4, -v0, v3, v2
2393 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v1
2394 ; GFX11-NEXT: v_fma_f32 v0, -v0, v3, v2
2395 ; GFX11-NEXT: v_div_fmas_f32 v0, v0, v1, v3
2396 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
2397 ; GFX11-NEXT: v_div_fixup_f32 v0, v0, s4, 1.0
2398 ; GFX11-NEXT: global_store_b32 v1, v0, s[0:1]
2399 ; GFX11-NEXT: s_nop 0
2400 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2401 ; GFX11-NEXT: s_endpgm
2403 ; EG-LABEL: s_fdiv_f32_denorms_correctly_rounded_divide_sqrt:
2404 ; EG: ; %bb.0: ; %entry
2405 ; EG-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
2406 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2409 ; EG-NEXT: ALU clause starting at 4:
2410 ; EG-NEXT: LSHR T0.X, KC0[2].Y, literal.x,
2411 ; EG-NEXT: RECIP_IEEE * T1.X, KC0[2].Z,
2412 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2414 %fdiv = fdiv float 1.000000e+00, %a
2415 store float %fdiv, ptr addrspace(1) %out
2419 define float @v_fdiv_f32_dynamic_denorm(float %a, float %b) #2 {
2420 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_denorm:
2421 ; GFX6-FASTFMA: ; %bb.0:
2422 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2423 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2424 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2425 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2426 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2427 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2428 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2429 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2430 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2431 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2432 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2433 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2434 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2435 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2436 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2437 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2439 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_denorm:
2440 ; GFX6-SLOWFMA: ; %bb.0:
2441 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2442 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2443 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2444 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2445 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2446 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2447 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2448 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2449 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2450 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2451 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2452 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2453 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2454 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2455 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2456 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2458 ; GFX7-LABEL: v_fdiv_f32_dynamic_denorm:
2460 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2461 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2462 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2463 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2464 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2465 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2466 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2467 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2468 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2469 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2470 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2471 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2472 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2473 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2474 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2475 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2477 ; GFX8-LABEL: v_fdiv_f32_dynamic_denorm:
2479 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2480 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2481 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2482 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2483 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2484 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2485 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2486 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2487 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2488 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2489 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2490 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2491 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2492 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2493 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2494 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2496 ; GFX10-LABEL: v_fdiv_f32_dynamic_denorm:
2498 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2499 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2500 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2501 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2502 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2503 ; GFX10-NEXT: s_denorm_mode 15
2504 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2505 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
2506 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2507 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2508 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2509 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2510 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2511 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2512 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2513 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2515 ; GFX11-LABEL: v_fdiv_f32_dynamic_denorm:
2517 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2518 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2519 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2520 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
2521 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2522 ; GFX11-NEXT: s_denorm_mode 15
2523 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2524 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2525 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
2526 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2527 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2528 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2529 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2530 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
2531 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2532 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2533 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2535 ; EG-LABEL: v_fdiv_f32_dynamic_denorm:
2539 %fdiv = fdiv float %a, %b
2543 define float @v_fdiv_f32_ieee(float %x, float %y) #1 {
2544 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee:
2545 ; GFX6-FASTFMA: ; %bb.0:
2546 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2547 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2548 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2549 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2550 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
2551 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2552 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2553 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2554 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2555 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2556 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2557 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2558 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2560 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee:
2561 ; GFX6-SLOWFMA: ; %bb.0:
2562 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2563 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2564 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2565 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2566 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2567 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2568 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2569 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2570 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2571 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2572 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2573 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2574 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2576 ; GFX7-LABEL: v_fdiv_f32_ieee:
2578 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2579 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2580 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2581 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2582 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
2583 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2584 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2585 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2586 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2587 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2588 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2589 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2590 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2592 ; GFX8-LABEL: v_fdiv_f32_ieee:
2594 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2595 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2596 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2597 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2598 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2599 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2600 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2601 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2602 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2603 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2604 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2605 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2606 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2608 ; GFX10-LABEL: v_fdiv_f32_ieee:
2610 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2611 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2612 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2613 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2614 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
2615 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2616 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2617 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2618 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2619 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2620 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2621 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2622 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2624 ; GFX11-LABEL: v_fdiv_f32_ieee:
2626 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2627 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2628 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2629 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2630 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
2631 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
2632 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2633 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2634 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2635 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2636 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2637 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2638 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2639 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2641 ; EG-LABEL: v_fdiv_f32_ieee:
2645 %div = fdiv float %x, %y
2649 define float @v_fdiv_f32_ieee_25ulp(float %x, float %y) #1 {
2650 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp:
2652 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2653 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
2654 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
2655 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
2656 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
2657 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
2658 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
2659 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
2660 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2661 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
2662 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2663 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
2664 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
2665 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
2666 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2668 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp:
2670 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2671 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
2672 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
2673 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2674 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2675 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
2676 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
2677 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
2678 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
2679 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2681 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp:
2683 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2684 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
2685 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
2686 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2687 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2688 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
2689 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
2690 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
2691 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
2692 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2694 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp:
2696 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2697 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
2698 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2699 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
2700 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2701 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
2702 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2703 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
2704 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
2705 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2707 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp:
2709 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2710 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
2711 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2712 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
2713 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2714 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
2715 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2716 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2717 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
2718 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
2719 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2721 ; EG-LABEL: v_fdiv_f32_ieee_25ulp:
2725 %div = fdiv float %x, %y, !fpmath !0
2729 define float @v_fdiv_f32_dynamic(float %x, float %y) #2 {
2730 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic:
2731 ; GFX6-FASTFMA: ; %bb.0:
2732 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2733 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2734 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2735 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2736 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2737 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2738 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2739 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2740 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2741 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2742 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2743 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2744 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2745 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2746 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2747 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2749 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic:
2750 ; GFX6-SLOWFMA: ; %bb.0:
2751 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2752 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2753 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2754 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2755 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2756 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2757 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2758 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2759 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2760 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2761 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2762 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2763 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2764 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2765 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2766 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2768 ; GFX7-LABEL: v_fdiv_f32_dynamic:
2770 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2771 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2772 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2773 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2774 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2775 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2776 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2777 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2778 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2779 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2780 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2781 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2782 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2783 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2784 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2785 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2787 ; GFX8-LABEL: v_fdiv_f32_dynamic:
2789 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2790 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2791 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2792 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2793 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2794 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2795 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2796 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2797 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2798 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2799 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
2800 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
2801 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2802 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2803 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2804 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2806 ; GFX10-LABEL: v_fdiv_f32_dynamic:
2808 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2809 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
2810 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2811 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
2812 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
2813 ; GFX10-NEXT: s_denorm_mode 15
2814 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2815 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
2816 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
2817 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
2818 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
2819 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
2820 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
2821 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2822 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2823 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2825 ; GFX11-LABEL: v_fdiv_f32_dynamic:
2827 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2828 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
2829 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
2830 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
2831 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
2832 ; GFX11-NEXT: s_denorm_mode 15
2833 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2834 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2835 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
2836 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
2837 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
2838 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
2839 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
2840 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
2841 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2842 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2843 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2845 ; EG-LABEL: v_fdiv_f32_dynamic:
2849 %div = fdiv float %x, %y
2853 define float @v_fdiv_f32_dynamic_25ulp(float %x, float %y) #2 {
2854 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp:
2856 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2857 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
2858 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
2859 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
2860 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
2861 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
2862 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
2863 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
2864 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2865 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
2866 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2867 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
2868 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
2869 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
2870 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2872 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp:
2874 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2875 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
2876 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
2877 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2878 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2879 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
2880 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
2881 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
2882 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
2883 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2885 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp:
2887 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2888 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
2889 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
2890 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2891 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
2892 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
2893 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
2894 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
2895 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
2896 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2898 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp:
2900 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2901 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
2902 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2903 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
2904 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2905 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
2906 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2907 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
2908 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
2909 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2911 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp:
2913 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2914 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
2915 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
2916 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
2917 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
2918 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
2919 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
2920 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
2921 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
2922 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
2923 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2925 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp:
2929 %div = fdiv float %x, %y, !fpmath !0
2933 define float @v_fdiv_f32_daz(float %x, float %y) #0 {
2934 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz:
2935 ; GFX6-FASTFMA: ; %bb.0:
2936 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2937 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2938 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
2939 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2940 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2941 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2942 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
2943 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
2944 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
2945 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
2946 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
2947 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2948 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2949 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2950 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
2952 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz:
2953 ; GFX6-SLOWFMA: ; %bb.0:
2954 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2955 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2956 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2957 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
2958 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2959 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2960 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
2961 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
2962 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
2963 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
2964 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
2965 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2966 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
2967 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2968 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
2970 ; GFX7-LABEL: v_fdiv_f32_daz:
2972 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2973 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2974 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
2975 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
2976 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2977 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
2978 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
2979 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
2980 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
2981 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
2982 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
2983 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
2984 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
2985 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
2986 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2988 ; GFX8-LABEL: v_fdiv_f32_daz:
2990 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2991 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
2992 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
2993 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
2994 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
2995 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
2996 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
2997 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
2998 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
2999 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
3000 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
3001 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3002 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3003 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3004 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3006 ; GFX10-LABEL: v_fdiv_f32_daz:
3008 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3009 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3010 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3011 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3012 ; GFX10-NEXT: s_denorm_mode 15
3013 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3014 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
3015 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3016 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3017 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3018 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3019 ; GFX10-NEXT: s_denorm_mode 12
3020 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3021 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3022 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3024 ; GFX11-LABEL: v_fdiv_f32_daz:
3026 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3027 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3028 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3029 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3030 ; GFX11-NEXT: s_denorm_mode 15
3031 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3032 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3033 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
3034 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3035 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3036 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3037 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3038 ; GFX11-NEXT: s_denorm_mode 12
3039 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3040 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3041 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3043 ; EG-LABEL: v_fdiv_f32_daz:
3047 %div = fdiv float %x, %y
3051 define float @v_fdiv_f32_daz_25ulp(float %x, float %y) #0 {
3052 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp:
3054 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3055 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
3056 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
3057 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
3058 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
3059 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
3060 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
3061 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
3062 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
3063 ; GFX678-NEXT: s_setpc_b64 s[30:31]
3065 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp:
3067 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3068 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
3069 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
3070 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
3071 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
3072 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
3073 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
3074 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3076 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp:
3078 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3079 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
3080 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
3081 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
3082 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
3083 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3084 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
3085 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
3086 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3088 ; EG-LABEL: v_fdiv_f32_daz_25ulp:
3092 %div = fdiv float %x, %y, !fpmath !0
3096 ; If we emit an fmul, make sure it fuses into the user.
3097 define float @v_fdiv_f32_ieee_contractable_user(float %x, float %y, float %z) #1 {
3098 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_contractable_user:
3099 ; GFX6-FASTFMA: ; %bb.0:
3100 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3101 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3102 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3103 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3104 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3105 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3106 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3107 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3108 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3109 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3110 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3111 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3112 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3113 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3115 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_contractable_user:
3116 ; GFX6-SLOWFMA: ; %bb.0:
3117 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3118 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3119 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3120 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3121 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3122 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3123 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3124 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3125 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3126 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3127 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3128 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3129 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3130 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3132 ; GFX7-LABEL: v_fdiv_f32_ieee_contractable_user:
3134 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3135 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3136 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3137 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3138 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
3139 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3140 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3141 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3142 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3143 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3144 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3145 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3146 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3147 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3149 ; GFX8-LABEL: v_fdiv_f32_ieee_contractable_user:
3151 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3152 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3153 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3154 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3155 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3156 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3157 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3158 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3159 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3160 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3161 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3162 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3163 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3164 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3166 ; GFX10-LABEL: v_fdiv_f32_ieee_contractable_user:
3168 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3169 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3170 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3171 ; GFX10-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3172 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v4
3173 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3174 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3175 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3176 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3177 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3178 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3179 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3180 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3181 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3183 ; GFX11-LABEL: v_fdiv_f32_ieee_contractable_user:
3185 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3186 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3187 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3188 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3189 ; GFX11-NEXT: v_fma_f32 v5, -v3, v4, 1.0
3190 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v4
3191 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3192 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3193 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3194 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3195 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3196 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3197 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3198 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3199 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3201 ; EG-LABEL: v_fdiv_f32_ieee_contractable_user:
3205 %div = fdiv contract float %x, %y
3206 %add = fadd contract float %div, %z
3210 define float @v_fdiv_f32_ieee_25ulp_contractable_user(float %x, float %y, float %z) #1 {
3211 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3213 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3214 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3215 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
3216 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3217 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
3218 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
3219 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
3220 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3221 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3222 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
3223 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3224 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
3225 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3226 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
3227 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
3228 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3230 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3232 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3233 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
3234 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
3235 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3236 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3237 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3238 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
3239 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
3240 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3241 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3242 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3244 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3246 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3247 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
3248 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
3249 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3250 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3251 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3252 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
3253 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
3254 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3255 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3256 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3258 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3260 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3261 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
3262 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3263 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
3264 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3265 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
3266 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3267 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
3268 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
3269 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3270 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3272 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3274 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3275 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
3276 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3277 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
3278 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3279 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
3280 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3281 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3282 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
3283 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
3284 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3285 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3287 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_contractable_user:
3291 %div = fdiv contract float %x, %y, !fpmath !0
3292 %add = fadd contract float %div, %z
3296 define float @v_fdiv_f32_dynamic_contractable_user(float %x, float %y, float %z) #2 {
3297 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_contractable_user:
3298 ; GFX6-FASTFMA: ; %bb.0:
3299 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3300 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3301 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3302 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3303 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3304 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3305 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3306 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
3307 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3308 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3309 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3310 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3311 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3312 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3313 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3314 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3315 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3317 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_contractable_user:
3318 ; GFX6-SLOWFMA: ; %bb.0:
3319 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3320 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3321 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3322 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3323 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3324 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3325 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3326 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3327 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3328 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3329 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3330 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3331 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3332 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3333 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3334 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3335 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3337 ; GFX7-LABEL: v_fdiv_f32_dynamic_contractable_user:
3339 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3340 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3341 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3342 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3343 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3344 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3345 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3346 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
3347 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3348 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3349 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3350 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3351 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3352 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3353 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3354 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3355 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3357 ; GFX8-LABEL: v_fdiv_f32_dynamic_contractable_user:
3359 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3360 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3361 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3362 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3363 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3364 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3365 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3366 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3367 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3368 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3369 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3370 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3371 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3372 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3373 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3374 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3375 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3377 ; GFX10-LABEL: v_fdiv_f32_dynamic_contractable_user:
3379 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3380 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3381 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3382 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3383 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3384 ; GFX10-NEXT: s_denorm_mode 15
3385 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3386 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
3387 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3388 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3389 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3390 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3391 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3392 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3393 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3394 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3395 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3397 ; GFX11-LABEL: v_fdiv_f32_dynamic_contractable_user:
3399 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3400 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3401 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3402 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
3403 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3404 ; GFX11-NEXT: s_denorm_mode 15
3405 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3406 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3407 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
3408 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3409 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3410 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3411 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3412 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
3413 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3414 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3415 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3416 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3418 ; EG-LABEL: v_fdiv_f32_dynamic_contractable_user:
3422 %div = fdiv contract float %x, %y
3423 %add = fadd contract float %div, %z
3427 define float @v_fdiv_f32_dynamic_25ulp_contractable_user(float %x, float %y, float %z) #2 {
3428 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3430 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3431 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3432 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
3433 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3434 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
3435 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
3436 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
3437 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3438 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3439 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
3440 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3441 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
3442 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3443 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
3444 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
3445 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3447 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3449 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3450 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
3451 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
3452 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3453 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3454 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3455 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
3456 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
3457 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3458 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3459 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3461 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3463 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3464 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
3465 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
3466 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3467 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
3468 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3469 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
3470 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
3471 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3472 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3473 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3475 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3477 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3478 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
3479 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3480 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
3481 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3482 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
3483 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3484 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
3485 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
3486 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3487 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3489 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3491 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3492 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
3493 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3494 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
3495 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3496 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
3497 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3498 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3499 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
3500 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
3501 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3502 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3504 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_contractable_user:
3508 %div = fdiv contract float %x, %y, !fpmath !0
3509 %add = fadd contract float %div, %z
3513 define float @v_fdiv_f32_daz_contractable_user(float %x, float %y, float %z) #0 {
3514 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_contractable_user:
3515 ; GFX6-FASTFMA: ; %bb.0:
3516 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3517 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3518 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
3519 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3520 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3521 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3522 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
3523 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
3524 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
3525 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
3526 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
3527 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3528 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3529 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3530 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
3531 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3533 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_contractable_user:
3534 ; GFX6-SLOWFMA: ; %bb.0:
3535 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3536 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3537 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3538 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
3539 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3540 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3541 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
3542 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
3543 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
3544 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
3545 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
3546 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3547 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3548 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3549 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
3550 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3552 ; GFX7-LABEL: v_fdiv_f32_daz_contractable_user:
3554 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3555 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3556 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
3557 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
3558 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3559 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3560 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
3561 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
3562 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
3563 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
3564 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
3565 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3566 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3567 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3568 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
3569 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3571 ; GFX8-LABEL: v_fdiv_f32_daz_contractable_user:
3573 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3574 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
3575 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3576 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
3577 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3578 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
3579 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
3580 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
3581 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
3582 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
3583 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
3584 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
3585 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
3586 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3587 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
3588 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3590 ; GFX10-LABEL: v_fdiv_f32_daz_contractable_user:
3592 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3593 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
3594 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3595 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
3596 ; GFX10-NEXT: s_denorm_mode 15
3597 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3598 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
3599 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
3600 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
3601 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
3602 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
3603 ; GFX10-NEXT: s_denorm_mode 12
3604 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3605 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3606 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
3607 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3609 ; GFX11-LABEL: v_fdiv_f32_daz_contractable_user:
3611 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3612 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
3613 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
3614 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
3615 ; GFX11-NEXT: s_denorm_mode 15
3616 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3617 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
3618 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
3619 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
3620 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
3621 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
3622 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
3623 ; GFX11-NEXT: s_denorm_mode 12
3624 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
3625 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
3626 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
3627 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3629 ; EG-LABEL: v_fdiv_f32_daz_contractable_user:
3633 %div = fdiv contract float %x, %y
3634 %add = fadd contract float %div, %z
3638 define float @v_fdiv_f32_daz_25ulp_contractable_user(float %x, float %y, float %z) #0 {
3639 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3641 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3642 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
3643 ; GFX678-NEXT: v_mov_b32_e32 v3, 0x2f800000
3644 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
3645 ; GFX678-NEXT: v_cndmask_b32_e32 v3, 1.0, v3, vcc
3646 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v3
3647 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
3648 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
3649 ; GFX678-NEXT: v_mad_f32 v0, v3, v0, v2
3650 ; GFX678-NEXT: s_setpc_b64 s[30:31]
3652 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3654 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3655 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
3656 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s4
3657 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
3658 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
3659 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
3660 ; GFX10-NEXT: v_mad_f32 v0, v3, v0, v2
3661 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3663 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3665 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3666 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
3667 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s0
3668 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v3
3669 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
3670 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3671 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
3672 ; GFX11-NEXT: v_fma_f32 v0, v3, v0, v2
3673 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3675 ; EG-LABEL: v_fdiv_f32_daz_25ulp_contractable_user:
3679 %div = fdiv contract float %x, %y, !fpmath !0
3680 %add = fadd contract float %div, %z
3684 define float @v_fdiv_f32_ieee__nnan_ninf(float %x, float %y, float %z) #1 {
3685 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3686 ; GFX6-FASTFMA: ; %bb.0:
3687 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3688 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3689 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
3690 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3691 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
3692 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3693 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
3694 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
3695 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
3696 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
3697 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3698 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3699 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3701 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3702 ; GFX6-SLOWFMA: ; %bb.0:
3703 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3704 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3705 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3706 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
3707 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3708 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3709 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
3710 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
3711 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
3712 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
3713 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3714 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3715 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3717 ; GFX7-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3719 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3720 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3721 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
3722 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3723 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
3724 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3725 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
3726 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
3727 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
3728 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
3729 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3730 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3731 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3733 ; GFX8-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3735 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3736 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3737 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3738 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
3739 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3740 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
3741 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
3742 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
3743 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
3744 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
3745 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3746 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3747 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3749 ; GFX10-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3751 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3752 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3753 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3754 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3755 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
3756 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3757 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3758 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3759 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3760 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3761 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3762 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3763 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3765 ; GFX11-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3767 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3768 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3769 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3770 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3771 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
3772 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
3773 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3774 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3775 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3776 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3777 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3778 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3779 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3780 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3782 ; EG-LABEL: v_fdiv_f32_ieee__nnan_ninf:
3786 %div = fdiv nnan ninf float %x, %y
3790 define float @v_fdiv_f32_ieee_25ulp__nnan_ninf(float %x, float %y, float %z) #1 {
3791 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3793 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3794 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3795 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
3796 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
3797 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
3798 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
3799 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
3800 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
3801 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3802 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
3803 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3804 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
3805 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
3806 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
3807 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3809 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3811 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3812 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
3813 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
3814 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3815 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
3816 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
3817 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
3818 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
3819 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
3820 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3822 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3824 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3825 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
3826 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
3827 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3828 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
3829 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
3830 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
3831 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
3832 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
3833 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3835 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3837 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3838 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
3839 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3840 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
3841 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3842 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
3843 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3844 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
3845 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
3846 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3848 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3850 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3851 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
3852 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
3853 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
3854 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
3855 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
3856 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
3857 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3858 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
3859 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
3860 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3862 ; EG-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf:
3866 %div = fdiv nnan ninf float %x, %y, !fpmath !0
3870 define float @v_fdiv_f32_dynamic__nnan_ninf(float %x, float %y, float %z) #2 {
3871 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3872 ; GFX6-FASTFMA: ; %bb.0:
3873 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3874 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3875 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
3876 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3877 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3878 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3879 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3880 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
3881 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
3882 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
3883 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
3884 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
3885 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3886 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3887 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3888 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
3890 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3891 ; GFX6-SLOWFMA: ; %bb.0:
3892 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3893 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3894 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3895 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3896 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
3897 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3898 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3899 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
3900 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
3901 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
3902 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
3903 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
3904 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3905 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3906 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3907 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
3909 ; GFX7-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3911 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3912 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3913 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
3914 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
3915 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3916 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3917 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3918 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
3919 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
3920 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
3921 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
3922 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
3923 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3924 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3925 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3926 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3928 ; GFX8-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3930 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3931 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
3932 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
3933 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3934 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
3935 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
3936 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
3937 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
3938 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
3939 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
3940 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
3941 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
3942 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3943 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
3944 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3945 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3947 ; GFX10-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3949 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3950 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
3951 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3952 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
3953 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
3954 ; GFX10-NEXT: s_denorm_mode 15
3955 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3956 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
3957 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
3958 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
3959 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
3960 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
3961 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
3962 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3963 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3964 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3966 ; GFX11-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3968 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3969 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
3970 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
3971 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
3972 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
3973 ; GFX11-NEXT: s_denorm_mode 15
3974 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
3975 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
3976 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
3977 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
3978 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
3979 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
3980 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
3981 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
3982 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
3983 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
3984 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3986 ; EG-LABEL: v_fdiv_f32_dynamic__nnan_ninf:
3990 %div = fdiv nnan ninf float %x, %y
3994 define float @v_fdiv_f32_dynamic_25ulp__nnan_ninf(float %x, float %y, float %z) #2 {
3995 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
3997 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3998 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
3999 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
4000 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4001 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
4002 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
4003 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
4004 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
4005 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4006 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
4007 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4008 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
4009 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4010 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
4011 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4013 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4015 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4016 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
4017 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
4018 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4019 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4020 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4021 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
4022 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
4023 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4024 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4026 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4028 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4029 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
4030 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
4031 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4032 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4033 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4034 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
4035 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
4036 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4037 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4039 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4041 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4042 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
4043 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4044 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
4045 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4046 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
4047 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4048 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
4049 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
4050 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4052 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4054 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4055 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
4056 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4057 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
4058 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4059 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
4060 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4061 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4062 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
4063 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
4064 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4066 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf:
4070 %div = fdiv nnan ninf float %x, %y, !fpmath !0
4074 define float @v_fdiv_f32_daz__nnan_ninf(float %x, float %y, float %z) #0 {
4075 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz__nnan_ninf:
4076 ; GFX6-FASTFMA: ; %bb.0:
4077 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4078 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4079 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
4080 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4081 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4082 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4083 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
4084 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
4085 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
4086 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
4087 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
4088 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4089 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4090 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4091 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4093 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz__nnan_ninf:
4094 ; GFX6-SLOWFMA: ; %bb.0:
4095 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4096 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4097 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
4098 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
4099 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4100 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4101 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4102 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
4103 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
4104 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
4105 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
4106 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4107 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4108 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4109 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4111 ; GFX7-LABEL: v_fdiv_f32_daz__nnan_ninf:
4113 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4114 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4115 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
4116 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4117 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4118 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4119 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
4120 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
4121 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
4122 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
4123 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
4124 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4125 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4126 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4127 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4129 ; GFX8-LABEL: v_fdiv_f32_daz__nnan_ninf:
4131 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4132 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
4133 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
4134 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
4135 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4136 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4137 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
4138 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
4139 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
4140 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
4141 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
4142 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4143 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4144 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4145 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4147 ; GFX10-LABEL: v_fdiv_f32_daz__nnan_ninf:
4149 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4150 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
4151 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
4152 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
4153 ; GFX10-NEXT: s_denorm_mode 15
4154 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4155 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
4156 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
4157 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
4158 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
4159 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
4160 ; GFX10-NEXT: s_denorm_mode 12
4161 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4162 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4163 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4165 ; GFX11-LABEL: v_fdiv_f32_daz__nnan_ninf:
4167 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4168 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
4169 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
4170 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
4171 ; GFX11-NEXT: s_denorm_mode 15
4172 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4173 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
4174 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
4175 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
4176 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
4177 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
4178 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
4179 ; GFX11-NEXT: s_denorm_mode 12
4180 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4181 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
4182 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4184 ; EG-LABEL: v_fdiv_f32_daz__nnan_ninf:
4188 %div = fdiv nnan ninf float %x, %y
4192 define float @v_fdiv_f32_daz_25ulp__nnan_ninf(float %x, float %y, float %z) #0 {
4193 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4195 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4196 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
4197 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
4198 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
4199 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
4200 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
4201 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
4202 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
4203 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
4204 ; GFX678-NEXT: s_setpc_b64 s[30:31]
4206 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4208 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4209 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
4210 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
4211 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
4212 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
4213 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
4214 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
4215 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4217 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4219 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4220 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
4221 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
4222 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
4223 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
4224 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4225 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
4226 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
4227 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4229 ; EG-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf:
4233 %div = fdiv nnan ninf float %x, %y, !fpmath !0
4237 define float @v_fdiv_f32_ieee__nnan_ninf_contractable_user(float %x, float %y, float %z) #1 {
4238 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4239 ; GFX6-FASTFMA: ; %bb.0:
4240 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4241 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4242 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4243 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4244 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4245 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4246 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4247 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4248 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4249 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4250 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4251 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4252 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4253 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4255 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4256 ; GFX6-SLOWFMA: ; %bb.0:
4257 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4258 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4259 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4260 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4261 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4262 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4263 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4264 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4265 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4266 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4267 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4268 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4269 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4270 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4272 ; GFX7-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4274 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4275 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4276 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4277 ; GFX7-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4278 ; GFX7-NEXT: v_fma_f32 v4, v5, v4, v4
4279 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4280 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4281 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4282 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4283 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4284 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4285 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4286 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4287 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4289 ; GFX8-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4291 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4292 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4293 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4294 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4295 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4296 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4297 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4298 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4299 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4300 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4301 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4302 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4303 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4304 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4306 ; GFX10-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4308 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4309 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4310 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4311 ; GFX10-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4312 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v4
4313 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4314 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4315 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4316 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4317 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4318 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4319 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4320 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4321 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4323 ; GFX11-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4325 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4326 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4327 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4328 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4329 ; GFX11-NEXT: v_fma_f32 v5, -v3, v4, 1.0
4330 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v4
4331 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4332 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4333 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4334 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4335 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4336 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4337 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4338 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4339 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4341 ; EG-LABEL: v_fdiv_f32_ieee__nnan_ninf_contractable_user:
4345 %div = fdiv nnan ninf contract float %x, %y
4346 %add = fadd contract float %div, %z
4350 define float @v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #1 {
4351 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4353 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4354 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4355 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
4356 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4357 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
4358 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
4359 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
4360 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
4361 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4362 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
4363 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4364 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
4365 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4366 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
4367 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
4368 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4370 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4372 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4373 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
4374 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
4375 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4376 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4377 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4378 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
4379 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
4380 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4381 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4382 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4384 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4386 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4387 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
4388 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
4389 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4390 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4391 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4392 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
4393 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
4394 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4395 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4396 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4398 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4400 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4401 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
4402 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4403 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
4404 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4405 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
4406 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4407 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
4408 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
4409 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4410 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4412 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4414 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4415 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
4416 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4417 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
4418 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4419 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
4420 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4421 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4422 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
4423 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
4424 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4425 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4427 ; EG-LABEL: v_fdiv_f32_ieee_25ulp__nnan_ninf_contractable_user:
4431 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4432 %add = fadd contract float %div, %z
4436 define float @v_fdiv_f32_dynamic__nnan_ninf_contractable_user(float %x, float %y, float %z) #2 {
4437 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4438 ; GFX6-FASTFMA: ; %bb.0:
4439 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4440 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4441 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4442 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4443 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4444 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4445 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4446 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
4447 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4448 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4449 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4450 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4451 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4452 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4453 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4454 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4455 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4457 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4458 ; GFX6-SLOWFMA: ; %bb.0:
4459 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4460 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4461 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4462 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4463 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4464 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4465 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4466 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4467 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4468 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4469 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4470 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4471 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4472 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4473 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4474 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4475 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4477 ; GFX7-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4479 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4480 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4481 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4482 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4483 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4484 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4485 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4486 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
4487 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4488 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4489 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4490 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4491 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4492 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4493 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4494 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4495 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4497 ; GFX8-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4499 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4500 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4501 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4502 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4503 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4504 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4505 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4506 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4507 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4508 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4509 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4510 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4511 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4512 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4513 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4514 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4515 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4517 ; GFX10-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4519 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4520 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4521 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4522 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
4523 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4524 ; GFX10-NEXT: s_denorm_mode 15
4525 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4526 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
4527 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4528 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4529 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4530 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4531 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
4532 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4533 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4534 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4535 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4537 ; GFX11-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4539 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4540 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4541 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4542 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
4543 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4544 ; GFX11-NEXT: s_denorm_mode 15
4545 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4546 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4547 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
4548 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4549 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4550 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4551 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4552 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
4553 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4554 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4555 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4556 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4558 ; EG-LABEL: v_fdiv_f32_dynamic__nnan_ninf_contractable_user:
4562 %div = fdiv nnan ninf contract float %x, %y
4563 %add = fadd contract float %div, %z
4567 define float @v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #2 {
4568 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4570 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4571 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4572 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v1
4573 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4574 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v1, v3, vcc
4575 ; GFX6-NEXT: v_rcp_f32_e32 v3, v3
4576 ; GFX6-NEXT: v_frexp_mant_f32_e32 v4, v0
4577 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
4578 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4579 ; GFX6-NEXT: v_cndmask_b32_e32 v4, v0, v4, vcc
4580 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4581 ; GFX6-NEXT: v_mul_f32_e32 v3, v4, v3
4582 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4583 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v3, v0
4584 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v2
4585 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4587 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4589 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4590 ; GFX7-NEXT: v_frexp_mant_f32_e32 v3, v1
4591 ; GFX7-NEXT: v_rcp_f32_e32 v3, v3
4592 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4593 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4594 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
4595 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v3
4596 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v4, v1
4597 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4598 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4599 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4601 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4603 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4604 ; GFX8-NEXT: v_frexp_mant_f32_e32 v3, v1
4605 ; GFX8-NEXT: v_rcp_f32_e32 v3, v3
4606 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4607 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v4, v0
4608 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
4609 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v3
4610 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v4, v1
4611 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4612 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4613 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4615 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4617 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4618 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v1
4619 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4620 ; GFX10-NEXT: v_frexp_mant_f32_e32 v4, v0
4621 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4622 ; GFX10-NEXT: v_rcp_f32_e32 v3, v3
4623 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4624 ; GFX10-NEXT: v_mul_f32_e32 v3, v4, v3
4625 ; GFX10-NEXT: v_ldexp_f32 v0, v3, v0
4626 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4627 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4629 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4631 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4632 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v1
4633 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4634 ; GFX11-NEXT: v_frexp_mant_f32_e32 v4, v0
4635 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4636 ; GFX11-NEXT: v_rcp_f32_e32 v3, v3
4637 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4638 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4639 ; GFX11-NEXT: v_mul_f32_e32 v3, v4, v3
4640 ; GFX11-NEXT: v_ldexp_f32 v0, v3, v0
4641 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4642 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4644 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp__nnan_ninf_contractable_user:
4648 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4649 %add = fadd contract float %div, %z
4653 define float @v_fdiv_f32_daz__nnan_ninf_contractable_user(float %x, float %y, float %z) #0 {
4654 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4655 ; GFX6-FASTFMA: ; %bb.0:
4656 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4657 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4658 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v4, v3
4659 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4660 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4661 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4662 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v6, v4, v4
4663 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v6, v5, v4
4664 ; GFX6-FASTFMA-NEXT: v_fma_f32 v7, -v3, v6, v5
4665 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, v7, v4, v6
4666 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v3, v6, v5
4667 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4668 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4669 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4670 ; GFX6-FASTFMA-NEXT: v_add_f32_e32 v0, v0, v2
4671 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4673 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4674 ; GFX6-SLOWFMA: ; %bb.0:
4675 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4676 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4677 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4678 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v5, v3
4679 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4680 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4681 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v5, v5
4682 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v6, v4, v5
4683 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v7, -v3, v6, v4
4684 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, v7, v5, v6
4685 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, -v3, v6, v4
4686 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4687 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4688 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4689 ; GFX6-SLOWFMA-NEXT: v_add_f32_e32 v0, v0, v2
4690 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4692 ; GFX7-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4694 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4695 ; GFX7-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4696 ; GFX7-NEXT: v_rcp_f32_e32 v4, v3
4697 ; GFX7-NEXT: v_div_scale_f32 v5, vcc, v0, v1, v0
4698 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4699 ; GFX7-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4700 ; GFX7-NEXT: v_fma_f32 v4, v6, v4, v4
4701 ; GFX7-NEXT: v_mul_f32_e32 v6, v5, v4
4702 ; GFX7-NEXT: v_fma_f32 v7, -v3, v6, v5
4703 ; GFX7-NEXT: v_fma_f32 v6, v7, v4, v6
4704 ; GFX7-NEXT: v_fma_f32 v3, -v3, v6, v5
4705 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4706 ; GFX7-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4707 ; GFX7-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4708 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v2
4709 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4711 ; GFX8-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4713 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4714 ; GFX8-NEXT: v_div_scale_f32 v3, s[4:5], v1, v1, v0
4715 ; GFX8-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
4716 ; GFX8-NEXT: v_rcp_f32_e32 v5, v3
4717 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
4718 ; GFX8-NEXT: v_fma_f32 v6, -v3, v5, 1.0
4719 ; GFX8-NEXT: v_fma_f32 v5, v6, v5, v5
4720 ; GFX8-NEXT: v_mul_f32_e32 v6, v4, v5
4721 ; GFX8-NEXT: v_fma_f32 v7, -v3, v6, v4
4722 ; GFX8-NEXT: v_fma_f32 v6, v7, v5, v6
4723 ; GFX8-NEXT: v_fma_f32 v3, -v3, v6, v4
4724 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
4725 ; GFX8-NEXT: v_div_fmas_f32 v3, v3, v5, v6
4726 ; GFX8-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4727 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
4728 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4730 ; GFX10-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4732 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4733 ; GFX10-NEXT: v_div_scale_f32 v3, s4, v1, v1, v0
4734 ; GFX10-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4735 ; GFX10-NEXT: v_rcp_f32_e32 v4, v3
4736 ; GFX10-NEXT: s_denorm_mode 15
4737 ; GFX10-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4738 ; GFX10-NEXT: v_fmac_f32_e32 v4, v6, v4
4739 ; GFX10-NEXT: v_mul_f32_e32 v6, v5, v4
4740 ; GFX10-NEXT: v_fma_f32 v7, -v3, v6, v5
4741 ; GFX10-NEXT: v_fmac_f32_e32 v6, v7, v4
4742 ; GFX10-NEXT: v_fma_f32 v3, -v3, v6, v5
4743 ; GFX10-NEXT: s_denorm_mode 12
4744 ; GFX10-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4745 ; GFX10-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4746 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
4747 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4749 ; GFX11-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4751 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4752 ; GFX11-NEXT: v_div_scale_f32 v3, null, v1, v1, v0
4753 ; GFX11-NEXT: v_div_scale_f32 v5, vcc_lo, v0, v1, v0
4754 ; GFX11-NEXT: v_rcp_f32_e32 v4, v3
4755 ; GFX11-NEXT: s_denorm_mode 15
4756 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4757 ; GFX11-NEXT: v_fma_f32 v6, -v3, v4, 1.0
4758 ; GFX11-NEXT: v_fmac_f32_e32 v4, v6, v4
4759 ; GFX11-NEXT: v_mul_f32_e32 v6, v5, v4
4760 ; GFX11-NEXT: v_fma_f32 v7, -v3, v6, v5
4761 ; GFX11-NEXT: v_fmac_f32_e32 v6, v7, v4
4762 ; GFX11-NEXT: v_fma_f32 v3, -v3, v6, v5
4763 ; GFX11-NEXT: s_denorm_mode 12
4764 ; GFX11-NEXT: v_div_fmas_f32 v3, v3, v4, v6
4765 ; GFX11-NEXT: v_div_fixup_f32 v0, v3, v1, v0
4766 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
4767 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4769 ; EG-LABEL: v_fdiv_f32_daz__nnan_ninf_contractable_user:
4773 %div = fdiv nnan ninf contract float %x, %y
4774 %add = fadd contract float %div, %z
4778 define float @v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user(float %x, float %y, float %z) #0 {
4779 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4781 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4782 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
4783 ; GFX678-NEXT: v_mov_b32_e32 v3, 0x2f800000
4784 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
4785 ; GFX678-NEXT: v_cndmask_b32_e32 v3, 1.0, v3, vcc
4786 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v3
4787 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
4788 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
4789 ; GFX678-NEXT: v_mad_f32 v0, v3, v0, v2
4790 ; GFX678-NEXT: s_setpc_b64 s[30:31]
4792 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4794 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4795 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
4796 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s4
4797 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
4798 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
4799 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
4800 ; GFX10-NEXT: v_mad_f32 v0, v3, v0, v2
4801 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4803 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4805 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4806 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
4807 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 0x2f800000, s0
4808 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v3
4809 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
4810 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4811 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
4812 ; GFX11-NEXT: v_fma_f32 v0, v3, v0, v2
4813 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4815 ; EG-LABEL: v_fdiv_f32_daz_25ulp__nnan_ninf_contractable_user:
4819 %div = fdiv nnan ninf contract float %x, %y, !fpmath !0
4820 %add = fadd contract float %div, %z
4824 define float @v_fdiv_neglhs_f32_ieee(float %x, float %y) #1 {
4825 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_ieee:
4826 ; GFX6-FASTFMA: ; %bb.0:
4827 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4828 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4829 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
4830 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4831 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
4832 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
4833 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
4834 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
4835 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
4836 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
4837 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4838 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4839 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
4841 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_ieee:
4842 ; GFX6-SLOWFMA: ; %bb.0:
4843 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4844 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4845 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
4846 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
4847 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4848 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
4849 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
4850 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
4851 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
4852 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
4853 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4854 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4855 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
4857 ; GFX7-LABEL: v_fdiv_neglhs_f32_ieee:
4859 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4860 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4861 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
4862 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4863 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
4864 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
4865 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
4866 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
4867 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
4868 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
4869 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4870 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4871 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4873 ; GFX8-LABEL: v_fdiv_neglhs_f32_ieee:
4875 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4876 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
4877 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
4878 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
4879 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
4880 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
4881 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
4882 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
4883 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
4884 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
4885 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
4886 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4887 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4889 ; GFX10-LABEL: v_fdiv_neglhs_f32_ieee:
4891 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4892 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
4893 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
4894 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4895 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
4896 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
4897 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
4898 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
4899 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
4900 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
4901 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4902 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4903 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4905 ; GFX11-LABEL: v_fdiv_neglhs_f32_ieee:
4907 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4908 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
4909 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
4910 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4911 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
4912 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
4913 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
4914 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
4915 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
4916 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
4917 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
4918 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
4919 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
4920 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4922 ; EG-LABEL: v_fdiv_neglhs_f32_ieee:
4926 %neg.x = fneg float %x
4927 %div = fdiv float %neg.x, %y
4931 define float @v_fdiv_neglhs_f32_ieee_25ulp(float %x, float %y) #1 {
4932 ; GFX6-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4934 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4935 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
4936 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
4937 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
4938 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
4939 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
4940 ; GFX6-NEXT: v_frexp_mant_f32_e64 v3, -v0
4941 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, s4
4942 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4943 ; GFX6-NEXT: v_cndmask_b32_e64 v3, -v0, v3, s[4:5]
4944 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4945 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
4946 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
4947 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
4948 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4950 ; GFX7-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4952 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4953 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
4954 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
4955 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4956 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4957 ; GFX7-NEXT: v_frexp_mant_f32_e64 v0, -v0
4958 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
4959 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
4960 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
4961 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4963 ; GFX8-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4965 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4966 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
4967 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
4968 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4969 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
4970 ; GFX8-NEXT: v_frexp_mant_f32_e64 v0, -v0
4971 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
4972 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
4973 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
4974 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4976 ; GFX10-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4978 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4979 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
4980 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4981 ; GFX10-NEXT: v_frexp_mant_f32_e64 v3, -v0
4982 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4983 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
4984 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4985 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
4986 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
4987 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4989 ; GFX11-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
4991 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4992 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
4993 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
4994 ; GFX11-NEXT: v_frexp_mant_f32_e64 v3, -v0
4995 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
4996 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
4997 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
4998 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
4999 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5000 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5001 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5003 ; EG-LABEL: v_fdiv_neglhs_f32_ieee_25ulp:
5007 %neg.x = fneg float %x
5008 %div = fdiv float %neg.x, %y, !fpmath !0
5012 define float @v_fdiv_neglhs_f32_dynamic(float %x, float %y) #2 {
5013 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_dynamic:
5014 ; GFX6-FASTFMA: ; %bb.0:
5015 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5016 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5017 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5018 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5019 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5020 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5021 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5022 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5023 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5024 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5025 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5026 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5027 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5028 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5029 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5030 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5032 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_dynamic:
5033 ; GFX6-SLOWFMA: ; %bb.0:
5034 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5035 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5036 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5037 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5038 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5039 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5040 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5041 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5042 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5043 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5044 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5045 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5046 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5047 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5048 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5049 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5051 ; GFX7-LABEL: v_fdiv_neglhs_f32_dynamic:
5053 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5054 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5055 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5056 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5057 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5058 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5059 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5060 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5061 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5062 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5063 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5064 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5065 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5066 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5067 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5068 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5070 ; GFX8-LABEL: v_fdiv_neglhs_f32_dynamic:
5072 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5073 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5074 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5075 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5076 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5077 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5078 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5079 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5080 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5081 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5082 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5083 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5084 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5085 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5086 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5087 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5089 ; GFX10-LABEL: v_fdiv_neglhs_f32_dynamic:
5091 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5092 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
5093 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5094 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5095 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5096 ; GFX10-NEXT: s_denorm_mode 15
5097 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5098 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5099 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5100 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5101 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5102 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5103 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5104 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5105 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5106 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5108 ; GFX11-LABEL: v_fdiv_neglhs_f32_dynamic:
5110 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5111 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
5112 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5113 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
5114 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5115 ; GFX11-NEXT: s_denorm_mode 15
5116 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5117 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5118 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5119 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5120 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5121 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5122 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5123 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
5124 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5125 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5126 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5128 ; EG-LABEL: v_fdiv_neglhs_f32_dynamic:
5132 %neg.x = fneg float %x
5133 %div = fdiv float %neg.x, %y
5137 define float @v_fdiv_neglhs_f32_dynamic_25ulp(float %x, float %y) #2 {
5138 ; GFX6-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5140 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5141 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
5142 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
5143 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
5144 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
5145 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5146 ; GFX6-NEXT: v_frexp_mant_f32_e64 v3, -v0
5147 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, s4
5148 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5149 ; GFX6-NEXT: v_cndmask_b32_e64 v3, -v0, v3, s[4:5]
5150 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5151 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5152 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5153 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5154 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5156 ; GFX7-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5158 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5159 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
5160 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5161 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5162 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5163 ; GFX7-NEXT: v_frexp_mant_f32_e64 v0, -v0
5164 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5165 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5166 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5167 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5169 ; GFX8-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5171 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5172 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
5173 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5174 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5175 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5176 ; GFX8-NEXT: v_frexp_mant_f32_e64 v0, -v0
5177 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5178 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5179 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5180 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5182 ; GFX10-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5184 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5185 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
5186 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5187 ; GFX10-NEXT: v_frexp_mant_f32_e64 v3, -v0
5188 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5189 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5190 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5191 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5192 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5193 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5195 ; GFX11-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5197 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5198 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
5199 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5200 ; GFX11-NEXT: v_frexp_mant_f32_e64 v3, -v0
5201 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5202 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5203 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5204 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5205 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5206 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5207 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5209 ; EG-LABEL: v_fdiv_neglhs_f32_dynamic_25ulp:
5213 %neg.x = fneg float %x
5214 %div = fdiv float %neg.x, %y, !fpmath !0
5218 define float @v_fdiv_neglhs_f32_daz(float %x, float %y) #0 {
5219 ; GFX6-FASTFMA-LABEL: v_fdiv_neglhs_f32_daz:
5220 ; GFX6-FASTFMA: ; %bb.0:
5221 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5222 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5223 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5224 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5225 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5226 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5227 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5228 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5229 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5230 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5231 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5232 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5233 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5234 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5235 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5237 ; GFX6-SLOWFMA-LABEL: v_fdiv_neglhs_f32_daz:
5238 ; GFX6-SLOWFMA: ; %bb.0:
5239 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5240 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5241 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5242 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5243 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5244 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5245 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5246 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5247 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5248 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5249 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5250 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5251 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5252 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5253 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5255 ; GFX7-LABEL: v_fdiv_neglhs_f32_daz:
5257 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5258 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5259 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5260 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, -v0, v1, -v0
5261 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5262 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5263 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5264 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5265 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5266 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5267 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5268 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5269 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5270 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5271 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5273 ; GFX8-LABEL: v_fdiv_neglhs_f32_daz:
5275 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5276 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, -v0
5277 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, -v0, v1, -v0
5278 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5279 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5280 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5281 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5282 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5283 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5284 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5285 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5286 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5287 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5288 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5289 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5291 ; GFX10-LABEL: v_fdiv_neglhs_f32_daz:
5293 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5294 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, -v0
5295 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5296 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5297 ; GFX10-NEXT: s_denorm_mode 15
5298 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5299 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5300 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5301 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5302 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5303 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5304 ; GFX10-NEXT: s_denorm_mode 12
5305 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5306 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5307 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5309 ; GFX11-LABEL: v_fdiv_neglhs_f32_daz:
5311 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5312 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, -v0
5313 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, -v0, v1, -v0
5314 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5315 ; GFX11-NEXT: s_denorm_mode 15
5316 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5317 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5318 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5319 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5320 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5321 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5322 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5323 ; GFX11-NEXT: s_denorm_mode 12
5324 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5325 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, -v0
5326 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5328 ; EG-LABEL: v_fdiv_neglhs_f32_daz:
5332 %neg.x = fneg float %x
5333 %div = fdiv float %neg.x, %y
5337 define float @v_fdiv_neglhs_f32_daz_25ulp(float %x, float %y) #0 {
5338 ; GFX678-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5340 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5341 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
5342 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
5343 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
5344 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
5345 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
5346 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
5347 ; GFX678-NEXT: v_mul_f32_e64 v0, -v0, v1
5348 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
5349 ; GFX678-NEXT: s_setpc_b64 s[30:31]
5351 ; GFX10-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5353 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5354 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
5355 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
5356 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
5357 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
5358 ; GFX10-NEXT: v_mul_f32_e64 v0, -v0, v1
5359 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
5360 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5362 ; GFX11-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5364 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5365 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
5366 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
5367 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
5368 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
5369 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5370 ; GFX11-NEXT: v_mul_f32_e64 v0, -v0, v1
5371 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
5372 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5374 ; EG-LABEL: v_fdiv_neglhs_f32_daz_25ulp:
5378 %neg.x = fneg float %x
5379 %div = fdiv float %neg.x, %y, !fpmath !0
5383 define float @v_fdiv_negrhs_f32_ieee(float %x, float %y) #1 {
5384 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_ieee:
5385 ; GFX6-FASTFMA: ; %bb.0:
5386 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5387 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5388 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5389 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5390 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
5391 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5392 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5393 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5394 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5395 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5396 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5397 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5398 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5400 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_ieee:
5401 ; GFX6-SLOWFMA: ; %bb.0:
5402 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5403 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5404 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5405 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5406 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5407 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5408 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5409 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5410 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5411 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5412 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5413 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5414 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5416 ; GFX7-LABEL: v_fdiv_negrhs_f32_ieee:
5418 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5419 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5420 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5421 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5422 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
5423 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5424 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5425 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5426 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5427 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5428 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5429 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5430 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5432 ; GFX8-LABEL: v_fdiv_negrhs_f32_ieee:
5434 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5435 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5436 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5437 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5438 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5439 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5440 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5441 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5442 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5443 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5444 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5445 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5446 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5448 ; GFX10-LABEL: v_fdiv_negrhs_f32_ieee:
5450 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5451 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5452 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5453 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5454 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
5455 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5456 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5457 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5458 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5459 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5460 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5461 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5462 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5464 ; GFX11-LABEL: v_fdiv_negrhs_f32_ieee:
5466 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5467 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5468 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5469 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5470 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
5471 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
5472 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5473 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5474 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5475 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5476 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5477 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5478 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5479 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5481 ; EG-LABEL: v_fdiv_negrhs_f32_ieee:
5485 %neg.y = fneg float %y
5486 %div = fdiv float %x, %neg.y
5490 define float @v_fdiv_negrhs_f32_ieee_25ulp(float %x, float %y) #1 {
5491 ; GFX6-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5493 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5494 ; GFX6-NEXT: s_mov_b32 s6, 0x7f800000
5495 ; GFX6-NEXT: v_frexp_mant_f32_e64 v2, -v1
5496 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v1|, s6
5497 ; GFX6-NEXT: v_cndmask_b32_e64 v2, -v1, v2, s[4:5]
5498 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5499 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
5500 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s6
5501 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5502 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
5503 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5504 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5505 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5506 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5507 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5509 ; GFX7-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5511 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5512 ; GFX7-NEXT: v_frexp_mant_f32_e64 v2, -v1
5513 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5514 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5515 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5516 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
5517 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5518 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5519 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5520 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5522 ; GFX8-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5524 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5525 ; GFX8-NEXT: v_frexp_mant_f32_e64 v2, -v1
5526 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5527 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5528 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5529 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
5530 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5531 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5532 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5533 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5535 ; GFX10-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5537 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5538 ; GFX10-NEXT: v_frexp_mant_f32_e64 v2, -v1
5539 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5540 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
5541 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5542 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5543 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5544 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5545 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5546 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5548 ; GFX11-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5550 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5551 ; GFX11-NEXT: v_frexp_mant_f32_e64 v2, -v1
5552 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5553 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
5554 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5555 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5556 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5557 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5558 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5559 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5560 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5562 ; EG-LABEL: v_fdiv_negrhs_f32_ieee_25ulp:
5566 %neg.y = fneg float %y
5567 %div = fdiv float %x, %neg.y, !fpmath !0
5571 define float @v_fdiv_negrhs_f32_dynamic(float %x, float %y) #2 {
5572 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_dynamic:
5573 ; GFX6-FASTFMA: ; %bb.0:
5574 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5575 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5576 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5577 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5578 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5579 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5580 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5581 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5582 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5583 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5584 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5585 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5586 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5587 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5588 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5589 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5591 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_dynamic:
5592 ; GFX6-SLOWFMA: ; %bb.0:
5593 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5594 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5595 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5596 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5597 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5598 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5599 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5600 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5601 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5602 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5603 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5604 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5605 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5606 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5607 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5608 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5610 ; GFX7-LABEL: v_fdiv_negrhs_f32_dynamic:
5612 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5613 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5614 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5615 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5616 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5617 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5618 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5619 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5620 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5621 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5622 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5623 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5624 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5625 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5626 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5627 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5629 ; GFX8-LABEL: v_fdiv_negrhs_f32_dynamic:
5631 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5632 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5633 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5634 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5635 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5636 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5637 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5638 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5639 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5640 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5641 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5642 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5643 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5644 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5645 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5646 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5648 ; GFX10-LABEL: v_fdiv_negrhs_f32_dynamic:
5650 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5651 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5652 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5653 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
5654 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5655 ; GFX10-NEXT: s_denorm_mode 15
5656 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5657 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5658 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5659 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5660 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5661 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5662 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
5663 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5664 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5665 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5667 ; GFX11-LABEL: v_fdiv_negrhs_f32_dynamic:
5669 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5670 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5671 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5672 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
5673 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5674 ; GFX11-NEXT: s_denorm_mode 15
5675 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5676 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5677 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5678 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5679 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5680 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5681 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5682 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
5683 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5684 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5685 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5687 ; EG-LABEL: v_fdiv_negrhs_f32_dynamic:
5691 %neg.y = fneg float %y
5692 %div = fdiv float %x, %neg.y
5696 define float @v_fdiv_negrhs_f32_dynamic_25ulp(float %x, float %y) #2 {
5697 ; GFX6-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5699 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5700 ; GFX6-NEXT: s_mov_b32 s6, 0x7f800000
5701 ; GFX6-NEXT: v_frexp_mant_f32_e64 v2, -v1
5702 ; GFX6-NEXT: v_cmp_lt_f32_e64 s[4:5], |v1|, s6
5703 ; GFX6-NEXT: v_cndmask_b32_e64 v2, -v1, v2, s[4:5]
5704 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
5705 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
5706 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s6
5707 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5708 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
5709 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5710 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
5711 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
5712 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
5713 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5715 ; GFX7-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5717 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5718 ; GFX7-NEXT: v_frexp_mant_f32_e64 v2, -v1
5719 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
5720 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5721 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5722 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
5723 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
5724 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
5725 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
5726 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5728 ; GFX8-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5730 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5731 ; GFX8-NEXT: v_frexp_mant_f32_e64 v2, -v1
5732 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
5733 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5734 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
5735 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
5736 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
5737 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
5738 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
5739 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5741 ; GFX10-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5743 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5744 ; GFX10-NEXT: v_frexp_mant_f32_e64 v2, -v1
5745 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5746 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
5747 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5748 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
5749 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5750 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
5751 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
5752 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5754 ; GFX11-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5756 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5757 ; GFX11-NEXT: v_frexp_mant_f32_e64 v2, -v1
5758 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
5759 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
5760 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
5761 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
5762 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
5763 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5764 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
5765 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
5766 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5768 ; EG-LABEL: v_fdiv_negrhs_f32_dynamic_25ulp:
5772 %neg.y = fneg float %y
5773 %div = fdiv float %x, %neg.y, !fpmath !0
5777 define float @v_fdiv_negrhs_f32_daz(float %x, float %y) #0 {
5778 ; GFX6-FASTFMA-LABEL: v_fdiv_negrhs_f32_daz:
5779 ; GFX6-FASTFMA: ; %bb.0:
5780 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5781 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5782 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
5783 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5784 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5785 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5786 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
5787 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
5788 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
5789 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
5790 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
5791 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5792 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5793 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5794 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5796 ; GFX6-SLOWFMA-LABEL: v_fdiv_negrhs_f32_daz:
5797 ; GFX6-SLOWFMA: ; %bb.0:
5798 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5799 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5800 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5801 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
5802 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5803 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5804 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
5805 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
5806 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
5807 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
5808 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
5809 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5810 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5811 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5812 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5814 ; GFX7-LABEL: v_fdiv_negrhs_f32_daz:
5816 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5817 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5818 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
5819 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, -v1, v0
5820 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5821 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5822 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
5823 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
5824 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
5825 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
5826 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
5827 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5828 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5829 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5830 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5832 ; GFX8-LABEL: v_fdiv_negrhs_f32_daz:
5834 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5835 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], -v1, -v1, v0
5836 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, -v1, v0
5837 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
5838 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
5839 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
5840 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
5841 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
5842 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
5843 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
5844 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
5845 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
5846 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
5847 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5848 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5850 ; GFX10-LABEL: v_fdiv_negrhs_f32_daz:
5852 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5853 ; GFX10-NEXT: v_div_scale_f32 v2, s4, -v1, -v1, v0
5854 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5855 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
5856 ; GFX10-NEXT: s_denorm_mode 15
5857 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5858 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
5859 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
5860 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
5861 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
5862 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
5863 ; GFX10-NEXT: s_denorm_mode 12
5864 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5865 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5866 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5868 ; GFX11-LABEL: v_fdiv_negrhs_f32_daz:
5870 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5871 ; GFX11-NEXT: v_div_scale_f32 v2, null, -v1, -v1, v0
5872 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, -v1, v0
5873 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
5874 ; GFX11-NEXT: s_denorm_mode 15
5875 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5876 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
5877 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
5878 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
5879 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
5880 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
5881 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
5882 ; GFX11-NEXT: s_denorm_mode 12
5883 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
5884 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, -v1, v0
5885 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5887 ; EG-LABEL: v_fdiv_negrhs_f32_daz:
5891 %neg.y = fneg float %y
5892 %div = fdiv float %x, %neg.y
5896 define float @v_fdiv_negrhs_f32_daz_25ulp(float %x, float %y) #0 {
5897 ; GFX678-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5899 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5900 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
5901 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
5902 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
5903 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
5904 ; GFX678-NEXT: v_mul_f32_e64 v1, -v1, v2
5905 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
5906 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
5907 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
5908 ; GFX678-NEXT: s_setpc_b64 s[30:31]
5910 ; GFX10-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5912 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5913 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
5914 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
5915 ; GFX10-NEXT: v_mul_f32_e64 v1, -v1, v2
5916 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
5917 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
5918 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
5919 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5921 ; GFX11-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5923 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5924 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
5925 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
5926 ; GFX11-NEXT: v_mul_f32_e64 v1, -v1, v2
5927 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
5928 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
5929 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
5930 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
5931 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5933 ; EG-LABEL: v_fdiv_negrhs_f32_daz_25ulp:
5937 %neg.y = fneg float %y
5938 %div = fdiv float %x, %neg.y, !fpmath !0
5942 define float @v_fdiv_f32_constrhs0_ieee(float %x) #1 {
5943 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_ieee:
5944 ; GFX6-FASTFMA: ; %bb.0:
5945 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5946 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
5947 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5948 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
5949 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v1, v2, 1.0
5950 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v3, v2, v2
5951 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
5952 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
5953 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
5954 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
5955 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
5956 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
5957 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5958 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
5960 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_ieee:
5961 ; GFX6-SLOWFMA: ; %bb.0:
5962 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5963 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
5964 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5965 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
5966 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
5967 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
5968 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
5969 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
5970 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
5971 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
5972 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
5973 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
5974 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5975 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
5977 ; GFX7-LABEL: v_fdiv_f32_constrhs0_ieee:
5979 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5980 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
5981 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5982 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
5983 ; GFX7-NEXT: v_fma_f32 v3, -v1, v2, 1.0
5984 ; GFX7-NEXT: v_fma_f32 v2, v3, v2, v2
5985 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
5986 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
5987 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
5988 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
5989 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
5990 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
5991 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
5992 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5994 ; GFX8-LABEL: v_fdiv_f32_constrhs0_ieee:
5996 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5997 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
5998 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
5999 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6000 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6001 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6002 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6003 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6004 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6005 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6006 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6007 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6008 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6009 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6011 ; GFX10-LABEL: v_fdiv_f32_constrhs0_ieee:
6013 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6014 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6015 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6016 ; GFX10-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6017 ; GFX10-NEXT: v_fmac_f32_e32 v2, v3, v2
6018 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6019 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6020 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6021 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6022 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6023 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6024 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6025 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6027 ; GFX11-LABEL: v_fdiv_f32_constrhs0_ieee:
6029 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6030 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6031 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6032 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6033 ; GFX11-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6034 ; GFX11-NEXT: v_fmac_f32_e32 v2, v3, v2
6035 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6036 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6037 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6038 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6039 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6040 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6041 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6042 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6044 ; EG-LABEL: v_fdiv_f32_constrhs0_ieee:
6048 %div = fdiv float %x, 12345.0
6052 define float @v_fdiv_f32_constrhs0_ieee_25ulp(float %x) #1 {
6053 ; GFX6-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6055 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6056 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6057 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v0
6058 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6059 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, 0x4640e400
6060 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v0, v2, vcc
6061 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6062 ; GFX6-NEXT: v_mul_f32_e32 v2, 0x3fa9e0f0, v2
6063 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
6064 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
6065 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6067 ; GFX7-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6069 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6070 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6071 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
6072 ; GFX7-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6073 ; GFX7-NEXT: v_add_i32_e32 v1, vcc, -14, v1
6074 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
6075 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6077 ; GFX8-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6079 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6080 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6081 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
6082 ; GFX8-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6083 ; GFX8-NEXT: v_add_u32_e32 v1, vcc, -14, v1
6084 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
6085 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6087 ; GFX10-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6089 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6090 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6091 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6092 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3fa9e0f0, v1
6093 ; GFX10-NEXT: v_add_nc_u32_e32 v0, -14, v0
6094 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6095 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6097 ; GFX11-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6099 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6100 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6101 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6102 ; GFX11-NEXT: v_dual_mul_f32 v1, 0x3fa9e0f0, v1 :: v_dual_add_nc_u32 v0, -14, v0
6103 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6104 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6106 ; EG-LABEL: v_fdiv_f32_constrhs0_ieee_25ulp:
6110 %div = fdiv float %x, 12345.0, !fpmath !0
6114 define float @v_fdiv_f32_constrhs0_dynamic(float %x) #2 {
6115 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_dynamic:
6116 ; GFX6-FASTFMA: ; %bb.0:
6117 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6118 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6119 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6120 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6121 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6122 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6123 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6124 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6125 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6126 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6127 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6128 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6129 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6130 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6131 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6132 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6133 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6135 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_dynamic:
6136 ; GFX6-SLOWFMA: ; %bb.0:
6137 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6138 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6139 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6140 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6141 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6142 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6143 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6144 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6145 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6146 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6147 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6148 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6149 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6150 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6151 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6152 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6153 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6155 ; GFX7-LABEL: v_fdiv_f32_constrhs0_dynamic:
6157 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6158 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6159 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6160 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6161 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6162 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6163 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6164 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6165 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6166 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6167 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6168 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6169 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6170 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6171 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6172 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6173 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6175 ; GFX8-LABEL: v_fdiv_f32_constrhs0_dynamic:
6177 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6178 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6179 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6180 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6181 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6182 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6183 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6184 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6185 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6186 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6187 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6188 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6189 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6190 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6191 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6192 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6193 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6195 ; GFX10-LABEL: v_fdiv_f32_constrhs0_dynamic:
6197 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6198 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6199 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6200 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6201 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6202 ; GFX10-NEXT: s_denorm_mode 15
6203 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6204 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6205 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6206 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6207 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6208 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6209 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6210 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6211 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6212 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6214 ; GFX11-LABEL: v_fdiv_f32_constrhs0_dynamic:
6216 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6217 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6218 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6219 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
6220 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6221 ; GFX11-NEXT: s_denorm_mode 15
6222 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6223 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6224 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6225 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6226 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6227 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6228 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6229 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
6230 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6231 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6232 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6234 ; EG-LABEL: v_fdiv_f32_constrhs0_dynamic:
6238 %div = fdiv float %x, 12345.0
6242 define float @v_fdiv_f32_constrhs0_dynamic_25ulp(float %x) #2 {
6243 ; GFX6-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6245 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6246 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6247 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v0
6248 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6249 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, 0x4640e400
6250 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v0, v2, vcc
6251 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6252 ; GFX6-NEXT: v_mul_f32_e32 v2, 0x3fa9e0f0, v2
6253 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
6254 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
6255 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6257 ; GFX7-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6259 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6260 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6261 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
6262 ; GFX7-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6263 ; GFX7-NEXT: v_add_i32_e32 v1, vcc, -14, v1
6264 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
6265 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6267 ; GFX8-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6269 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6270 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v0
6271 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
6272 ; GFX8-NEXT: v_mul_f32_e32 v0, 0x3fa9e0f0, v0
6273 ; GFX8-NEXT: v_add_u32_e32 v1, vcc, -14, v1
6274 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
6275 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6277 ; GFX10-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6279 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6280 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6281 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6282 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3fa9e0f0, v1
6283 ; GFX10-NEXT: v_add_nc_u32_e32 v0, -14, v0
6284 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6285 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6287 ; GFX11-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6289 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6290 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6291 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6292 ; GFX11-NEXT: v_dual_mul_f32 v1, 0x3fa9e0f0, v1 :: v_dual_add_nc_u32 v0, -14, v0
6293 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6294 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6296 ; EG-LABEL: v_fdiv_f32_constrhs0_dynamic_25ulp:
6300 %div = fdiv float %x, 12345.0, !fpmath !0
6304 define float @v_fdiv_f32_constrhs0_daz(float %x) #0 {
6305 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constrhs0_daz:
6306 ; GFX6-FASTFMA: ; %bb.0:
6307 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6308 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6309 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6310 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6311 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6312 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6313 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6314 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6315 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6316 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6317 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6318 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6319 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6320 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6321 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6322 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6324 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constrhs0_daz:
6325 ; GFX6-SLOWFMA: ; %bb.0:
6326 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6327 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6328 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6329 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6330 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6331 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6332 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6333 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6334 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6335 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6336 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6337 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6338 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6339 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6340 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6341 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6343 ; GFX7-LABEL: v_fdiv_f32_constrhs0_daz:
6345 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6346 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6347 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6348 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6349 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, v0, s6, v0
6350 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6351 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6352 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6353 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6354 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6355 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6356 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6357 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6358 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6359 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6360 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6362 ; GFX8-LABEL: v_fdiv_f32_constrhs0_daz:
6364 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6365 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6366 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], s6, s6, v0
6367 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, v0, s6, v0
6368 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6369 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6370 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6371 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6372 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6373 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6374 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6375 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6376 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6377 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6378 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, s6, v0
6379 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6381 ; GFX10-LABEL: v_fdiv_f32_constrhs0_daz:
6383 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6384 ; GFX10-NEXT: v_div_scale_f32 v1, s4, 0x4640e400, 0x4640e400, v0
6385 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6386 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6387 ; GFX10-NEXT: s_denorm_mode 15
6388 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6389 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6390 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6391 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6392 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6393 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6394 ; GFX10-NEXT: s_denorm_mode 12
6395 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6396 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6397 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6399 ; GFX11-LABEL: v_fdiv_f32_constrhs0_daz:
6401 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6402 ; GFX11-NEXT: v_div_scale_f32 v1, null, 0x4640e400, 0x4640e400, v0
6403 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, v0, 0x4640e400, v0
6404 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6405 ; GFX11-NEXT: s_denorm_mode 15
6406 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6407 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6408 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6409 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6410 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6411 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6412 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6413 ; GFX11-NEXT: s_denorm_mode 12
6414 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6415 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, 0x4640e400, v0
6416 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6418 ; EG-LABEL: v_fdiv_f32_constrhs0_daz:
6422 %div = fdiv float %x, 12345.0
6426 define float @v_fdiv_f32_constrhs0_daz_25ulp(float %x) #0 {
6427 ; GCN-LABEL: v_fdiv_f32_constrhs0_daz_25ulp:
6429 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6430 ; GCN-NEXT: v_mul_f32_e32 v0, 0x38a9e0f0, v0
6431 ; GCN-NEXT: s_setpc_b64 s[30:31]
6433 ; EG-LABEL: v_fdiv_f32_constrhs0_daz_25ulp:
6437 %div = fdiv float %x, 12345.0, !fpmath !0
6441 define float @v_fdiv_f32_constlhs0_ieee(float %x) #1 {
6442 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_ieee:
6443 ; GFX6-FASTFMA: ; %bb.0:
6444 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6445 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6446 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6447 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6448 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6449 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v3, v2, v2
6450 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6451 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6452 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6453 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6454 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6455 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6456 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6457 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6459 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_ieee:
6460 ; GFX6-SLOWFMA: ; %bb.0:
6461 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6462 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6463 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6464 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6465 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6466 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6467 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6468 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6469 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6470 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6471 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6472 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6473 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6474 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6476 ; GFX7-LABEL: v_fdiv_f32_constlhs0_ieee:
6478 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6479 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6480 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6481 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6482 ; GFX7-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6483 ; GFX7-NEXT: v_fma_f32 v2, v3, v2, v2
6484 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6485 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6486 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6487 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6488 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6489 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6490 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6491 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6493 ; GFX8-LABEL: v_fdiv_f32_constlhs0_ieee:
6495 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6496 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6497 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6498 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6499 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6500 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6501 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6502 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6503 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6504 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6505 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6506 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6507 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6508 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6510 ; GFX10-LABEL: v_fdiv_f32_constlhs0_ieee:
6512 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6513 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6514 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6515 ; GFX10-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6516 ; GFX10-NEXT: v_fmac_f32_e32 v2, v3, v2
6517 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6518 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6519 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6520 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6521 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6522 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6523 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6524 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6526 ; GFX11-LABEL: v_fdiv_f32_constlhs0_ieee:
6528 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6529 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6530 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6531 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6532 ; GFX11-NEXT: v_fma_f32 v3, -v1, v2, 1.0
6533 ; GFX11-NEXT: v_fmac_f32_e32 v2, v3, v2
6534 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6535 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6536 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6537 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6538 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6539 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6540 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6541 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6543 ; EG-LABEL: v_fdiv_f32_constlhs0_ieee:
6547 %div = fdiv float 12345.0, %x
6551 define float @v_fdiv_f32_constlhs0_ieee_25ulp(float %x) #1 {
6552 ; GFX6-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6554 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6555 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6556 ; GFX6-NEXT: v_frexp_mant_f32_e32 v1, v0
6557 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6558 ; GFX6-NEXT: v_cndmask_b32_e32 v1, v0, v1, vcc
6559 ; GFX6-NEXT: v_rcp_f32_e32 v1, v1
6560 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6561 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v2, 0x4640e400
6562 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v2, v0
6563 ; GFX6-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6564 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v1, v0
6565 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6567 ; GFX7-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6569 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6570 ; GFX7-NEXT: v_frexp_mant_f32_e32 v1, v0
6571 ; GFX7-NEXT: v_rcp_f32_e32 v1, v1
6572 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6573 ; GFX7-NEXT: v_sub_i32_e32 v0, vcc, 14, v0
6574 ; GFX7-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6575 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v1, v0
6576 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6578 ; GFX8-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6580 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6581 ; GFX8-NEXT: v_frexp_mant_f32_e32 v1, v0
6582 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
6583 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6584 ; GFX8-NEXT: v_sub_u32_e32 v0, vcc, 14, v0
6585 ; GFX8-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6586 ; GFX8-NEXT: v_ldexp_f32 v0, v1, v0
6587 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6589 ; GFX10-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6591 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6592 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6593 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6594 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
6595 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6596 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6597 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6598 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6600 ; GFX11-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6602 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6603 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6604 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6605 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
6606 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6607 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6608 ; GFX11-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6609 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6610 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6612 ; EG-LABEL: v_fdiv_f32_constlhs0_ieee_25ulp:
6616 %div = fdiv float 12345.0, %x, !fpmath !0
6620 define float @v_fdiv_f32_constlhs0_dynamic(float %x) #2 {
6621 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_dynamic:
6622 ; GFX6-FASTFMA: ; %bb.0:
6623 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6624 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6625 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6626 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6627 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6628 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6629 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6630 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6631 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6632 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6633 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6634 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6635 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6636 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6637 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6638 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6639 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6641 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_dynamic:
6642 ; GFX6-SLOWFMA: ; %bb.0:
6643 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6644 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6645 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6646 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6647 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6648 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6649 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6650 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6651 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6652 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6653 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6654 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6655 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6656 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6657 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6658 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6659 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6661 ; GFX7-LABEL: v_fdiv_f32_constlhs0_dynamic:
6663 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6664 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6665 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6666 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6667 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6668 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6669 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6670 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6671 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6672 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6673 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6674 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6675 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6676 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6677 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6678 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6679 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6681 ; GFX8-LABEL: v_fdiv_f32_constlhs0_dynamic:
6683 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6684 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6685 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6686 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6687 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6688 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6689 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6690 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6691 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6692 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6693 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6694 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6695 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6696 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6697 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6698 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6699 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6701 ; GFX10-LABEL: v_fdiv_f32_constlhs0_dynamic:
6703 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6704 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6705 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6706 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
6707 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6708 ; GFX10-NEXT: s_denorm_mode 15
6709 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6710 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6711 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6712 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6713 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6714 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6715 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
6716 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6717 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6718 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6720 ; GFX11-LABEL: v_fdiv_f32_constlhs0_dynamic:
6722 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6723 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6724 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6725 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
6726 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6727 ; GFX11-NEXT: s_denorm_mode 15
6728 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6729 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6730 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6731 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6732 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6733 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6734 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6735 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
6736 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6737 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6738 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6740 ; EG-LABEL: v_fdiv_f32_constlhs0_dynamic:
6744 %div = fdiv float 12345.0, %x
6748 define float @v_fdiv_f32_constlhs0_dynamic_25ulp(float %x) #2 {
6749 ; GFX6-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6751 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6752 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
6753 ; GFX6-NEXT: v_frexp_mant_f32_e32 v1, v0
6754 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
6755 ; GFX6-NEXT: v_cndmask_b32_e32 v1, v0, v1, vcc
6756 ; GFX6-NEXT: v_rcp_f32_e32 v1, v1
6757 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6758 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v2, 0x4640e400
6759 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v2, v0
6760 ; GFX6-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6761 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v1, v0
6762 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6764 ; GFX7-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6766 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6767 ; GFX7-NEXT: v_frexp_mant_f32_e32 v1, v0
6768 ; GFX7-NEXT: v_rcp_f32_e32 v1, v1
6769 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6770 ; GFX7-NEXT: v_sub_i32_e32 v0, vcc, 14, v0
6771 ; GFX7-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6772 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v1, v0
6773 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6775 ; GFX8-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6777 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6778 ; GFX8-NEXT: v_frexp_mant_f32_e32 v1, v0
6779 ; GFX8-NEXT: v_rcp_f32_e32 v1, v1
6780 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6781 ; GFX8-NEXT: v_sub_u32_e32 v0, vcc, 14, v0
6782 ; GFX8-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6783 ; GFX8-NEXT: v_ldexp_f32 v0, v1, v0
6784 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6786 ; GFX10-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6788 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6789 ; GFX10-NEXT: v_frexp_mant_f32_e32 v1, v0
6790 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6791 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
6792 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6793 ; GFX10-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6794 ; GFX10-NEXT: v_ldexp_f32 v0, v1, v0
6795 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6797 ; GFX11-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6799 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6800 ; GFX11-NEXT: v_frexp_mant_f32_e32 v1, v0
6801 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
6802 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
6803 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, 14, v0
6804 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6805 ; GFX11-NEXT: v_mul_f32_e32 v1, 0x3f40e400, v1
6806 ; GFX11-NEXT: v_ldexp_f32 v0, v1, v0
6807 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6809 ; EG-LABEL: v_fdiv_f32_constlhs0_dynamic_25ulp:
6813 %div = fdiv float 12345.0, %x, !fpmath !0
6817 define float @v_fdiv_f32_constlhs0_daz(float %x) #0 {
6818 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_constlhs0_daz:
6819 ; GFX6-FASTFMA: ; %bb.0:
6820 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6821 ; GFX6-FASTFMA-NEXT: s_mov_b32 s6, 0x4640e400
6822 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6823 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v2, v1
6824 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6825 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6826 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6827 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, v4, v2, v2
6828 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v4, v3, v2
6829 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v1, v4, v3
6830 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, v5, v2, v4
6831 ; GFX6-FASTFMA-NEXT: v_fma_f32 v1, -v1, v4, v3
6832 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6833 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6834 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6835 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
6837 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_constlhs0_daz:
6838 ; GFX6-SLOWFMA: ; %bb.0:
6839 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6840 ; GFX6-SLOWFMA-NEXT: s_mov_b32 s6, 0x4640e400
6841 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6842 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6843 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v3, v1
6844 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6845 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6846 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6847 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v4, v2, v3
6848 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v1, v4, v2
6849 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v3, v4
6850 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v1, -v1, v4, v2
6851 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6852 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6853 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6854 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
6856 ; GFX7-LABEL: v_fdiv_f32_constlhs0_daz:
6858 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6859 ; GFX7-NEXT: s_mov_b32 s6, 0x4640e400
6860 ; GFX7-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6861 ; GFX7-NEXT: v_rcp_f32_e32 v2, v1
6862 ; GFX7-NEXT: v_div_scale_f32 v3, vcc, s6, v0, s6
6863 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6864 ; GFX7-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6865 ; GFX7-NEXT: v_fma_f32 v2, v4, v2, v2
6866 ; GFX7-NEXT: v_mul_f32_e32 v4, v3, v2
6867 ; GFX7-NEXT: v_fma_f32 v5, -v1, v4, v3
6868 ; GFX7-NEXT: v_fma_f32 v4, v5, v2, v4
6869 ; GFX7-NEXT: v_fma_f32 v1, -v1, v4, v3
6870 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6871 ; GFX7-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6872 ; GFX7-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6873 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6875 ; GFX8-LABEL: v_fdiv_f32_constlhs0_daz:
6877 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6878 ; GFX8-NEXT: s_mov_b32 s6, 0x4640e400
6879 ; GFX8-NEXT: v_div_scale_f32 v1, s[4:5], v0, v0, s6
6880 ; GFX8-NEXT: v_div_scale_f32 v2, vcc, s6, v0, s6
6881 ; GFX8-NEXT: v_rcp_f32_e32 v3, v1
6882 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
6883 ; GFX8-NEXT: v_fma_f32 v4, -v1, v3, 1.0
6884 ; GFX8-NEXT: v_fma_f32 v3, v4, v3, v3
6885 ; GFX8-NEXT: v_mul_f32_e32 v4, v2, v3
6886 ; GFX8-NEXT: v_fma_f32 v5, -v1, v4, v2
6887 ; GFX8-NEXT: v_fma_f32 v4, v5, v3, v4
6888 ; GFX8-NEXT: v_fma_f32 v1, -v1, v4, v2
6889 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
6890 ; GFX8-NEXT: v_div_fmas_f32 v1, v1, v3, v4
6891 ; GFX8-NEXT: v_div_fixup_f32 v0, v1, v0, s6
6892 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6894 ; GFX10-LABEL: v_fdiv_f32_constlhs0_daz:
6896 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6897 ; GFX10-NEXT: v_div_scale_f32 v1, s4, v0, v0, 0x4640e400
6898 ; GFX10-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6899 ; GFX10-NEXT: v_rcp_f32_e32 v2, v1
6900 ; GFX10-NEXT: s_denorm_mode 15
6901 ; GFX10-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6902 ; GFX10-NEXT: v_fmac_f32_e32 v2, v4, v2
6903 ; GFX10-NEXT: v_mul_f32_e32 v4, v3, v2
6904 ; GFX10-NEXT: v_fma_f32 v5, -v1, v4, v3
6905 ; GFX10-NEXT: v_fmac_f32_e32 v4, v5, v2
6906 ; GFX10-NEXT: v_fma_f32 v1, -v1, v4, v3
6907 ; GFX10-NEXT: s_denorm_mode 12
6908 ; GFX10-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6909 ; GFX10-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6910 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6912 ; GFX11-LABEL: v_fdiv_f32_constlhs0_daz:
6914 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6915 ; GFX11-NEXT: v_div_scale_f32 v1, null, v0, v0, 0x4640e400
6916 ; GFX11-NEXT: v_div_scale_f32 v3, vcc_lo, 0x4640e400, v0, 0x4640e400
6917 ; GFX11-NEXT: v_rcp_f32_e32 v2, v1
6918 ; GFX11-NEXT: s_denorm_mode 15
6919 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6920 ; GFX11-NEXT: v_fma_f32 v4, -v1, v2, 1.0
6921 ; GFX11-NEXT: v_fmac_f32_e32 v2, v4, v2
6922 ; GFX11-NEXT: v_mul_f32_e32 v4, v3, v2
6923 ; GFX11-NEXT: v_fma_f32 v5, -v1, v4, v3
6924 ; GFX11-NEXT: v_fmac_f32_e32 v4, v5, v2
6925 ; GFX11-NEXT: v_fma_f32 v1, -v1, v4, v3
6926 ; GFX11-NEXT: s_denorm_mode 12
6927 ; GFX11-NEXT: v_div_fmas_f32 v1, v1, v2, v4
6928 ; GFX11-NEXT: v_div_fixup_f32 v0, v1, v0, 0x4640e400
6929 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6931 ; EG-LABEL: v_fdiv_f32_constlhs0_daz:
6935 %div = fdiv float 12345.0, %x
6939 define float @v_fdiv_f32_constlhs0_daz_25ulp(float %x) #0 {
6940 ; GFX678-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6942 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6943 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
6944 ; GFX678-NEXT: v_mov_b32_e32 v1, 0x2f800000
6945 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v0|, s4
6946 ; GFX678-NEXT: v_cndmask_b32_e32 v1, 1.0, v1, vcc
6947 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
6948 ; GFX678-NEXT: v_rcp_f32_e32 v0, v0
6949 ; GFX678-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6950 ; GFX678-NEXT: v_mul_f32_e32 v0, v1, v0
6951 ; GFX678-NEXT: s_setpc_b64 s[30:31]
6953 ; GFX10-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6955 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6956 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v0|
6957 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 1.0, 0x2f800000, s4
6958 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
6959 ; GFX10-NEXT: v_rcp_f32_e32 v0, v0
6960 ; GFX10-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6961 ; GFX10-NEXT: v_mul_f32_e32 v0, v1, v0
6962 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6964 ; GFX11-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6966 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6967 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v0|
6968 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 1.0, 0x2f800000, s0
6969 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
6970 ; GFX11-NEXT: v_rcp_f32_e32 v0, v0
6971 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
6972 ; GFX11-NEXT: v_mul_f32_e32 v0, 0x4640e400, v0
6973 ; GFX11-NEXT: v_mul_f32_e32 v0, v1, v0
6974 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6976 ; EG-LABEL: v_fdiv_f32_constlhs0_daz_25ulp:
6980 %div = fdiv float 12345.0, %x, !fpmath !0
6984 define float @v_fdiv_f32_ieee_nodenorm_x(float nofpclass(sub) %x, float %y) #1 {
6985 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_nodenorm_x:
6986 ; GFX6-FASTFMA: ; %bb.0:
6987 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6988 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
6989 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
6990 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
6991 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
6992 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
6993 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
6994 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
6995 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
6996 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
6997 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
6998 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
6999 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7001 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7002 ; GFX6-SLOWFMA: ; %bb.0:
7003 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7004 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7005 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7006 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7007 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7008 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7009 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7010 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7011 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7012 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7013 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7014 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7015 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7017 ; GFX7-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7019 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7020 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7021 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7022 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7023 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
7024 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7025 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7026 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7027 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7028 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7029 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7030 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7031 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7033 ; GFX8-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7035 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7036 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7037 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7038 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7039 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7040 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7041 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7042 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7043 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7044 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7045 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7046 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7047 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7049 ; GFX10-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7051 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7052 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7053 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7054 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7055 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
7056 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7057 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7058 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7059 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7060 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7061 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7062 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7063 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7065 ; GFX11-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7067 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7068 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7069 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7070 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7071 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7072 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
7073 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7074 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7075 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7076 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7077 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7078 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7079 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7080 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7082 ; EG-LABEL: v_fdiv_f32_ieee_nodenorm_x:
7086 %div = fdiv float %x, %y
7090 define float @v_fdiv_f32_ieee_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #1 {
7091 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7093 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7094 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7095 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7096 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7097 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7098 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7099 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7100 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7101 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7102 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7103 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7104 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7105 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7106 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7107 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7109 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7111 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7112 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7113 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7114 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7115 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7116 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7117 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7118 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7119 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7120 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7122 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7124 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7125 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7126 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7127 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7128 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7129 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7130 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7131 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7132 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7133 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7135 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7137 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7138 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7139 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7140 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7141 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7142 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7143 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7144 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7145 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7146 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7148 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7150 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7151 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7152 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7153 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7154 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7155 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7156 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7157 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7158 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7159 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7160 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7162 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_x:
7166 %div = fdiv float %x, %y, !fpmath !0
7170 define float @v_fdiv_f32_dynamic_nodenorm_x(float nofpclass(sub) %x, float %y) #2 {
7171 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7172 ; GFX6-FASTFMA: ; %bb.0:
7173 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7174 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7175 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7176 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7177 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7178 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7179 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7180 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7181 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7182 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7183 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7184 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7185 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7186 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7187 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7188 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7190 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7191 ; GFX6-SLOWFMA: ; %bb.0:
7192 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7193 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7194 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7195 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7196 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7197 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7198 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7199 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7200 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7201 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7202 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7203 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7204 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7205 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7206 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7207 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7209 ; GFX7-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7211 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7212 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7213 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7214 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7215 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7216 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7217 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7218 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7219 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7220 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7221 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7222 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7223 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7224 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7225 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7226 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7228 ; GFX8-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7230 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7231 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7232 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7233 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7234 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7235 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7236 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7237 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7238 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7239 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7240 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7241 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7242 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7243 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7244 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7245 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7247 ; GFX10-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7249 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7250 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7251 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7252 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7253 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7254 ; GFX10-NEXT: s_denorm_mode 15
7255 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7256 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7257 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7258 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7259 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7260 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7261 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7262 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7263 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7264 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7266 ; GFX11-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7268 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7269 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7270 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7271 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
7272 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7273 ; GFX11-NEXT: s_denorm_mode 15
7274 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7275 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7276 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7277 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7278 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7279 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7280 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7281 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
7282 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7283 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7284 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7286 ; EG-LABEL: v_fdiv_f32_dynamic_nodenorm_x:
7290 %div = fdiv float %x, %y
7294 define float @v_fdiv_f32_dynamic_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #2 {
7295 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7297 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7298 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7299 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7300 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7301 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7302 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7303 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7304 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7305 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7306 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7307 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7308 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7309 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7310 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7311 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7313 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7315 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7316 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7317 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7318 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7319 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7320 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7321 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7322 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7323 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7324 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7326 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7328 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7329 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7330 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7331 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7332 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7333 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7334 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7335 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7336 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7337 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7339 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7341 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7342 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7343 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7344 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7345 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7346 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7347 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7348 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7349 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7350 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7352 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7354 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7355 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7356 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7357 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7358 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7359 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7360 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7361 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7362 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7363 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7364 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7366 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_x:
7370 %div = fdiv float %x, %y, !fpmath !0
7374 define float @v_fdiv_f32_daz_nodenorm_x(float nofpclass(sub) %x, float %y) #0 {
7375 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_nodenorm_x:
7376 ; GFX6-FASTFMA: ; %bb.0:
7377 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7378 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7379 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7380 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7381 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7382 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7383 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7384 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7385 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7386 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7387 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7388 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7389 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7390 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7391 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7393 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_nodenorm_x:
7394 ; GFX6-SLOWFMA: ; %bb.0:
7395 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7396 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7397 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7398 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7399 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7400 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7401 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7402 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7403 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7404 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7405 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7406 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7407 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7408 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7409 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7411 ; GFX7-LABEL: v_fdiv_f32_daz_nodenorm_x:
7413 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7414 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7415 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7416 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7417 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7418 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7419 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7420 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7421 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7422 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7423 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7424 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7425 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7426 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7427 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7429 ; GFX8-LABEL: v_fdiv_f32_daz_nodenorm_x:
7431 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7432 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7433 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7434 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7435 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7436 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7437 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7438 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7439 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7440 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7441 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7442 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7443 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7444 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7445 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7447 ; GFX10-LABEL: v_fdiv_f32_daz_nodenorm_x:
7449 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7450 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7451 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7452 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7453 ; GFX10-NEXT: s_denorm_mode 15
7454 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7455 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7456 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7457 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7458 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7459 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7460 ; GFX10-NEXT: s_denorm_mode 12
7461 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7462 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7463 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7465 ; GFX11-LABEL: v_fdiv_f32_daz_nodenorm_x:
7467 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7468 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7469 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7470 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7471 ; GFX11-NEXT: s_denorm_mode 15
7472 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7473 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7474 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7475 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7476 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7477 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7478 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7479 ; GFX11-NEXT: s_denorm_mode 12
7480 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7481 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7482 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7484 ; EG-LABEL: v_fdiv_f32_daz_nodenorm_x:
7488 %div = fdiv float %x, %y
7492 define float @v_fdiv_f32_daz_25ulp_nodenorm_x(float nofpclass(sub) %x, float %y) #0 {
7493 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7495 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7496 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
7497 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
7498 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
7499 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
7500 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
7501 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
7502 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
7503 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
7504 ; GFX678-NEXT: s_setpc_b64 s[30:31]
7506 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7508 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7509 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
7510 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
7511 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
7512 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
7513 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
7514 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
7515 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7517 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7519 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7520 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
7521 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
7522 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
7523 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
7524 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7525 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
7526 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
7527 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7529 ; EG-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_x:
7533 %div = fdiv float %x, %y, !fpmath !0
7537 define float @v_fdiv_f32_ieee_nodenorm_y(float %x, float nofpclass(sub) %y) #1 {
7538 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7539 ; GFX6-FASTFMA: ; %bb.0:
7540 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7541 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7542 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7543 ; GFX6-FASTFMA-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7544 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v4, v3, v3
7545 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7546 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7547 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7548 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7549 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7550 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7551 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7552 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7554 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7555 ; GFX6-SLOWFMA: ; %bb.0:
7556 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7557 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7558 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7559 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7560 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7561 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7562 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7563 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7564 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7565 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7566 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7567 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7568 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7570 ; GFX7-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7572 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7573 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7574 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7575 ; GFX7-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7576 ; GFX7-NEXT: v_fma_f32 v3, v4, v3, v3
7577 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7578 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7579 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7580 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7581 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7582 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7583 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7584 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7586 ; GFX8-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7588 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7589 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7590 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7591 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7592 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7593 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7594 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7595 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7596 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7597 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7598 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7599 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7600 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7602 ; GFX10-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7604 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7605 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7606 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7607 ; GFX10-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7608 ; GFX10-NEXT: v_fmac_f32_e32 v3, v4, v3
7609 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7610 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7611 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7612 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7613 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7614 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7615 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7616 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7618 ; GFX11-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7620 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7621 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7622 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7623 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7624 ; GFX11-NEXT: v_fma_f32 v4, -v2, v3, 1.0
7625 ; GFX11-NEXT: v_fmac_f32_e32 v3, v4, v3
7626 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7627 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7628 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7629 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7630 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7631 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7632 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7633 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7635 ; EG-LABEL: v_fdiv_f32_ieee_nodenorm_y:
7639 %div = fdiv float %x, %y
7643 define float @v_fdiv_f32_ieee_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #1 {
7644 ; GFX6-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7646 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7647 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7648 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7649 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7650 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7651 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7652 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7653 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7654 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7655 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7656 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7657 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7658 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7659 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7660 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7662 ; GFX7-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7664 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7665 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7666 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7667 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7668 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7669 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7670 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7671 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7672 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7673 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7675 ; GFX8-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7677 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7678 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7679 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7680 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7681 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7682 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7683 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7684 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7685 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7686 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7688 ; GFX10-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7690 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7691 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7692 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7693 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7694 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7695 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7696 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7697 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7698 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7699 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7701 ; GFX11-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7703 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7704 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7705 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7706 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7707 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7708 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7709 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7710 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7711 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7712 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7713 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7715 ; EG-LABEL: v_fdiv_f32_ieee_25ulp_nodenorm_y:
7719 %div = fdiv float %x, %y, !fpmath !0
7723 define float @v_fdiv_f32_dynamic_nodenorm_y(float %x, float nofpclass(sub) %y) #2 {
7724 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7725 ; GFX6-FASTFMA: ; %bb.0:
7726 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7727 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7728 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7729 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7730 ; GFX6-FASTFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7731 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7732 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7733 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7734 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7735 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7736 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7737 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7738 ; GFX6-FASTFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7739 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7740 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7741 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7743 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7744 ; GFX6-SLOWFMA: ; %bb.0:
7745 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7746 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7747 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7748 ; GFX6-SLOWFMA-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7749 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7750 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7751 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7752 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7753 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7754 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7755 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7756 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7757 ; GFX6-SLOWFMA-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7758 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7759 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7760 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7762 ; GFX7-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7764 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7765 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7766 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7767 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7768 ; GFX7-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7769 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7770 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7771 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7772 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7773 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7774 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7775 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7776 ; GFX7-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7777 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7778 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7779 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7781 ; GFX8-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7783 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7784 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7785 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7786 ; GFX8-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7787 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7788 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7789 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7790 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7791 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7792 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7793 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7794 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7795 ; GFX8-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7796 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7797 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7798 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7800 ; GFX10-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7802 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7803 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
7804 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7805 ; GFX10-NEXT: s_getreg_b32 s4, hwreg(HW_REG_MODE, 4, 2)
7806 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
7807 ; GFX10-NEXT: s_denorm_mode 15
7808 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7809 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
7810 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
7811 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
7812 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
7813 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
7814 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s4
7815 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7816 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7817 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7819 ; GFX11-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7821 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7822 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
7823 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
7824 ; GFX11-NEXT: s_getreg_b32 s0, hwreg(HW_REG_MODE, 4, 2)
7825 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
7826 ; GFX11-NEXT: s_denorm_mode 15
7827 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7828 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7829 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
7830 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
7831 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
7832 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
7833 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
7834 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0
7835 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7836 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7837 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7839 ; EG-LABEL: v_fdiv_f32_dynamic_nodenorm_y:
7843 %div = fdiv float %x, %y
7847 define float @v_fdiv_f32_dynamic_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #2 {
7848 ; GFX6-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7850 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7851 ; GFX6-NEXT: s_mov_b32 s4, 0x7f800000
7852 ; GFX6-NEXT: v_frexp_mant_f32_e32 v2, v1
7853 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v1|, s4
7854 ; GFX6-NEXT: v_cndmask_b32_e32 v2, v1, v2, vcc
7855 ; GFX6-NEXT: v_rcp_f32_e32 v2, v2
7856 ; GFX6-NEXT: v_frexp_mant_f32_e32 v3, v0
7857 ; GFX6-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
7858 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7859 ; GFX6-NEXT: v_cndmask_b32_e32 v3, v0, v3, vcc
7860 ; GFX6-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7861 ; GFX6-NEXT: v_mul_f32_e32 v2, v3, v2
7862 ; GFX6-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
7863 ; GFX6-NEXT: v_ldexp_f32_e32 v0, v2, v0
7864 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7866 ; GFX7-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7868 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7869 ; GFX7-NEXT: v_frexp_mant_f32_e32 v2, v1
7870 ; GFX7-NEXT: v_rcp_f32_e32 v2, v2
7871 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7872 ; GFX7-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7873 ; GFX7-NEXT: v_frexp_mant_f32_e32 v0, v0
7874 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v2
7875 ; GFX7-NEXT: v_sub_i32_e32 v1, vcc, v3, v1
7876 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
7877 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7879 ; GFX8-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7881 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7882 ; GFX8-NEXT: v_frexp_mant_f32_e32 v2, v1
7883 ; GFX8-NEXT: v_rcp_f32_e32 v2, v2
7884 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7885 ; GFX8-NEXT: v_frexp_exp_i32_f32_e32 v3, v0
7886 ; GFX8-NEXT: v_frexp_mant_f32_e32 v0, v0
7887 ; GFX8-NEXT: v_mul_f32_e32 v0, v0, v2
7888 ; GFX8-NEXT: v_sub_u32_e32 v1, vcc, v3, v1
7889 ; GFX8-NEXT: v_ldexp_f32 v0, v0, v1
7890 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7892 ; GFX10-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7894 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7895 ; GFX10-NEXT: v_frexp_mant_f32_e32 v2, v1
7896 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7897 ; GFX10-NEXT: v_frexp_mant_f32_e32 v3, v0
7898 ; GFX10-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7899 ; GFX10-NEXT: v_rcp_f32_e32 v2, v2
7900 ; GFX10-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7901 ; GFX10-NEXT: v_mul_f32_e32 v2, v3, v2
7902 ; GFX10-NEXT: v_ldexp_f32 v0, v2, v0
7903 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7905 ; GFX11-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7907 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7908 ; GFX11-NEXT: v_frexp_mant_f32_e32 v2, v1
7909 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v1, v1
7910 ; GFX11-NEXT: v_frexp_mant_f32_e32 v3, v0
7911 ; GFX11-NEXT: v_frexp_exp_i32_f32_e32 v0, v0
7912 ; GFX11-NEXT: v_rcp_f32_e32 v2, v2
7913 ; GFX11-NEXT: v_sub_nc_u32_e32 v0, v0, v1
7914 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
7915 ; GFX11-NEXT: v_mul_f32_e32 v2, v3, v2
7916 ; GFX11-NEXT: v_ldexp_f32 v0, v2, v0
7917 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7919 ; EG-LABEL: v_fdiv_f32_dynamic_25ulp_nodenorm_y:
7923 %div = fdiv float %x, %y, !fpmath !0
7927 define float @v_fdiv_f32_daz_nodenorm_y(float %x, float nofpclass(sub) %y) #0 {
7928 ; GFX6-FASTFMA-LABEL: v_fdiv_f32_daz_nodenorm_y:
7929 ; GFX6-FASTFMA: ; %bb.0:
7930 ; GFX6-FASTFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7931 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7932 ; GFX6-FASTFMA-NEXT: v_rcp_f32_e32 v3, v2
7933 ; GFX6-FASTFMA-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7934 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7935 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7936 ; GFX6-FASTFMA-NEXT: v_fma_f32 v3, v5, v3, v3
7937 ; GFX6-FASTFMA-NEXT: v_mul_f32_e32 v5, v4, v3
7938 ; GFX6-FASTFMA-NEXT: v_fma_f32 v6, -v2, v5, v4
7939 ; GFX6-FASTFMA-NEXT: v_fma_f32 v5, v6, v3, v5
7940 ; GFX6-FASTFMA-NEXT: v_fma_f32 v2, -v2, v5, v4
7941 ; GFX6-FASTFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7942 ; GFX6-FASTFMA-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7943 ; GFX6-FASTFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7944 ; GFX6-FASTFMA-NEXT: s_setpc_b64 s[30:31]
7946 ; GFX6-SLOWFMA-LABEL: v_fdiv_f32_daz_nodenorm_y:
7947 ; GFX6-SLOWFMA: ; %bb.0:
7948 ; GFX6-SLOWFMA-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7949 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7950 ; GFX6-SLOWFMA-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7951 ; GFX6-SLOWFMA-NEXT: v_rcp_f32_e32 v4, v2
7952 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7953 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7954 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v4, v5, v4, v4
7955 ; GFX6-SLOWFMA-NEXT: v_mul_f32_e32 v5, v3, v4
7956 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v6, -v2, v5, v3
7957 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v5, v6, v4, v5
7958 ; GFX6-SLOWFMA-NEXT: v_fma_f32 v2, -v2, v5, v3
7959 ; GFX6-SLOWFMA-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7960 ; GFX6-SLOWFMA-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7961 ; GFX6-SLOWFMA-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7962 ; GFX6-SLOWFMA-NEXT: s_setpc_b64 s[30:31]
7964 ; GFX7-LABEL: v_fdiv_f32_daz_nodenorm_y:
7966 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7967 ; GFX7-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7968 ; GFX7-NEXT: v_rcp_f32_e32 v3, v2
7969 ; GFX7-NEXT: v_div_scale_f32 v4, vcc, v0, v1, v0
7970 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7971 ; GFX7-NEXT: v_fma_f32 v5, -v2, v3, 1.0
7972 ; GFX7-NEXT: v_fma_f32 v3, v5, v3, v3
7973 ; GFX7-NEXT: v_mul_f32_e32 v5, v4, v3
7974 ; GFX7-NEXT: v_fma_f32 v6, -v2, v5, v4
7975 ; GFX7-NEXT: v_fma_f32 v5, v6, v3, v5
7976 ; GFX7-NEXT: v_fma_f32 v2, -v2, v5, v4
7977 ; GFX7-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7978 ; GFX7-NEXT: v_div_fmas_f32 v2, v2, v3, v5
7979 ; GFX7-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7980 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7982 ; GFX8-LABEL: v_fdiv_f32_daz_nodenorm_y:
7984 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7985 ; GFX8-NEXT: v_div_scale_f32 v2, s[4:5], v1, v1, v0
7986 ; GFX8-NEXT: v_div_scale_f32 v3, vcc, v0, v1, v0
7987 ; GFX8-NEXT: v_rcp_f32_e32 v4, v2
7988 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
7989 ; GFX8-NEXT: v_fma_f32 v5, -v2, v4, 1.0
7990 ; GFX8-NEXT: v_fma_f32 v4, v5, v4, v4
7991 ; GFX8-NEXT: v_mul_f32_e32 v5, v3, v4
7992 ; GFX8-NEXT: v_fma_f32 v6, -v2, v5, v3
7993 ; GFX8-NEXT: v_fma_f32 v5, v6, v4, v5
7994 ; GFX8-NEXT: v_fma_f32 v2, -v2, v5, v3
7995 ; GFX8-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 0
7996 ; GFX8-NEXT: v_div_fmas_f32 v2, v2, v4, v5
7997 ; GFX8-NEXT: v_div_fixup_f32 v0, v2, v1, v0
7998 ; GFX8-NEXT: s_setpc_b64 s[30:31]
8000 ; GFX10-LABEL: v_fdiv_f32_daz_nodenorm_y:
8002 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8003 ; GFX10-NEXT: v_div_scale_f32 v2, s4, v1, v1, v0
8004 ; GFX10-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
8005 ; GFX10-NEXT: v_rcp_f32_e32 v3, v2
8006 ; GFX10-NEXT: s_denorm_mode 15
8007 ; GFX10-NEXT: v_fma_f32 v5, -v2, v3, 1.0
8008 ; GFX10-NEXT: v_fmac_f32_e32 v3, v5, v3
8009 ; GFX10-NEXT: v_mul_f32_e32 v5, v4, v3
8010 ; GFX10-NEXT: v_fma_f32 v6, -v2, v5, v4
8011 ; GFX10-NEXT: v_fmac_f32_e32 v5, v6, v3
8012 ; GFX10-NEXT: v_fma_f32 v2, -v2, v5, v4
8013 ; GFX10-NEXT: s_denorm_mode 12
8014 ; GFX10-NEXT: v_div_fmas_f32 v2, v2, v3, v5
8015 ; GFX10-NEXT: v_div_fixup_f32 v0, v2, v1, v0
8016 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8018 ; GFX11-LABEL: v_fdiv_f32_daz_nodenorm_y:
8020 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8021 ; GFX11-NEXT: v_div_scale_f32 v2, null, v1, v1, v0
8022 ; GFX11-NEXT: v_div_scale_f32 v4, vcc_lo, v0, v1, v0
8023 ; GFX11-NEXT: v_rcp_f32_e32 v3, v2
8024 ; GFX11-NEXT: s_denorm_mode 15
8025 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
8026 ; GFX11-NEXT: v_fma_f32 v5, -v2, v3, 1.0
8027 ; GFX11-NEXT: v_fmac_f32_e32 v3, v5, v3
8028 ; GFX11-NEXT: v_mul_f32_e32 v5, v4, v3
8029 ; GFX11-NEXT: v_fma_f32 v6, -v2, v5, v4
8030 ; GFX11-NEXT: v_fmac_f32_e32 v5, v6, v3
8031 ; GFX11-NEXT: v_fma_f32 v2, -v2, v5, v4
8032 ; GFX11-NEXT: s_denorm_mode 12
8033 ; GFX11-NEXT: v_div_fmas_f32 v2, v2, v3, v5
8034 ; GFX11-NEXT: v_div_fixup_f32 v0, v2, v1, v0
8035 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8037 ; EG-LABEL: v_fdiv_f32_daz_nodenorm_y:
8041 %div = fdiv float %x, %y
8045 define float @v_fdiv_f32_daz_25ulp_nodenorm_y(float %x, float nofpclass(sub) %y) #0 {
8046 ; GFX678-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8048 ; GFX678-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8049 ; GFX678-NEXT: s_mov_b32 s4, 0x6f800000
8050 ; GFX678-NEXT: v_mov_b32_e32 v2, 0x2f800000
8051 ; GFX678-NEXT: v_cmp_gt_f32_e64 vcc, |v1|, s4
8052 ; GFX678-NEXT: v_cndmask_b32_e32 v2, 1.0, v2, vcc
8053 ; GFX678-NEXT: v_mul_f32_e32 v1, v1, v2
8054 ; GFX678-NEXT: v_rcp_f32_e32 v1, v1
8055 ; GFX678-NEXT: v_mul_f32_e32 v0, v0, v1
8056 ; GFX678-NEXT: v_mul_f32_e32 v0, v2, v0
8057 ; GFX678-NEXT: s_setpc_b64 s[30:31]
8059 ; GFX10-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8061 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8062 ; GFX10-NEXT: v_cmp_lt_f32_e64 s4, 0x6f800000, |v1|
8063 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s4
8064 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v2
8065 ; GFX10-NEXT: v_rcp_f32_e32 v1, v1
8066 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
8067 ; GFX10-NEXT: v_mul_f32_e32 v0, v2, v0
8068 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8070 ; GFX11-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8072 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8073 ; GFX11-NEXT: v_cmp_lt_f32_e64 s0, 0x6f800000, |v1|
8074 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0x2f800000, s0
8075 ; GFX11-NEXT: v_mul_f32_e32 v1, v1, v2
8076 ; GFX11-NEXT: v_rcp_f32_e32 v1, v1
8077 ; GFX11-NEXT: s_waitcnt_depctr 0xfff
8078 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
8079 ; GFX11-NEXT: v_mul_f32_e32 v0, v2, v0
8080 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8082 ; EG-LABEL: v_fdiv_f32_daz_25ulp_nodenorm_y:
8086 %div = fdiv float %x, %y, !fpmath !0
8090 attributes #0 = { "denormal-fp-math-f32"="preserve-sign,preserve-sign" }
8091 attributes #1 = { "denormal-fp-math-f32"="ieee,ieee" }
8092 attributes #2 = { "denormal-fp-math-f32"="dynamic,dynamic" }
8094 !0 = !{float 2.500000e+00}