1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 < %s | FileCheck -check-prefixes=GFX7,GFX7-SDAG %s
3 ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 < %s | FileCheck -check-prefixes=GFX7,GFX7-GISEL %s
4 ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9,GFX9-SDAG %s
5 ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9,GFX9-GISEL %s
6 ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck -check-prefixes=GFX10,GFX10-SDAG %s
7 ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck -check-prefixes=GFX10,GFX10-GISEL %s
8 ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG %s
9 ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL %s
11 define float @fmul_select_f32_test1(float %x, i32 %bool.arg1, i32 %bool.arg2) {
12 ; GFX7-LABEL: fmul_select_f32_test1:
14 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
15 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
16 ; GFX7-NEXT: v_cndmask_b32_e64 v1, 1.0, 2.0, vcc
17 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v1
18 ; GFX7-NEXT: s_setpc_b64 s[30:31]
20 ; GFX9-LABEL: fmul_select_f32_test1:
22 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
23 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
24 ; GFX9-NEXT: v_cndmask_b32_e64 v1, 1.0, 2.0, vcc
25 ; GFX9-NEXT: v_mul_f32_e32 v0, v0, v1
26 ; GFX9-NEXT: s_setpc_b64 s[30:31]
28 ; GFX10-LABEL: fmul_select_f32_test1:
30 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
31 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
32 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 1.0, 2.0, vcc_lo
33 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
34 ; GFX10-NEXT: s_setpc_b64 s[30:31]
36 ; GFX11-LABEL: fmul_select_f32_test1:
38 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
39 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
40 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 1.0, 2.0, vcc_lo
41 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
42 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
43 ; GFX11-NEXT: s_setpc_b64 s[30:31]
44 %bool = icmp eq i32 %bool.arg1, %bool.arg2
45 %y = select i1 %bool, float 2.000000e+00, float 1.000000e+00
46 %ldexp = fmul float %x, %y
50 define float @fmul_select_f32_test2(float %x, i32 %bool.arg1, i32 %bool.arg2) {
51 ; GFX7-LABEL: fmul_select_f32_test2:
53 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
54 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
55 ; GFX7-NEXT: v_cndmask_b32_e64 v1, 1.0, 0.5, vcc
56 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v1
57 ; GFX7-NEXT: s_setpc_b64 s[30:31]
59 ; GFX9-LABEL: fmul_select_f32_test2:
61 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
62 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
63 ; GFX9-NEXT: v_cndmask_b32_e64 v1, 1.0, 0.5, vcc
64 ; GFX9-NEXT: v_mul_f32_e32 v0, v0, v1
65 ; GFX9-NEXT: s_setpc_b64 s[30:31]
67 ; GFX10-LABEL: fmul_select_f32_test2:
69 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
70 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
71 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 1.0, 0.5, vcc_lo
72 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
73 ; GFX10-NEXT: s_setpc_b64 s[30:31]
75 ; GFX11-LABEL: fmul_select_f32_test2:
77 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
78 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
79 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 1.0, 0.5, vcc_lo
80 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
81 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
82 ; GFX11-NEXT: s_setpc_b64 s[30:31]
83 %bool = icmp eq i32 %bool.arg1, %bool.arg2
84 %y = select i1 %bool, float 5.000000e-01, float 1.000000e+00
85 %ldexp = fmul float %x, %y
89 define <2 x float> @fmul_select_v2f32_test3(<2 x float> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
90 ; GFX7-SDAG-LABEL: fmul_select_v2f32_test3:
92 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
93 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
94 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
95 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
96 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
97 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
98 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
99 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
101 ; GFX7-GISEL-LABEL: fmul_select_v2f32_test3:
102 ; GFX7-GISEL: ; %bb.0:
103 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
104 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
105 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
106 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
107 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
108 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v2
109 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v1, v1, v3
110 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
112 ; GFX9-SDAG-LABEL: fmul_select_v2f32_test3:
113 ; GFX9-SDAG: ; %bb.0:
114 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
115 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
116 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
117 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
118 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
119 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
120 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
121 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
123 ; GFX9-GISEL-LABEL: fmul_select_v2f32_test3:
124 ; GFX9-GISEL: ; %bb.0:
125 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
126 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
127 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
128 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
129 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
130 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v0, v0, v2
131 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v1, v1, v3
132 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
134 ; GFX10-LABEL: fmul_select_v2f32_test3:
136 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
137 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
138 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc_lo
139 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v5
140 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v2
141 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc_lo
142 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
143 ; GFX10-NEXT: s_setpc_b64 s[30:31]
145 ; GFX11-LABEL: fmul_select_v2f32_test3:
147 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
148 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
149 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc_lo
150 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v5
151 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc_lo
152 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
153 ; GFX11-NEXT: v_dual_mul_f32 v0, v0, v2 :: v_dual_mul_f32 v1, v1, v3
154 ; GFX11-NEXT: s_setpc_b64 s[30:31]
155 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
156 %y = select <2 x i1> %bool, <2 x float> <float 2.000000e+00, float 2.000000e+00>, <2 x float> <float 1.000000e+00, float 1.000000e+00>
157 %ldexp = fmul <2 x float> %x, %y
158 ret <2 x float> %ldexp
161 define <2 x float> @fmul_select_v2f32_test4(<2 x float> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
162 ; GFX7-SDAG-LABEL: fmul_select_v2f32_test4:
163 ; GFX7-SDAG: ; %bb.0:
164 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
165 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
166 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
167 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
168 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
169 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
170 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
171 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
173 ; GFX7-GISEL-LABEL: fmul_select_v2f32_test4:
174 ; GFX7-GISEL: ; %bb.0:
175 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
176 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
177 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
178 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
179 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
180 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v2
181 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v1, v1, v3
182 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
184 ; GFX9-SDAG-LABEL: fmul_select_v2f32_test4:
185 ; GFX9-SDAG: ; %bb.0:
186 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
187 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
188 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
189 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
190 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
191 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
192 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
193 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
195 ; GFX9-GISEL-LABEL: fmul_select_v2f32_test4:
196 ; GFX9-GISEL: ; %bb.0:
197 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
198 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
199 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
200 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
201 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
202 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v0, v0, v2
203 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v1, v1, v3
204 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
206 ; GFX10-LABEL: fmul_select_v2f32_test4:
208 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
209 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
210 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc_lo
211 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v5
212 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v2
213 ; GFX10-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc_lo
214 ; GFX10-NEXT: v_mul_f32_e32 v1, v1, v3
215 ; GFX10-NEXT: s_setpc_b64 s[30:31]
217 ; GFX11-LABEL: fmul_select_v2f32_test4:
219 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
220 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
221 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc_lo
222 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v5
223 ; GFX11-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc_lo
224 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
225 ; GFX11-NEXT: v_dual_mul_f32 v0, v0, v2 :: v_dual_mul_f32 v1, v1, v3
226 ; GFX11-NEXT: s_setpc_b64 s[30:31]
227 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
228 %y = select <2 x i1> %bool, <2 x float> <float 5.000000e-01, float 5.000000e-01>, <2 x float> <float 1.000000e+00, float 1.000000e+00>
229 %ldexp = fmul <2 x float> %x, %y
230 ret <2 x float> %ldexp
233 define float @fmul_select_f32_test5(float %x, i32 %bool.arg1, i32 %bool.arg2) {
234 ; GFX7-LABEL: fmul_select_f32_test5:
236 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
237 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
238 ; GFX7-NEXT: v_cndmask_b32_e64 v1, -1.0, -2.0, vcc
239 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v1
240 ; GFX7-NEXT: s_setpc_b64 s[30:31]
242 ; GFX9-LABEL: fmul_select_f32_test5:
244 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
245 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
246 ; GFX9-NEXT: v_cndmask_b32_e64 v1, -1.0, -2.0, vcc
247 ; GFX9-NEXT: v_mul_f32_e32 v0, v0, v1
248 ; GFX9-NEXT: s_setpc_b64 s[30:31]
250 ; GFX10-LABEL: fmul_select_f32_test5:
252 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
253 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
254 ; GFX10-NEXT: v_cndmask_b32_e64 v1, -1.0, -2.0, vcc_lo
255 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
256 ; GFX10-NEXT: s_setpc_b64 s[30:31]
258 ; GFX11-LABEL: fmul_select_f32_test5:
260 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
261 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
262 ; GFX11-NEXT: v_cndmask_b32_e64 v1, -1.0, -2.0, vcc_lo
263 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
264 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
265 ; GFX11-NEXT: s_setpc_b64 s[30:31]
266 %bool = icmp eq i32 %bool.arg1, %bool.arg2
267 %y = select i1 %bool, float -2.000000e+00, float -1.000000e+00
268 %ldexp = fmul float %x, %y
272 define float @fmul_select_f32_test6(float %x, i32 %bool.arg1, i32 %bool.arg2) {
273 ; GFX7-SDAG-LABEL: fmul_select_f32_test6:
274 ; GFX7-SDAG: ; %bb.0:
275 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
276 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x41000000
277 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0xc0400000
278 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
279 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
280 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
281 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
283 ; GFX7-GISEL-LABEL: fmul_select_f32_test6:
284 ; GFX7-GISEL: ; %bb.0:
285 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
286 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0xc0400000
287 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0x41000000
288 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
289 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
290 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
291 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
293 ; GFX9-SDAG-LABEL: fmul_select_f32_test6:
294 ; GFX9-SDAG: ; %bb.0:
295 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
296 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x41000000
297 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xc0400000
298 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
299 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
300 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
301 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
303 ; GFX9-GISEL-LABEL: fmul_select_f32_test6:
304 ; GFX9-GISEL: ; %bb.0:
305 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
306 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xc0400000
307 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x41000000
308 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
309 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
310 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
311 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
313 ; GFX10-SDAG-LABEL: fmul_select_f32_test6:
314 ; GFX10-SDAG: ; %bb.0:
315 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
316 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0xc0400000
317 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
318 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x41000000, v3, vcc_lo
319 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
320 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
322 ; GFX10-GISEL-LABEL: fmul_select_f32_test6:
323 ; GFX10-GISEL: ; %bb.0:
324 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
325 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x41000000
326 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
327 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc0400000, vcc_lo
328 ; GFX10-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
329 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
331 ; GFX11-SDAG-LABEL: fmul_select_f32_test6:
332 ; GFX11-SDAG: ; %bb.0:
333 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
334 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v3, 0xc0400000
335 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
336 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
337 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x41000000, v3, vcc_lo
338 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
339 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
341 ; GFX11-GISEL-LABEL: fmul_select_f32_test6:
342 ; GFX11-GISEL: ; %bb.0:
343 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
344 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x41000000
345 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
346 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
347 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc0400000, vcc_lo
348 ; GFX11-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
349 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
350 %bool = icmp eq i32 %bool.arg1, %bool.arg2
351 %y = select i1 %bool, float -3.000000e+00, float 8.000000e+00
352 %ldexp = fmul float %x, %y
356 define float @fmul_select_f32_test7_sel_log2val_pos59_pos92(float %x, i32 %bool.arg1, i32 %bool.arg2) {
357 ; GFX7-LABEL: fmul_select_f32_test7_sel_log2val_pos59_pos92:
359 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
360 ; GFX7-NEXT: v_mov_b32_e32 v3, 0x5c
361 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
362 ; GFX7-NEXT: v_cndmask_b32_e64 v1, v3, 59, vcc
363 ; GFX7-NEXT: v_ldexp_f32_e32 v0, v0, v1
364 ; GFX7-NEXT: s_setpc_b64 s[30:31]
366 ; GFX9-LABEL: fmul_select_f32_test7_sel_log2val_pos59_pos92:
368 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
369 ; GFX9-NEXT: v_mov_b32_e32 v3, 0x5c
370 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
371 ; GFX9-NEXT: v_cndmask_b32_e64 v1, v3, 59, vcc
372 ; GFX9-NEXT: v_ldexp_f32 v0, v0, v1
373 ; GFX9-NEXT: s_setpc_b64 s[30:31]
375 ; GFX10-LABEL: fmul_select_f32_test7_sel_log2val_pos59_pos92:
377 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
378 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
379 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 0x5c, 59, vcc_lo
380 ; GFX10-NEXT: v_ldexp_f32 v0, v0, v1
381 ; GFX10-NEXT: s_setpc_b64 s[30:31]
383 ; GFX11-LABEL: fmul_select_f32_test7_sel_log2val_pos59_pos92:
385 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
386 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
387 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 0x5c, 59, vcc_lo
388 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
389 ; GFX11-NEXT: v_ldexp_f32 v0, v0, v1
390 ; GFX11-NEXT: s_setpc_b64 s[30:31]
391 %bool = icmp eq i32 %bool.arg1, %bool.arg2
392 %y = select i1 %bool, float 0x43A0000000000000, float 0x45B0000000000000
393 %ldexp = fmul float %x, %y
397 define float @fmul_select_f32_test8(float %x, i32 %bool.arg1, i32 %bool.arg2) {
398 ; GFX7-SDAG-LABEL: fmul_select_f32_test8:
399 ; GFX7-SDAG: ; %bb.0:
400 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
401 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0xc1000000
402 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0x41800000
403 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
404 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
405 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
406 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
408 ; GFX7-GISEL-LABEL: fmul_select_f32_test8:
409 ; GFX7-GISEL: ; %bb.0:
410 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
411 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x41800000
412 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0xc1000000
413 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
414 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
415 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
416 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
418 ; GFX9-SDAG-LABEL: fmul_select_f32_test8:
419 ; GFX9-SDAG: ; %bb.0:
420 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
421 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0xc1000000
422 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x41800000
423 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
424 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
425 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
426 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
428 ; GFX9-GISEL-LABEL: fmul_select_f32_test8:
429 ; GFX9-GISEL: ; %bb.0:
430 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
431 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x41800000
432 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xc1000000
433 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
434 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
435 ; GFX9-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
436 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
438 ; GFX10-SDAG-LABEL: fmul_select_f32_test8:
439 ; GFX10-SDAG: ; %bb.0:
440 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
441 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x41800000
442 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
443 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xc1000000, v3, vcc_lo
444 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
445 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
447 ; GFX10-GISEL-LABEL: fmul_select_f32_test8:
448 ; GFX10-GISEL: ; %bb.0:
449 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
450 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0xc1000000
451 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
452 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x41800000, vcc_lo
453 ; GFX10-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
454 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
456 ; GFX11-SDAG-LABEL: fmul_select_f32_test8:
457 ; GFX11-SDAG: ; %bb.0:
458 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
459 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v3, 0x41800000
460 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
461 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
462 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xc1000000, v3, vcc_lo
463 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
464 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
466 ; GFX11-GISEL-LABEL: fmul_select_f32_test8:
467 ; GFX11-GISEL: ; %bb.0:
468 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
469 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0xc1000000
470 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
471 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
472 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x41800000, vcc_lo
473 ; GFX11-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
474 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
475 %bool = icmp eq i32 %bool.arg1, %bool.arg2
476 %y = select i1 %bool, float 1.600000e+01, float -8.000000e+00
477 %ldexp = fmul float %x, %y
481 define float @fmul_select_f32_test9(float %x, i32 %bool.arg1, i32 %bool.arg2) {
482 ; GFX7-LABEL: fmul_select_f32_test9:
484 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
485 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
486 ; GFX7-NEXT: v_cndmask_b32_e64 v1, 2.0, 0, vcc
487 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v1
488 ; GFX7-NEXT: s_setpc_b64 s[30:31]
490 ; GFX9-LABEL: fmul_select_f32_test9:
492 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
493 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
494 ; GFX9-NEXT: v_cndmask_b32_e64 v1, 2.0, 0, vcc
495 ; GFX9-NEXT: v_mul_f32_e32 v0, v0, v1
496 ; GFX9-NEXT: s_setpc_b64 s[30:31]
498 ; GFX10-LABEL: fmul_select_f32_test9:
500 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
501 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
502 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 2.0, 0, vcc_lo
503 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
504 ; GFX10-NEXT: s_setpc_b64 s[30:31]
506 ; GFX11-LABEL: fmul_select_f32_test9:
508 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
509 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
510 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 2.0, 0, vcc_lo
511 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
512 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
513 ; GFX11-NEXT: s_setpc_b64 s[30:31]
514 %bool = icmp eq i32 %bool.arg1, %bool.arg2
515 %y = select i1 %bool, float 0.000000e+00, float 2.000000e+00
516 %ldexp = fmul float %x, %y
520 define float @fmul_select_f32_test10(float %x, i32 %bool.arg1, i32 %bool.arg2) {
521 ; GFX7-LABEL: fmul_select_f32_test10:
523 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
524 ; GFX7-NEXT: v_bfrev_b32_e32 v3, 1
525 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
526 ; GFX7-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
527 ; GFX7-NEXT: v_mul_f32_e32 v0, v0, v1
528 ; GFX7-NEXT: s_setpc_b64 s[30:31]
530 ; GFX9-LABEL: fmul_select_f32_test10:
532 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
533 ; GFX9-NEXT: v_bfrev_b32_e32 v3, 1
534 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
535 ; GFX9-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
536 ; GFX9-NEXT: v_mul_f32_e32 v0, v0, v1
537 ; GFX9-NEXT: s_setpc_b64 s[30:31]
539 ; GFX10-LABEL: fmul_select_f32_test10:
541 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
542 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
543 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 0, 0x80000000, vcc_lo
544 ; GFX10-NEXT: v_mul_f32_e32 v0, v0, v1
545 ; GFX10-NEXT: s_setpc_b64 s[30:31]
547 ; GFX11-LABEL: fmul_select_f32_test10:
549 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
550 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
551 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 0, 0x80000000, vcc_lo
552 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
553 ; GFX11-NEXT: v_mul_f32_e32 v0, v0, v1
554 ; GFX11-NEXT: s_setpc_b64 s[30:31]
555 %bool = icmp eq i32 %bool.arg1, %bool.arg2
556 %y = select i1 %bool, float -0.000000e+00, float 0.000000e+00
557 %ldexp = fmul float %x, %y
561 define float @fmul_select_f32_test11_sel_log2val_pos78_pos56(float %x, i32 %bool.arg1, i32 %bool.arg2) {
562 ; GFX7-LABEL: fmul_select_f32_test11_sel_log2val_pos78_pos56:
564 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
565 ; GFX7-NEXT: v_mov_b32_e32 v3, 0x4e
566 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
567 ; GFX7-NEXT: v_cndmask_b32_e32 v1, 56, v3, vcc
568 ; GFX7-NEXT: v_ldexp_f32_e64 v0, -v0, v1
569 ; GFX7-NEXT: s_setpc_b64 s[30:31]
571 ; GFX9-LABEL: fmul_select_f32_test11_sel_log2val_pos78_pos56:
573 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
574 ; GFX9-NEXT: v_mov_b32_e32 v3, 0x4e
575 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
576 ; GFX9-NEXT: v_cndmask_b32_e32 v1, 56, v3, vcc
577 ; GFX9-NEXT: v_ldexp_f32 v0, -v0, v1
578 ; GFX9-NEXT: s_setpc_b64 s[30:31]
580 ; GFX10-LABEL: fmul_select_f32_test11_sel_log2val_pos78_pos56:
582 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
583 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
584 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 56, 0x4e, vcc_lo
585 ; GFX10-NEXT: v_ldexp_f32 v0, -v0, v1
586 ; GFX10-NEXT: s_setpc_b64 s[30:31]
588 ; GFX11-LABEL: fmul_select_f32_test11_sel_log2val_pos78_pos56:
590 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
591 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
592 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 56, 0x4e, vcc_lo
593 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
594 ; GFX11-NEXT: v_ldexp_f32 v0, -v0, v1
595 ; GFX11-NEXT: s_setpc_b64 s[30:31]
596 %bool = icmp eq i32 %bool.arg1, %bool.arg2
597 %y = select i1 %bool, float 0xC4D0000000000000, float 0xC370000000000000
598 %ldexp = fmul float %x, %y
602 define float @fmul_select_f32_test12_sel_log2val_neg48_pos68(float %x, i32 %bool.arg1, i32 %bool.arg2) {
603 ; GFX7-SDAG-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
604 ; GFX7-SDAG: ; %bb.0:
605 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
606 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x44
607 ; GFX7-SDAG-NEXT: v_not_b32_e32 v4, 47
608 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
609 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
610 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
611 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
613 ; GFX7-GISEL-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
614 ; GFX7-GISEL: ; %bb.0:
615 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
616 ; GFX7-GISEL-NEXT: v_not_b32_e32 v3, 47
617 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0x44
618 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
619 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
620 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
621 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
623 ; GFX9-SDAG-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
624 ; GFX9-SDAG: ; %bb.0:
625 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
626 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x44
627 ; GFX9-SDAG-NEXT: v_not_b32_e32 v4, 47
628 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
629 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
630 ; GFX9-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
631 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
633 ; GFX9-GISEL-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
634 ; GFX9-GISEL: ; %bb.0:
635 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
636 ; GFX9-GISEL-NEXT: v_not_b32_e32 v3, 47
637 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x44
638 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
639 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
640 ; GFX9-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
641 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
643 ; GFX10-SDAG-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
644 ; GFX10-SDAG: ; %bb.0:
645 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
646 ; GFX10-SDAG-NEXT: v_not_b32_e32 v3, 47
647 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
648 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x44, v3, vcc_lo
649 ; GFX10-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
650 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
652 ; GFX10-GISEL-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
653 ; GFX10-GISEL: ; %bb.0:
654 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
655 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x44
656 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
657 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xffffffd0, vcc_lo
658 ; GFX10-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
659 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
661 ; GFX11-SDAG-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
662 ; GFX11-SDAG: ; %bb.0:
663 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
664 ; GFX11-SDAG-NEXT: v_not_b32_e32 v3, 47
665 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
666 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
667 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x44, v3, vcc_lo
668 ; GFX11-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
669 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
671 ; GFX11-GISEL-LABEL: fmul_select_f32_test12_sel_log2val_neg48_pos68:
672 ; GFX11-GISEL: ; %bb.0:
673 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
674 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x44
675 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
676 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
677 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xffffffd0, vcc_lo
678 ; GFX11-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
679 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
680 %bool = icmp eq i32 %bool.arg1, %bool.arg2
681 %y = select i1 %bool, float 0x3CF0000000000000, float 0x4430000000000000
682 %ldexp = fmul float %x, %y
686 define double @fmul_select_f64_test1(double %x, i32 %bool.arg1, i32 %bool.arg2) {
687 ; GFX7-LABEL: fmul_select_f64_test1:
689 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
690 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
691 ; GFX7-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
692 ; GFX7-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
693 ; GFX7-NEXT: s_setpc_b64 s[30:31]
695 ; GFX9-LABEL: fmul_select_f64_test1:
697 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
698 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
699 ; GFX9-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
700 ; GFX9-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
701 ; GFX9-NEXT: s_setpc_b64 s[30:31]
703 ; GFX10-LABEL: fmul_select_f64_test1:
705 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
706 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
707 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
708 ; GFX10-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
709 ; GFX10-NEXT: s_setpc_b64 s[30:31]
711 ; GFX11-LABEL: fmul_select_f64_test1:
713 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
714 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
715 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
716 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
717 ; GFX11-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
718 ; GFX11-NEXT: s_setpc_b64 s[30:31]
719 %bool = icmp eq i32 %bool.arg1, %bool.arg2
720 %y = select i1 %bool, double 2.000000e+00, double 1.000000e+00
721 %ldexp = fmul double %x, %y
725 define double @fmul_select_f64_test2(double %x, i32 %bool.arg1, i32 %bool.arg2) {
726 ; GFX7-LABEL: fmul_select_f64_test2:
728 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
729 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
730 ; GFX7-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
731 ; GFX7-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
732 ; GFX7-NEXT: s_setpc_b64 s[30:31]
734 ; GFX9-LABEL: fmul_select_f64_test2:
736 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
737 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
738 ; GFX9-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
739 ; GFX9-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
740 ; GFX9-NEXT: s_setpc_b64 s[30:31]
742 ; GFX10-LABEL: fmul_select_f64_test2:
744 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
745 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
746 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
747 ; GFX10-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
748 ; GFX10-NEXT: s_setpc_b64 s[30:31]
750 ; GFX11-LABEL: fmul_select_f64_test2:
752 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
753 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
754 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
755 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
756 ; GFX11-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
757 ; GFX11-NEXT: s_setpc_b64 s[30:31]
758 %bool = icmp eq i32 %bool.arg1, %bool.arg2
759 %y = select i1 %bool, double 5.000000e-01, double 1.000000e+00
760 %ldexp = fmul double %x, %y
764 define <2 x double> @fmul_select_v2f64_test3(<2 x double> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
765 ; GFX7-LABEL: fmul_select_v2f64_test3:
767 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
768 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
769 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
770 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
771 ; GFX7-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
772 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
773 ; GFX7-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
774 ; GFX7-NEXT: s_setpc_b64 s[30:31]
776 ; GFX9-LABEL: fmul_select_v2f64_test3:
778 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
779 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
780 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
781 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
782 ; GFX9-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
783 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
784 ; GFX9-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
785 ; GFX9-NEXT: s_setpc_b64 s[30:31]
787 ; GFX10-LABEL: fmul_select_v2f64_test3:
789 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
790 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
791 ; GFX10-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
792 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
793 ; GFX10-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
794 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc_lo
795 ; GFX10-NEXT: v_ldexp_f64 v[2:3], v[2:3], v5
796 ; GFX10-NEXT: s_setpc_b64 s[30:31]
798 ; GFX11-LABEL: fmul_select_v2f64_test3:
800 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
801 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
802 ; GFX11-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
803 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
804 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
805 ; GFX11-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
806 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc_lo
807 ; GFX11-NEXT: v_ldexp_f64 v[2:3], v[2:3], v5
808 ; GFX11-NEXT: s_setpc_b64 s[30:31]
809 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
810 %y = select <2 x i1> %bool, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> <double 1.000000e+00, double 1.000000e+00>
811 %ldexp = fmul <2 x double> %x, %y
812 ret <2 x double> %ldexp
815 define <2 x double> @fmul_select_v2f64_test4(<2 x double> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
816 ; GFX7-LABEL: fmul_select_v2f64_test4:
818 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
819 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
820 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc
821 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
822 ; GFX7-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
823 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc
824 ; GFX7-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
825 ; GFX7-NEXT: s_setpc_b64 s[30:31]
827 ; GFX9-LABEL: fmul_select_v2f64_test4:
829 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
830 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
831 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc
832 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
833 ; GFX9-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
834 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc
835 ; GFX9-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
836 ; GFX9-NEXT: s_setpc_b64 s[30:31]
838 ; GFX10-LABEL: fmul_select_v2f64_test4:
840 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
841 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
842 ; GFX10-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc_lo
843 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
844 ; GFX10-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
845 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc_lo
846 ; GFX10-NEXT: v_ldexp_f64 v[2:3], v[2:3], v5
847 ; GFX10-NEXT: s_setpc_b64 s[30:31]
849 ; GFX11-LABEL: fmul_select_v2f64_test4:
851 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
852 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
853 ; GFX11-NEXT: v_cndmask_b32_e64 v4, 0, -1, vcc_lo
854 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
855 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
856 ; GFX11-NEXT: v_ldexp_f64 v[0:1], v[0:1], v4
857 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc_lo
858 ; GFX11-NEXT: v_ldexp_f64 v[2:3], v[2:3], v5
859 ; GFX11-NEXT: s_setpc_b64 s[30:31]
860 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
861 %y = select <2 x i1> %bool, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> <double 1.000000e+00, double 1.000000e+00>
862 %ldexp = fmul <2 x double> %x, %y
863 ret <2 x double> %ldexp
866 define double @fmul_select_f64_test5(double %x, i32 %bool.arg1, i32 %bool.arg2) {
867 ; GFX7-LABEL: fmul_select_f64_test5:
869 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
870 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
871 ; GFX7-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
872 ; GFX7-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
873 ; GFX7-NEXT: s_setpc_b64 s[30:31]
875 ; GFX9-LABEL: fmul_select_f64_test5:
877 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
878 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
879 ; GFX9-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
880 ; GFX9-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
881 ; GFX9-NEXT: s_setpc_b64 s[30:31]
883 ; GFX10-LABEL: fmul_select_f64_test5:
885 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
886 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
887 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
888 ; GFX10-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
889 ; GFX10-NEXT: s_setpc_b64 s[30:31]
891 ; GFX11-LABEL: fmul_select_f64_test5:
893 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
894 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
895 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
896 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
897 ; GFX11-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
898 ; GFX11-NEXT: s_setpc_b64 s[30:31]
899 %bool = icmp eq i32 %bool.arg1, %bool.arg2
900 %y = select i1 %bool, double -5.000000e-01, double -1.000000e+00
901 %ldexp = fmul double %x, %y
905 define double @fmul_select_f64_test6(double %x, i32 %bool.arg1, i32 %bool.arg2) {
906 ; GFX7-LABEL: fmul_select_f64_test6:
908 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
909 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
910 ; GFX7-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
911 ; GFX7-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
912 ; GFX7-NEXT: s_setpc_b64 s[30:31]
914 ; GFX9-LABEL: fmul_select_f64_test6:
916 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
917 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
918 ; GFX9-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
919 ; GFX9-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
920 ; GFX9-NEXT: s_setpc_b64 s[30:31]
922 ; GFX10-LABEL: fmul_select_f64_test6:
924 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
925 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
926 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
927 ; GFX10-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
928 ; GFX10-NEXT: s_setpc_b64 s[30:31]
930 ; GFX11-LABEL: fmul_select_f64_test6:
932 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
933 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
934 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
935 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
936 ; GFX11-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
937 ; GFX11-NEXT: s_setpc_b64 s[30:31]
938 %bool = icmp eq i32 %bool.arg1, %bool.arg2
939 %y = select i1 %bool, double -2.000000e+00, double -1.000000e+00
940 %ldexp = fmul double %x, %y
944 define double @fmul_select_f64_test7(double %x, i32 %bool.arg1, i32 %bool.arg2) {
945 ; GFX7-SDAG-LABEL: fmul_select_f64_test7:
946 ; GFX7-SDAG: ; %bb.0:
947 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
948 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0xbff00000
949 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
950 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, v4, 2.0, vcc
951 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v2, 0
952 ; GFX7-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
953 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
955 ; GFX7-GISEL-LABEL: fmul_select_f64_test7:
956 ; GFX7-GISEL: ; %bb.0:
957 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
958 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v5, 0xbff00000
959 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
960 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0
961 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, 2.0, vcc
962 ; GFX7-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
963 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
965 ; GFX9-SDAG-LABEL: fmul_select_f64_test7:
966 ; GFX9-SDAG: ; %bb.0:
967 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
968 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xbff00000
969 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
970 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, v4, 2.0, vcc
971 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0
972 ; GFX9-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
973 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
975 ; GFX9-GISEL-LABEL: fmul_select_f64_test7:
976 ; GFX9-GISEL: ; %bb.0:
977 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
978 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 0xbff00000
979 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
980 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0
981 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, 2.0, vcc
982 ; GFX9-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
983 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
985 ; GFX10-LABEL: fmul_select_f64_test7:
987 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
988 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
989 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
990 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0xbff00000, 2.0, vcc_lo
991 ; GFX10-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
992 ; GFX10-NEXT: s_setpc_b64 s[30:31]
994 ; GFX11-LABEL: fmul_select_f64_test7:
996 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
997 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
998 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
999 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0xbff00000, 2.0, vcc_lo
1000 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
1001 ; GFX11-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1002 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1003 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1004 %y = select i1 %bool, double 2.000000e+00, double -1.000000e+00
1005 %ldexp = fmul double %x, %y
1009 define double @fmul_select_f64_test8(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1010 ; GFX7-LABEL: fmul_select_f64_test8:
1012 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1013 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1014 ; GFX7-NEXT: v_cndmask_b32_e64 v2, 5, 2, vcc
1015 ; GFX7-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
1016 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1018 ; GFX9-LABEL: fmul_select_f64_test8:
1020 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1021 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1022 ; GFX9-NEXT: v_cndmask_b32_e64 v2, 5, 2, vcc
1023 ; GFX9-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
1024 ; GFX9-NEXT: s_setpc_b64 s[30:31]
1026 ; GFX10-LABEL: fmul_select_f64_test8:
1028 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1029 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1030 ; GFX10-NEXT: v_cndmask_b32_e64 v2, 5, 2, vcc_lo
1031 ; GFX10-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
1032 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1034 ; GFX11-LABEL: fmul_select_f64_test8:
1036 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1037 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1038 ; GFX11-NEXT: v_cndmask_b32_e64 v2, 5, 2, vcc_lo
1039 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
1040 ; GFX11-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v2
1041 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1042 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1043 %y = select i1 %bool, double -4.000000e+00, double -3.200000e+01
1044 %ldexp = fmul double %x, %y
1048 define <2 x double> @fmul_select_v2f64_test9(<2 x double> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
1049 ; GFX7-LABEL: fmul_select_v2f64_test9:
1051 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1052 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1053 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1054 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1055 ; GFX7-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v4
1056 ; GFX7-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1057 ; GFX7-NEXT: v_ldexp_f64 v[2:3], -v[2:3], v4
1058 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1060 ; GFX9-LABEL: fmul_select_v2f64_test9:
1062 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1063 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1064 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1065 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1066 ; GFX9-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v4
1067 ; GFX9-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1068 ; GFX9-NEXT: v_ldexp_f64 v[2:3], -v[2:3], v4
1069 ; GFX9-NEXT: s_setpc_b64 s[30:31]
1071 ; GFX10-LABEL: fmul_select_v2f64_test9:
1073 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1074 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1075 ; GFX10-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1076 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1077 ; GFX10-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v4
1078 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc_lo
1079 ; GFX10-NEXT: v_ldexp_f64 v[2:3], -v[2:3], v5
1080 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1082 ; GFX11-LABEL: fmul_select_v2f64_test9:
1084 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1085 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1086 ; GFX11-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1087 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1088 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
1089 ; GFX11-NEXT: v_ldexp_f64 v[0:1], -v[0:1], v4
1090 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0, 1, vcc_lo
1091 ; GFX11-NEXT: v_ldexp_f64 v[2:3], -v[2:3], v5
1092 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1093 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
1094 %y = select <2 x i1> %bool, <2 x double> <double -2.000000e+00, double -2.000000e+00>, <2 x double> <double -1.000000e+00, double -1.000000e+00>
1095 %ldexp = fmul <2 x double> %x, %y
1096 ret <2 x double> %ldexp
1099 define <2 x double> @fmul_select_v2f64_test10(<2 x double> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
1100 ; GFX7-SDAG-LABEL: fmul_select_v2f64_test10:
1101 ; GFX7-SDAG: ; %bb.0:
1102 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1103 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v8, 0xbff00000
1104 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v9, 0x3fe00000
1105 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1106 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v9, v8, v9, vcc
1107 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1108 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v8, 0
1109 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1110 ; GFX7-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1111 ; GFX7-SDAG-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1112 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1114 ; GFX7-GISEL-LABEL: fmul_select_v2f64_test10:
1115 ; GFX7-GISEL: ; %bb.0:
1116 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1117 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v9, 0x3fe00000
1118 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v10, 0xbff00000
1119 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1120 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v9, v10, v9, vcc
1121 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1122 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v8, 0
1123 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1124 ; GFX7-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1125 ; GFX7-GISEL-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1126 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1128 ; GFX9-SDAG-LABEL: fmul_select_v2f64_test10:
1129 ; GFX9-SDAG: ; %bb.0:
1130 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1131 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v8, 0xbff00000
1132 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v9, 0x3fe00000
1133 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1134 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v9, v8, v9, vcc
1135 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1136 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v8, 0
1137 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1138 ; GFX9-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1139 ; GFX9-SDAG-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1140 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1142 ; GFX9-GISEL-LABEL: fmul_select_v2f64_test10:
1143 ; GFX9-GISEL: ; %bb.0:
1144 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1145 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v9, 0x3fe00000
1146 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v10, 0xbff00000
1147 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
1148 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v9, v10, v9, vcc
1149 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v5, v7
1150 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v8, 0
1151 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc
1152 ; GFX9-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1153 ; GFX9-GISEL-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1154 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1156 ; GFX10-SDAG-LABEL: fmul_select_v2f64_test10:
1157 ; GFX10-SDAG: ; %bb.0:
1158 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1159 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v8, 0x3fe00000
1160 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1161 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v9, 0xbff00000, v8, vcc_lo
1162 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1163 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v8, 0
1164 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1165 ; GFX10-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1166 ; GFX10-SDAG-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1167 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1169 ; GFX10-GISEL-LABEL: fmul_select_v2f64_test10:
1170 ; GFX10-GISEL: ; %bb.0:
1171 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1172 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v9, 0xbff00000
1173 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1174 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v8, 0
1175 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v9, v9, 0x3fe00000, vcc_lo
1176 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1177 ; GFX10-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1178 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1179 ; GFX10-GISEL-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1180 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1182 ; GFX11-SDAG-LABEL: fmul_select_v2f64_test10:
1183 ; GFX11-SDAG: ; %bb.0:
1184 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1185 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v8, 0x3fe00000
1186 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1187 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
1188 ; GFX11-SDAG-NEXT: v_dual_cndmask_b32 v9, 0xbff00000, v8 :: v_dual_mov_b32 v8, 0
1189 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1190 ; GFX11-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1191 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1192 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
1193 ; GFX11-SDAG-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1194 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1196 ; GFX11-GISEL-LABEL: fmul_select_v2f64_test10:
1197 ; GFX11-GISEL: ; %bb.0:
1198 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1199 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v9, 0xbff00000 :: v_dual_mov_b32 v8, 0
1200 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
1201 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
1202 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v9, v9, 0x3fe00000, vcc_lo
1203 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v7
1204 ; GFX11-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[8:9]
1205 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1, vcc_lo
1206 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
1207 ; GFX11-GISEL-NEXT: v_ldexp_f64 v[2:3], v[2:3], v4
1208 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1209 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
1210 %y = select <2 x i1> %bool, <2 x double> <double 5.000000e-01, double 2.000000e+00>, <2 x double> <double -1.000000e+00, double 1.000000e+00>
1211 %ldexp = fmul <2 x double> %x, %y
1212 ret <2 x double> %ldexp
1215 define double @fmul_select_f64_test11(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1216 ; GFX7-SDAG-LABEL: fmul_select_f64_test11:
1217 ; GFX7-SDAG: ; %bb.0:
1218 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1219 ; GFX7-SDAG-NEXT: v_bfrev_b32_e32 v4, 1
1220 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1221 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, v4, -2.0, vcc
1222 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v2, 0
1223 ; GFX7-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1224 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1226 ; GFX7-GISEL-LABEL: fmul_select_f64_test11:
1227 ; GFX7-GISEL: ; %bb.0:
1228 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1229 ; GFX7-GISEL-NEXT: v_bfrev_b32_e32 v5, 1
1230 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1231 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0
1232 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, -2.0, vcc
1233 ; GFX7-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1234 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1236 ; GFX9-SDAG-LABEL: fmul_select_f64_test11:
1237 ; GFX9-SDAG: ; %bb.0:
1238 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1239 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v4, 1
1240 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1241 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, v4, -2.0, vcc
1242 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0
1243 ; GFX9-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1244 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1246 ; GFX9-GISEL-LABEL: fmul_select_f64_test11:
1247 ; GFX9-GISEL: ; %bb.0:
1248 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1249 ; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v5, 1
1250 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1251 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0
1252 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, -2.0, vcc
1253 ; GFX9-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1254 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1256 ; GFX10-LABEL: fmul_select_f64_test11:
1258 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1259 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1260 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
1261 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0x80000000, -2.0, vcc_lo
1262 ; GFX10-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1263 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1265 ; GFX11-LABEL: fmul_select_f64_test11:
1267 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1268 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1269 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
1270 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0x80000000, -2.0, vcc_lo
1271 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
1272 ; GFX11-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1273 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1274 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1275 %y = select i1 %bool, double -2.000000e+00, double -0.000000e+00
1276 %ldexp = fmul double %x, %y
1280 define double @fmul_select_f64_test12(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1281 ; GFX7-SDAG-LABEL: fmul_select_f64_test12:
1282 ; GFX7-SDAG: ; %bb.0:
1283 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1284 ; GFX7-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, v2, v3
1285 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
1286 ; GFX7-SDAG-NEXT: v_lshlrev_b32_e32 v3, 31, v2
1287 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v2, 0
1288 ; GFX7-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1289 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1291 ; GFX7-GISEL-LABEL: fmul_select_f64_test12:
1292 ; GFX7-GISEL: ; %bb.0:
1293 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1294 ; GFX7-GISEL-NEXT: v_bfrev_b32_e32 v5, 1
1295 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1296 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0
1297 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, 0, vcc
1298 ; GFX7-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1299 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1301 ; GFX9-SDAG-LABEL: fmul_select_f64_test12:
1302 ; GFX9-SDAG: ; %bb.0:
1303 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1304 ; GFX9-SDAG-NEXT: v_cmp_ne_u32_e32 vcc, v2, v3
1305 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
1306 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v3, 31, v2
1307 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0
1308 ; GFX9-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1309 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1311 ; GFX9-GISEL-LABEL: fmul_select_f64_test12:
1312 ; GFX9-GISEL: ; %bb.0:
1313 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1314 ; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v5, 1
1315 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1316 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0
1317 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v5, v5, 0, vcc
1318 ; GFX9-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1319 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1321 ; GFX10-SDAG-LABEL: fmul_select_f64_test12:
1322 ; GFX10-SDAG: ; %bb.0:
1323 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1324 ; GFX10-SDAG-NEXT: v_cmp_ne_u32_e32 vcc_lo, v2, v3
1325 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v2, 0
1326 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v3, 0, 1, vcc_lo
1327 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v3, 31, v3
1328 ; GFX10-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1329 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1331 ; GFX10-GISEL-LABEL: fmul_select_f64_test12:
1332 ; GFX10-GISEL: ; %bb.0:
1333 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1334 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1335 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v4, 0
1336 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, 0x80000000, 0, vcc_lo
1337 ; GFX10-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1338 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1340 ; GFX11-SDAG-LABEL: fmul_select_f64_test12:
1341 ; GFX11-SDAG: ; %bb.0:
1342 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1343 ; GFX11-SDAG-NEXT: v_cmp_ne_u32_e32 vcc_lo, v2, v3
1344 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v3, 0, 1, vcc_lo
1345 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1346 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_lshlrev_b32 v3, 31, v3
1347 ; GFX11-SDAG-NEXT: v_mul_f64 v[0:1], v[0:1], v[2:3]
1348 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1350 ; GFX11-GISEL-LABEL: fmul_select_f64_test12:
1351 ; GFX11-GISEL: ; %bb.0:
1352 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1353 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1354 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v4, 0
1355 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, 0x80000000, 0, vcc_lo
1356 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
1357 ; GFX11-GISEL-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1358 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1359 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1360 %y = select i1 %bool, double 0.000000e+00, double -0.000000e+00
1361 %ldexp = fmul double %x, %y
1365 define double @fmul_select_f64_test13(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1366 ; GFX7-LABEL: fmul_select_f64_test13:
1368 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1369 ; GFX7-NEXT: v_mov_b32_e32 v5, 0x40300000
1370 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1371 ; GFX7-NEXT: v_mov_b32_e32 v4, 0
1372 ; GFX7-NEXT: v_cndmask_b32_e64 v5, v5, 0, vcc
1373 ; GFX7-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1374 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1376 ; GFX9-LABEL: fmul_select_f64_test13:
1378 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1379 ; GFX9-NEXT: v_mov_b32_e32 v5, 0x40300000
1380 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1381 ; GFX9-NEXT: v_mov_b32_e32 v4, 0
1382 ; GFX9-NEXT: v_cndmask_b32_e64 v5, v5, 0, vcc
1383 ; GFX9-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1384 ; GFX9-NEXT: s_setpc_b64 s[30:31]
1386 ; GFX10-LABEL: fmul_select_f64_test13:
1388 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1389 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1390 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
1391 ; GFX10-NEXT: v_cndmask_b32_e64 v5, 0x40300000, 0, vcc_lo
1392 ; GFX10-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1393 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1395 ; GFX11-LABEL: fmul_select_f64_test13:
1397 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1398 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1399 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
1400 ; GFX11-NEXT: v_cndmask_b32_e64 v5, 0x40300000, 0, vcc_lo
1401 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
1402 ; GFX11-NEXT: v_mul_f64 v[0:1], v[0:1], v[4:5]
1403 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1404 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1405 %y = select i1 %bool, double 0.000000e+00, double 1.600000e+01
1406 %ldexp = fmul double %x, %y
1410 define double @fmul_select_f64_test14_sel_log2val_pos92_neg27(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1411 ; GFX7-SDAG-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1412 ; GFX7-SDAG: ; %bb.0:
1413 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1414 ; GFX7-SDAG-NEXT: v_not_b32_e32 v4, 26
1415 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v5, 0x5c
1416 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1417 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v5, vcc
1418 ; GFX7-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1419 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1421 ; GFX7-GISEL-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1422 ; GFX7-GISEL: ; %bb.0:
1423 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1424 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0x5c
1425 ; GFX7-GISEL-NEXT: v_not_b32_e32 v5, 26
1426 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1427 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v5, v4, vcc
1428 ; GFX7-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1429 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1431 ; GFX9-SDAG-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1432 ; GFX9-SDAG: ; %bb.0:
1433 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1434 ; GFX9-SDAG-NEXT: v_not_b32_e32 v4, 26
1435 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v5, 0x5c
1436 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1437 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v5, vcc
1438 ; GFX9-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1439 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1441 ; GFX9-GISEL-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1442 ; GFX9-GISEL: ; %bb.0:
1443 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1444 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x5c
1445 ; GFX9-GISEL-NEXT: v_not_b32_e32 v5, 26
1446 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1447 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v5, v4, vcc
1448 ; GFX9-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1449 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1451 ; GFX10-SDAG-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1452 ; GFX10-SDAG: ; %bb.0:
1453 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1454 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v4, 0x5c
1455 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1456 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0xffffffe5, v4, vcc_lo
1457 ; GFX10-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1458 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1460 ; GFX10-GISEL-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1461 ; GFX10-GISEL: ; %bb.0:
1462 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1463 ; GFX10-GISEL-NEXT: v_not_b32_e32 v4, 26
1464 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1465 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v4, 0x5c, vcc_lo
1466 ; GFX10-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1467 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1469 ; GFX11-SDAG-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1470 ; GFX11-SDAG: ; %bb.0:
1471 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1472 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v4, 0x5c
1473 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1474 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1475 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0xffffffe5, v4, vcc_lo
1476 ; GFX11-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1477 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1479 ; GFX11-GISEL-LABEL: fmul_select_f64_test14_sel_log2val_pos92_neg27:
1480 ; GFX11-GISEL: ; %bb.0:
1481 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1482 ; GFX11-GISEL-NEXT: v_not_b32_e32 v4, 26
1483 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1484 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1485 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v4, 0x5c, vcc_lo
1486 ; GFX11-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1487 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1488 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1489 %y = select i1 %bool, double 0x45B0000000000000, double 0x3E40000000000000
1490 %ldexp = fmul double %x, %y
1494 define double @fmul_select_f64_test15_sel_log2val_neg42_neg33(double %x, i32 %bool.arg1, i32 %bool.arg2) {
1495 ; GFX7-SDAG-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1496 ; GFX7-SDAG: ; %bb.0:
1497 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1498 ; GFX7-SDAG-NEXT: v_not_b32_e32 v4, 32
1499 ; GFX7-SDAG-NEXT: v_not_b32_e32 v5, 41
1500 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1501 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v5, vcc
1502 ; GFX7-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1503 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1505 ; GFX7-GISEL-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1506 ; GFX7-GISEL: ; %bb.0:
1507 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1508 ; GFX7-GISEL-NEXT: v_not_b32_e32 v4, 41
1509 ; GFX7-GISEL-NEXT: v_not_b32_e32 v5, 32
1510 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1511 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v2, v5, v4, vcc
1512 ; GFX7-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1513 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1515 ; GFX9-SDAG-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1516 ; GFX9-SDAG: ; %bb.0:
1517 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1518 ; GFX9-SDAG-NEXT: v_not_b32_e32 v4, 32
1519 ; GFX9-SDAG-NEXT: v_not_b32_e32 v5, 41
1520 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1521 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v4, v5, vcc
1522 ; GFX9-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1523 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1525 ; GFX9-GISEL-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1526 ; GFX9-GISEL: ; %bb.0:
1527 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1528 ; GFX9-GISEL-NEXT: v_not_b32_e32 v4, 41
1529 ; GFX9-GISEL-NEXT: v_not_b32_e32 v5, 32
1530 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v3
1531 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, v5, v4, vcc
1532 ; GFX9-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1533 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1535 ; GFX10-SDAG-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1536 ; GFX10-SDAG: ; %bb.0:
1537 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1538 ; GFX10-SDAG-NEXT: v_not_b32_e32 v4, 41
1539 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1540 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0xffffffdf, v4, vcc_lo
1541 ; GFX10-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1542 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1544 ; GFX10-GISEL-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1545 ; GFX10-GISEL: ; %bb.0:
1546 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1547 ; GFX10-GISEL-NEXT: v_not_b32_e32 v4, 32
1548 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1549 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, v4, 0xffffffd6, vcc_lo
1550 ; GFX10-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1551 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1553 ; GFX11-SDAG-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1554 ; GFX11-SDAG: ; %bb.0:
1555 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1556 ; GFX11-SDAG-NEXT: v_not_b32_e32 v4, 41
1557 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1558 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1559 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0xffffffdf, v4, vcc_lo
1560 ; GFX11-SDAG-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1561 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1563 ; GFX11-GISEL-LABEL: fmul_select_f64_test15_sel_log2val_neg42_neg33:
1564 ; GFX11-GISEL: ; %bb.0:
1565 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1566 ; GFX11-GISEL-NEXT: v_not_b32_e32 v4, 32
1567 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v3
1568 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1569 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, v4, 0xffffffd6, vcc_lo
1570 ; GFX11-GISEL-NEXT: v_ldexp_f64 v[0:1], v[0:1], v2
1571 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1572 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1573 %y = select i1 %bool, double 0x3D50000000000000, double 0x3DE0000000000000
1574 %ldexp = fmul double %x, %y
1579 define half @fmul_select_f16_test1(half %x, i32 %bool.arg1, i32 %bool.arg2) {
1580 ; GFX7-SDAG-LABEL: fmul_select_f16_test1:
1581 ; GFX7-SDAG: ; %bb.0:
1582 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1583 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
1584 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1585 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
1586 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
1587 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
1588 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1590 ; GFX7-GISEL-LABEL: fmul_select_f16_test1:
1591 ; GFX7-GISEL: ; %bb.0:
1592 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1593 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
1594 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1595 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
1596 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
1597 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
1598 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1600 ; GFX9-SDAG-LABEL: fmul_select_f16_test1:
1601 ; GFX9-SDAG: ; %bb.0:
1602 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1603 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1604 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
1605 ; GFX9-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1606 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1608 ; GFX9-GISEL-LABEL: fmul_select_f16_test1:
1609 ; GFX9-GISEL: ; %bb.0:
1610 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1611 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1612 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
1613 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
1614 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1615 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
1616 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1617 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1619 ; GFX10-SDAG-LABEL: fmul_select_f16_test1:
1620 ; GFX10-SDAG: ; %bb.0:
1621 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1622 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1623 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1624 ; GFX10-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1625 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1627 ; GFX10-GISEL-LABEL: fmul_select_f16_test1:
1628 ; GFX10-GISEL: ; %bb.0:
1629 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1630 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1631 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
1632 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1633 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
1634 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1635 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1637 ; GFX11-SDAG-LABEL: fmul_select_f16_test1:
1638 ; GFX11-SDAG: ; %bb.0:
1639 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1640 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1641 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1642 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
1643 ; GFX11-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1644 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1646 ; GFX11-GISEL-LABEL: fmul_select_f16_test1:
1647 ; GFX11-GISEL: ; %bb.0:
1648 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1649 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1650 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
1651 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1652 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1653 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
1654 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1655 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1656 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1657 %y = select i1 %bool, half 2.000000e+00, half 1.000000e+00
1658 %ldexp = fmul half %x, %y
1662 define half @fmul_select_f16_test2(half %x, i32 %bool.arg1, i32 %bool.arg2) {
1663 ; GFX7-SDAG-LABEL: fmul_select_f16_test2:
1664 ; GFX7-SDAG: ; %bb.0:
1665 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1666 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
1667 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1668 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
1669 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
1670 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
1671 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1673 ; GFX7-GISEL-LABEL: fmul_select_f16_test2:
1674 ; GFX7-GISEL: ; %bb.0:
1675 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1676 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
1677 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1678 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
1679 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
1680 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
1681 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1683 ; GFX9-SDAG-LABEL: fmul_select_f16_test2:
1684 ; GFX9-SDAG: ; %bb.0:
1685 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1686 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1687 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
1688 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x8000
1689 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0x7fff
1690 ; GFX9-SDAG-NEXT: v_med3_i32 v1, v1, s4, v2
1691 ; GFX9-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1692 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1694 ; GFX9-GISEL-LABEL: fmul_select_f16_test2:
1695 ; GFX9-GISEL: ; %bb.0:
1696 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1697 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
1698 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
1699 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
1700 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1701 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
1702 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1703 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1705 ; GFX10-SDAG-LABEL: fmul_select_f16_test2:
1706 ; GFX10-SDAG: ; %bb.0:
1707 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1708 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1709 ; GFX10-SDAG-NEXT: s_movk_i32 s4, 0x8000
1710 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1711 ; GFX10-SDAG-NEXT: v_med3_i32 v1, v1, s4, 0x7fff
1712 ; GFX10-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1713 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1715 ; GFX10-GISEL-LABEL: fmul_select_f16_test2:
1716 ; GFX10-GISEL: ; %bb.0:
1717 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1718 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1719 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
1720 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1721 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
1722 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1723 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1725 ; GFX11-SDAG-LABEL: fmul_select_f16_test2:
1726 ; GFX11-SDAG: ; %bb.0:
1727 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1728 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1729 ; GFX11-SDAG-NEXT: s_movk_i32 s0, 0x8000
1730 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1731 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1732 ; GFX11-SDAG-NEXT: v_med3_i32 v1, v1, s0, 0x7fff
1733 ; GFX11-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
1734 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1736 ; GFX11-GISEL-LABEL: fmul_select_f16_test2:
1737 ; GFX11-GISEL: ; %bb.0:
1738 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1739 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
1740 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
1741 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1742 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1743 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
1744 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1745 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1746 %bool = icmp eq i32 %bool.arg1, %bool.arg2
1747 %y = select i1 %bool, half 5.000000e-01, half 1.000000e+00
1748 %ldexp = fmul half %x, %y
1752 define <2 x half> @fmul_select_v2f16_test3(<2 x half> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
1753 ; GFX7-SDAG-LABEL: fmul_select_v2f16_test3:
1754 ; GFX7-SDAG: ; %bb.0:
1755 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1756 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
1757 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
1758 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
1759 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
1760 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
1761 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
1762 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1763 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
1764 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
1765 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
1766 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1768 ; GFX7-GISEL-LABEL: fmul_select_v2f16_test3:
1769 ; GFX7-GISEL: ; %bb.0:
1770 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1771 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
1772 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
1773 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1774 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
1775 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
1776 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, 1, vcc
1777 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v2
1778 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
1779 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
1780 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
1781 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1783 ; GFX9-SDAG-LABEL: fmul_select_v2f16_test3:
1784 ; GFX9-SDAG: ; %bb.0:
1785 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1786 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v5, 0x3c00
1787 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x4000
1788 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1789 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v5, v6, vcc
1790 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
1791 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v6, vcc
1792 ; GFX9-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1793 ; GFX9-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1794 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1796 ; GFX9-GISEL-LABEL: fmul_select_v2f16_test3:
1797 ; GFX9-GISEL: ; %bb.0:
1798 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1799 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
1800 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
1801 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1802 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
1803 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xffff8000
1804 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x7fff
1805 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v3, v4
1806 ; GFX9-GISEL-NEXT: v_med3_i32 v2, v2, v3, v4
1807 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v1, v0, v1
1808 ; GFX9-GISEL-NEXT: v_ldexp_f16_sdwa v0, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
1809 ; GFX9-GISEL-NEXT: v_lshl_or_b32 v0, v0, 16, v1
1810 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1812 ; GFX10-SDAG-LABEL: fmul_select_v2f16_test3:
1813 ; GFX10-SDAG: ; %bb.0:
1814 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1815 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v5, 0x4000
1816 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1817 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3c00, v5, vcc_lo
1818 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1819 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3c00, v5, vcc_lo
1820 ; GFX10-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1821 ; GFX10-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1822 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1824 ; GFX10-GISEL-LABEL: fmul_select_v2f16_test3:
1825 ; GFX10-GISEL: ; %bb.0:
1826 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1827 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1828 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1829 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1830 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1831 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v3
1832 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
1833 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v1, v0, v1
1834 ; GFX10-GISEL-NEXT: v_med3_i32 v2, 0xffff8000, v2, v3
1835 ; GFX10-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v1
1836 ; GFX10-GISEL-NEXT: v_ldexp_f16_sdwa v0, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
1837 ; GFX10-GISEL-NEXT: v_lshl_or_b32 v0, v0, 16, v1
1838 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1840 ; GFX11-SDAG-LABEL: fmul_select_v2f16_test3:
1841 ; GFX11-SDAG: ; %bb.0:
1842 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1843 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v5, 0x4000
1844 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1845 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
1846 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3c00, v5, vcc_lo
1847 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1848 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3c00, v5, vcc_lo
1849 ; GFX11-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1850 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
1851 ; GFX11-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1852 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1854 ; GFX11-GISEL-LABEL: fmul_select_v2f16_test3:
1855 ; GFX11-GISEL: ; %bb.0:
1856 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1857 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1858 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1859 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
1860 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1861 ; GFX11-GISEL-NEXT: v_lshrrev_b32_e32 v4, 16, v0
1862 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
1863 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v3
1864 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc_lo
1865 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1866 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
1867 ; GFX11-GISEL-NEXT: v_med3_i32 v2, 0xffff8000, v2, v3
1868 ; GFX11-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0
1869 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1870 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v1, v4, v2
1871 ; GFX11-GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0
1872 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1873 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
1874 %y = select <2 x i1> %bool, <2 x half> <half 2.000000e+00, half 2.000000e+00>, <2 x half> <half 1.000000e+00, half 1.000000e+00>
1875 %ldexp = fmul <2 x half> %x, %y
1876 ret <2 x half> %ldexp
1879 define <2 x half> @fmul_select_v2f16_test4(<2 x half> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
1880 ; GFX7-SDAG-LABEL: fmul_select_v2f16_test4:
1881 ; GFX7-SDAG: ; %bb.0:
1882 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1883 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
1884 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
1885 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
1886 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
1887 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
1888 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
1889 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1890 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
1891 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
1892 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
1893 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
1895 ; GFX7-GISEL-LABEL: fmul_select_v2f16_test4:
1896 ; GFX7-GISEL: ; %bb.0:
1897 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1898 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
1899 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
1900 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1901 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
1902 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
1903 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, -1, vcc
1904 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v2
1905 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
1906 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
1907 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
1908 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
1910 ; GFX9-SDAG-LABEL: fmul_select_v2f16_test4:
1911 ; GFX9-SDAG: ; %bb.0:
1912 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1913 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v5, 0x3c00
1914 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x3800
1915 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1916 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v5, v6, vcc
1917 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
1918 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v6, vcc
1919 ; GFX9-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1920 ; GFX9-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1921 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1923 ; GFX9-GISEL-LABEL: fmul_select_v2f16_test4:
1924 ; GFX9-GISEL: ; %bb.0:
1925 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1926 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
1927 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
1928 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
1929 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
1930 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xffff8000
1931 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x7fff
1932 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v3, v4
1933 ; GFX9-GISEL-NEXT: v_med3_i32 v2, v2, v3, v4
1934 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v1, v0, v1
1935 ; GFX9-GISEL-NEXT: v_ldexp_f16_sdwa v0, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
1936 ; GFX9-GISEL-NEXT: v_lshl_or_b32 v0, v0, 16, v1
1937 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1939 ; GFX10-SDAG-LABEL: fmul_select_v2f16_test4:
1940 ; GFX10-SDAG: ; %bb.0:
1941 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1942 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v5, 0x3800
1943 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1944 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3c00, v5, vcc_lo
1945 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1946 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3c00, v5, vcc_lo
1947 ; GFX10-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1948 ; GFX10-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1949 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1951 ; GFX10-GISEL-LABEL: fmul_select_v2f16_test4:
1952 ; GFX10-GISEL: ; %bb.0:
1953 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1954 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1955 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1956 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1957 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1958 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v3
1959 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
1960 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v1, v0, v1
1961 ; GFX10-GISEL-NEXT: v_med3_i32 v2, 0xffff8000, v2, v3
1962 ; GFX10-GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v1
1963 ; GFX10-GISEL-NEXT: v_ldexp_f16_sdwa v0, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
1964 ; GFX10-GISEL-NEXT: v_lshl_or_b32 v0, v0, 16, v1
1965 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1967 ; GFX11-SDAG-LABEL: fmul_select_v2f16_test4:
1968 ; GFX11-SDAG: ; %bb.0:
1969 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1970 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v5, 0x3800
1971 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1972 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
1973 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3c00, v5, vcc_lo
1974 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1975 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3c00, v5, vcc_lo
1976 ; GFX11-SDAG-NEXT: v_pack_b32_f16 v1, v1, v2
1977 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
1978 ; GFX11-SDAG-NEXT: v_pk_mul_f16 v0, v0, v1
1979 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1981 ; GFX11-GISEL-LABEL: fmul_select_v2f16_test4:
1982 ; GFX11-GISEL: ; %bb.0:
1983 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1984 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
1985 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
1986 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
1987 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
1988 ; GFX11-GISEL-NEXT: v_lshrrev_b32_e32 v4, 16, v0
1989 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
1990 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v3
1991 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc_lo
1992 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
1993 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
1994 ; GFX11-GISEL-NEXT: v_med3_i32 v2, 0xffff8000, v2, v3
1995 ; GFX11-GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0
1996 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1997 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v1, v4, v2
1998 ; GFX11-GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0
1999 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2000 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
2001 %y = select <2 x i1> %bool, <2 x half> <half 5.000000e-01, half 5.000000e-01>, <2 x half> <half 1.000000e+00, half 1.000000e+00>
2002 %ldexp = fmul <2 x half> %x, %y
2003 ret <2 x half> %ldexp
2006 define half @fmul_select_f16_test5(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2007 ; GFX7-SDAG-LABEL: fmul_select_f16_test5:
2008 ; GFX7-SDAG: ; %bb.0:
2009 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2010 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2011 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2012 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc
2013 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2014 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
2015 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2017 ; GFX7-GISEL-LABEL: fmul_select_f16_test5:
2018 ; GFX7-GISEL: ; %bb.0:
2019 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2020 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2021 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2022 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc
2023 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2024 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2025 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2027 ; GFX9-LABEL: fmul_select_f16_test5:
2029 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2030 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2031 ; GFX9-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc
2032 ; GFX9-NEXT: v_ldexp_f16_e32 v0, v0, v1
2033 ; GFX9-NEXT: s_setpc_b64 s[30:31]
2035 ; GFX10-LABEL: fmul_select_f16_test5:
2037 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2038 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2039 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc_lo
2040 ; GFX10-NEXT: v_ldexp_f16_e32 v0, v0, v1
2041 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2043 ; GFX11-LABEL: fmul_select_f16_test5:
2045 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2046 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2047 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc_lo
2048 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2049 ; GFX11-NEXT: v_ldexp_f16_e32 v0, v0, v1
2050 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2051 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2052 %y = select i1 %bool, half 2.000000e+00, half 8.000000e+00
2053 %ldexp = fmul half %x, %y
2057 define half @fmul_select_f16_test6(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2058 ; GFX7-SDAG-LABEL: fmul_select_f16_test6:
2059 ; GFX7-SDAG: ; %bb.0:
2060 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2061 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2062 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x40400000
2063 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0xc1000000
2064 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2065 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2066 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2067 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2068 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2070 ; GFX7-GISEL-LABEL: fmul_select_f16_test6:
2071 ; GFX7-GISEL: ; %bb.0:
2072 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2073 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0xc800
2074 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0x4200
2075 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2076 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
2077 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2078 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
2079 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
2080 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2081 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2083 ; GFX9-SDAG-LABEL: fmul_select_f16_test6:
2084 ; GFX9-SDAG: ; %bb.0:
2085 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2086 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x4200
2087 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xc800
2088 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2089 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2090 ; GFX9-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2091 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2093 ; GFX9-GISEL-LABEL: fmul_select_f16_test6:
2094 ; GFX9-GISEL: ; %bb.0:
2095 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2096 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xc800
2097 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x4200
2098 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2099 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
2100 ; GFX9-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2101 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2103 ; GFX10-SDAG-LABEL: fmul_select_f16_test6:
2104 ; GFX10-SDAG: ; %bb.0:
2105 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2106 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0xc800
2107 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2108 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4200, v3, vcc_lo
2109 ; GFX10-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2110 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2112 ; GFX10-GISEL-LABEL: fmul_select_f16_test6:
2113 ; GFX10-GISEL: ; %bb.0:
2114 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2115 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x4200
2116 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2117 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc800, vcc_lo
2118 ; GFX10-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2119 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2121 ; GFX11-SDAG-LABEL: fmul_select_f16_test6:
2122 ; GFX11-SDAG: ; %bb.0:
2123 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2124 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v3, 0xc800
2125 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2126 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2127 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4200, v3, vcc_lo
2128 ; GFX11-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2129 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2131 ; GFX11-GISEL-LABEL: fmul_select_f16_test6:
2132 ; GFX11-GISEL: ; %bb.0:
2133 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2134 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x4200
2135 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2136 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2137 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc800, vcc_lo
2138 ; GFX11-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2139 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2140 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2141 %y = select i1 %bool, half -8.000000e+00, half 3.000000e+00
2142 %ldexp = fmul half %x, %y
2146 define half @fmul_select_f16_test7(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2147 ; GFX7-SDAG-LABEL: fmul_select_f16_test7:
2148 ; GFX7-SDAG: ; %bb.0:
2149 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2150 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2151 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x41000000
2152 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2153 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, -4.0, v3, vcc
2154 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2155 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2156 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2158 ; GFX7-GISEL-LABEL: fmul_select_f16_test7:
2159 ; GFX7-GISEL: ; %bb.0:
2160 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2161 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x4800
2162 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0xc400
2163 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2164 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
2165 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2166 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
2167 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
2168 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2169 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2171 ; GFX9-SDAG-LABEL: fmul_select_f16_test7:
2172 ; GFX9-SDAG: ; %bb.0:
2173 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2174 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0xc400
2175 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x4800
2176 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2177 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2178 ; GFX9-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2179 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2181 ; GFX9-GISEL-LABEL: fmul_select_f16_test7:
2182 ; GFX9-GISEL: ; %bb.0:
2183 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2184 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x4800
2185 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xc400
2186 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2187 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
2188 ; GFX9-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2189 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2191 ; GFX10-SDAG-LABEL: fmul_select_f16_test7:
2192 ; GFX10-SDAG: ; %bb.0:
2193 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2194 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x4800
2195 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2196 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xc400, v3, vcc_lo
2197 ; GFX10-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2198 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2200 ; GFX10-GISEL-LABEL: fmul_select_f16_test7:
2201 ; GFX10-GISEL: ; %bb.0:
2202 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2203 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0xc400
2204 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2205 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x4800, vcc_lo
2206 ; GFX10-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2207 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2209 ; GFX11-SDAG-LABEL: fmul_select_f16_test7:
2210 ; GFX11-SDAG: ; %bb.0:
2211 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2212 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v3, 0x4800
2213 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2214 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2215 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xc400, v3, vcc_lo
2216 ; GFX11-SDAG-NEXT: v_mul_f16_e32 v0, v0, v1
2217 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2219 ; GFX11-GISEL-LABEL: fmul_select_f16_test7:
2220 ; GFX11-GISEL: ; %bb.0:
2221 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2222 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0xc400
2223 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2224 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2225 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x4800, vcc_lo
2226 ; GFX11-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
2227 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2228 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2229 %y = select i1 %bool, half 8.000000e+00, half -4.000000e+00
2230 %ldexp = fmul half %x, %y
2234 define half @fmul_select_f16_test8(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2235 ; GFX7-SDAG-LABEL: fmul_select_f16_test8:
2236 ; GFX7-SDAG: ; %bb.0:
2237 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2238 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2239 ; GFX7-SDAG-NEXT: v_bfrev_b32_e32 v3, 1
2240 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2241 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
2242 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2243 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2244 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2246 ; GFX7-GISEL-LABEL: fmul_select_f16_test8:
2247 ; GFX7-GISEL: ; %bb.0:
2248 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2249 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x8000
2250 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2251 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
2252 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2253 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
2254 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
2255 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2256 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2258 ; GFX9-LABEL: fmul_select_f16_test8:
2260 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2261 ; GFX9-NEXT: v_mov_b32_e32 v3, 0x8000
2262 ; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2263 ; GFX9-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
2264 ; GFX9-NEXT: v_mul_f16_e32 v0, v0, v1
2265 ; GFX9-NEXT: s_setpc_b64 s[30:31]
2267 ; GFX10-LABEL: fmul_select_f16_test8:
2269 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2270 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2271 ; GFX10-NEXT: v_cndmask_b32_e64 v1, 0, 0x8000, vcc_lo
2272 ; GFX10-NEXT: v_mul_f16_e32 v0, v0, v1
2273 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2275 ; GFX11-LABEL: fmul_select_f16_test8:
2277 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2278 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2279 ; GFX11-NEXT: v_cndmask_b32_e64 v1, 0, 0x8000, vcc_lo
2280 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2281 ; GFX11-NEXT: v_mul_f16_e32 v0, v0, v1
2282 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2283 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2284 %y = select i1 %bool, half -0.000000e+00, half 0.000000e+00
2285 %ldexp = fmul half %x, %y
2289 define half @fmul_select_f16_test9(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2290 ; GFX7-SDAG-LABEL: fmul_select_f16_test9:
2291 ; GFX7-SDAG: ; %bb.0:
2292 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2293 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e64 v0, -v0
2294 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2295 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 5, 4, vcc
2296 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2297 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
2298 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2300 ; GFX7-GISEL-LABEL: fmul_select_f16_test9:
2301 ; GFX7-GISEL: ; %bb.0:
2302 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2303 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e64 v0, -v0
2304 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2305 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
2306 ; GFX7-GISEL-NEXT: v_add_i32_e32 v1, vcc, 5, v1
2307 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2308 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2309 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2311 ; GFX9-SDAG-LABEL: fmul_select_f16_test9:
2312 ; GFX9-SDAG: ; %bb.0:
2313 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2314 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2315 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, 5, 4, vcc
2316 ; GFX9-SDAG-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2317 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2319 ; GFX9-GISEL-LABEL: fmul_select_f16_test9:
2320 ; GFX9-GISEL: ; %bb.0:
2321 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2322 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2323 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
2324 ; GFX9-GISEL-NEXT: v_add_u32_e32 v1, 5, v1
2325 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
2326 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
2327 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
2328 ; GFX9-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2329 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2331 ; GFX10-SDAG-LABEL: fmul_select_f16_test9:
2332 ; GFX10-SDAG: ; %bb.0:
2333 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2334 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2335 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, 5, 4, vcc_lo
2336 ; GFX10-SDAG-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2337 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2339 ; GFX10-GISEL-LABEL: fmul_select_f16_test9:
2340 ; GFX10-GISEL: ; %bb.0:
2341 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2342 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2343 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2344 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
2345 ; GFX10-GISEL-NEXT: v_add_nc_u32_e32 v1, 5, v1
2346 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2347 ; GFX10-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2348 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2350 ; GFX11-SDAG-LABEL: fmul_select_f16_test9:
2351 ; GFX11-SDAG: ; %bb.0:
2352 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2353 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2354 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, 5, 4, vcc_lo
2355 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2356 ; GFX11-SDAG-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2357 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2359 ; GFX11-GISEL-LABEL: fmul_select_f16_test9:
2360 ; GFX11-GISEL: ; %bb.0:
2361 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2362 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2363 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2364 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
2365 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2366 ; GFX11-GISEL-NEXT: v_add_nc_u32_e32 v1, 5, v1
2367 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2368 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
2369 ; GFX11-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
2370 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2371 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2372 %y = select i1 %bool, half -1.600000e+01, half -3.200000e+01
2373 %ldexp = fmul half %x, %y
2377 define half @fmul_select_f16_test10_sel_log2val_neg11_pos11(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2378 ; GFX7-SDAG-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2379 ; GFX7-SDAG: ; %bb.0:
2380 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2381 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2382 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2383 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc
2384 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2385 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
2386 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2388 ; GFX7-GISEL-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2389 ; GFX7-GISEL: ; %bb.0:
2390 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2391 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2392 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2393 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc
2394 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2395 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2396 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2398 ; GFX9-SDAG-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2399 ; GFX9-SDAG: ; %bb.0:
2400 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2401 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2402 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc
2403 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x8000
2404 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0x7fff
2405 ; GFX9-SDAG-NEXT: v_med3_i32 v1, v1, s4, v2
2406 ; GFX9-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2407 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2409 ; GFX9-GISEL-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2410 ; GFX9-GISEL: ; %bb.0:
2411 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2412 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2413 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc
2414 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2415 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2417 ; GFX10-SDAG-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2418 ; GFX10-SDAG: ; %bb.0:
2419 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2420 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2421 ; GFX10-SDAG-NEXT: s_movk_i32 s4, 0x8000
2422 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc_lo
2423 ; GFX10-SDAG-NEXT: v_med3_i32 v1, v1, s4, 0x7fff
2424 ; GFX10-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2425 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2427 ; GFX10-GISEL-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2428 ; GFX10-GISEL: ; %bb.0:
2429 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2430 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2431 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc_lo
2432 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2433 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2435 ; GFX11-SDAG-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2436 ; GFX11-SDAG: ; %bb.0:
2437 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2438 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2439 ; GFX11-SDAG-NEXT: s_movk_i32 s0, 0x8000
2440 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc_lo
2441 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2442 ; GFX11-SDAG-NEXT: v_med3_i32 v1, v1, s0, 0x7fff
2443 ; GFX11-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2444 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2446 ; GFX11-GISEL-LABEL: fmul_select_f16_test10_sel_log2val_neg11_pos11:
2447 ; GFX11-GISEL: ; %bb.0:
2448 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2449 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2450 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 11, -11, vcc_lo
2451 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
2452 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2453 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2454 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2455 %y = select i1 %bool, half 0xH1000, half 0xH6800
2456 %ldexp = fmul half %x, %y
2460 define half @fmul_select_f16_test11_sel_log2val_pos7_neg14(half %x, i32 %bool.arg1, i32 %bool.arg2) {
2461 ; GFX7-SDAG-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2462 ; GFX7-SDAG: ; %bb.0:
2463 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2464 ; GFX7-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
2465 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2466 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc
2467 ; GFX7-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
2468 ; GFX7-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
2469 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2471 ; GFX7-GISEL-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2472 ; GFX7-GISEL: ; %bb.0:
2473 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2474 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2475 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2476 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc
2477 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2478 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2479 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2481 ; GFX9-SDAG-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2482 ; GFX9-SDAG: ; %bb.0:
2483 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2484 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2485 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc
2486 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x8000
2487 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 0x7fff
2488 ; GFX9-SDAG-NEXT: v_med3_i32 v1, v1, s4, v2
2489 ; GFX9-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2490 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2492 ; GFX9-GISEL-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2493 ; GFX9-GISEL: ; %bb.0:
2494 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2495 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2496 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc
2497 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2498 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2500 ; GFX10-SDAG-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2501 ; GFX10-SDAG: ; %bb.0:
2502 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2503 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2504 ; GFX10-SDAG-NEXT: s_movk_i32 s4, 0x8000
2505 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc_lo
2506 ; GFX10-SDAG-NEXT: v_med3_i32 v1, v1, s4, 0x7fff
2507 ; GFX10-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2508 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2510 ; GFX10-GISEL-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2511 ; GFX10-GISEL: ; %bb.0:
2512 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2513 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2514 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc_lo
2515 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2516 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2518 ; GFX11-SDAG-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2519 ; GFX11-SDAG: ; %bb.0:
2520 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2521 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2522 ; GFX11-SDAG-NEXT: s_movk_i32 s0, 0x8000
2523 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc_lo
2524 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2525 ; GFX11-SDAG-NEXT: v_med3_i32 v1, v1, s0, 0x7fff
2526 ; GFX11-SDAG-NEXT: v_ldexp_f16_e32 v0, v0, v1
2527 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2529 ; GFX11-GISEL-LABEL: fmul_select_f16_test11_sel_log2val_pos7_neg14:
2530 ; GFX11-GISEL: ; %bb.0:
2531 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2532 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2533 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, -14, 7, vcc_lo
2534 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
2535 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2536 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2537 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2538 %y = select i1 %bool, half 0xH5800, half 0xH0400
2539 %ldexp = fmul half %x, %y
2543 define bfloat @fmul_select_bf16_test1(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
2544 ; GFX7-SDAG-LABEL: fmul_select_bf16_test1:
2545 ; GFX7-SDAG: ; %bb.0:
2546 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2547 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
2548 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2549 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 1.0, 2.0, vcc
2550 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2551 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2552 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2553 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2555 ; GFX7-GISEL-LABEL: fmul_select_bf16_test1:
2556 ; GFX7-GISEL: ; %bb.0:
2557 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2558 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2559 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2560 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
2561 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2562 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2563 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2565 ; GFX9-SDAG-LABEL: fmul_select_bf16_test1:
2566 ; GFX9-SDAG: ; %bb.0:
2567 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2568 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x3f80
2569 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x4000
2570 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2571 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2572 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2573 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
2574 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2575 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2576 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
2577 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
2578 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2579 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
2580 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
2581 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2582 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2584 ; GFX9-GISEL-LABEL: fmul_select_bf16_test1:
2585 ; GFX9-GISEL: ; %bb.0:
2586 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2587 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2588 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
2589 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
2590 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
2591 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
2592 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2593 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2595 ; GFX10-SDAG-LABEL: fmul_select_bf16_test1:
2596 ; GFX10-SDAG: ; %bb.0:
2597 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2598 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x4000
2599 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2600 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
2601 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v3, vcc_lo
2602 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2603 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2604 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2605 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2606 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2607 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
2608 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
2609 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2610 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2612 ; GFX10-GISEL-LABEL: fmul_select_bf16_test1:
2613 ; GFX10-GISEL: ; %bb.0:
2614 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2615 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2616 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2617 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
2618 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2619 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2620 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2622 ; GFX11-SDAG-LABEL: fmul_select_bf16_test1:
2623 ; GFX11-SDAG: ; %bb.0:
2624 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2625 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0x4000 :: v_dual_lshlrev_b32 v0, 16, v0
2626 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2627 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2628 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v3, vcc_lo
2629 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2630 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2631 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2632 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2633 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2634 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2635 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
2636 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
2637 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
2638 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2639 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2640 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2642 ; GFX11-GISEL-LABEL: fmul_select_bf16_test1:
2643 ; GFX11-GISEL: ; %bb.0:
2644 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2645 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2646 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2647 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
2648 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2649 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2650 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2651 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2652 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2653 %y = select i1 %bool, bfloat 2.000000e+00, bfloat 1.000000e+00
2654 %ldexp = fmul bfloat %x, %y
2658 define bfloat @fmul_select_bf16_test2(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
2659 ; GFX7-SDAG-LABEL: fmul_select_bf16_test2:
2660 ; GFX7-SDAG: ; %bb.0:
2661 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2662 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
2663 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2664 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 1.0, 0.5, vcc
2665 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2666 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2667 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2668 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2670 ; GFX7-GISEL-LABEL: fmul_select_bf16_test2:
2671 ; GFX7-GISEL: ; %bb.0:
2672 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2673 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2674 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2675 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
2676 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2677 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2678 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2680 ; GFX9-SDAG-LABEL: fmul_select_bf16_test2:
2681 ; GFX9-SDAG: ; %bb.0:
2682 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2683 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x3f80
2684 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x3f00
2685 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2686 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2687 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2688 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
2689 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2690 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2691 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
2692 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
2693 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2694 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
2695 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
2696 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2697 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2699 ; GFX9-GISEL-LABEL: fmul_select_bf16_test2:
2700 ; GFX9-GISEL: ; %bb.0:
2701 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2702 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
2703 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
2704 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
2705 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
2706 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
2707 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2708 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2710 ; GFX10-SDAG-LABEL: fmul_select_bf16_test2:
2711 ; GFX10-SDAG: ; %bb.0:
2712 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2713 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x3f00
2714 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2715 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
2716 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v3, vcc_lo
2717 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2718 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2719 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2720 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2721 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2722 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
2723 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
2724 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2725 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2727 ; GFX10-GISEL-LABEL: fmul_select_bf16_test2:
2728 ; GFX10-GISEL: ; %bb.0:
2729 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2730 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2731 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2732 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
2733 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2734 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2735 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2737 ; GFX11-SDAG-LABEL: fmul_select_bf16_test2:
2738 ; GFX11-SDAG: ; %bb.0:
2739 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2740 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0x3f00 :: v_dual_lshlrev_b32 v0, 16, v0
2741 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2742 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2743 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v3, vcc_lo
2744 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2745 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2746 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
2747 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
2748 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
2749 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2750 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
2751 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
2752 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
2753 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2754 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
2755 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2757 ; GFX11-GISEL-LABEL: fmul_select_bf16_test2:
2758 ; GFX11-GISEL: ; %bb.0:
2759 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2760 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
2761 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2762 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
2763 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2764 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2765 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2766 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2767 %bool = icmp eq i32 %bool.arg1, %bool.arg2
2768 %y = select i1 %bool, bfloat 5.000000e-01, bfloat 1.000000e+00
2769 %ldexp = fmul bfloat %x, %y
2773 define <2 x bfloat> @fmul_select_v2bf16_test3(<2 x bfloat> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
2774 ; GFX7-SDAG-LABEL: fmul_select_v2bf16_test3:
2775 ; GFX7-SDAG: ; %bb.0:
2776 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2777 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2778 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
2779 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, 1.0, v1
2780 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 2.0, vcc
2781 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
2782 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 2.0, vcc
2783 ; GFX7-SDAG-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
2784 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2785 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
2786 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
2787 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2788 ; GFX7-SDAG-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
2789 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2791 ; GFX7-GISEL-LABEL: fmul_select_v2bf16_test3:
2792 ; GFX7-GISEL: ; %bb.0:
2793 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2794 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2795 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
2796 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2797 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, vcc
2798 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
2799 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, 1, vcc
2800 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v2
2801 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
2802 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2803 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
2804 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2806 ; GFX9-SDAG-LABEL: fmul_select_v2bf16_test3:
2807 ; GFX9-SDAG: ; %bb.0:
2808 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2809 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v5, 0x3f80
2810 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x4000
2811 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2812 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v5, v6, vcc
2813 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
2814 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v6, vcc
2815 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
2816 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2817 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
2818 ; GFX9-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2819 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
2820 ; GFX9-SDAG-NEXT: v_bfe_u32 v3, v1, 16, 1
2821 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
2822 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
2823 ; GFX9-SDAG-NEXT: v_add3_u32 v3, v3, v1, s4
2824 ; GFX9-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
2825 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
2826 ; GFX9-SDAG-NEXT: v_bfe_u32 v2, v0, 16, 1
2827 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2828 ; GFX9-SDAG-NEXT: v_add3_u32 v2, v2, v0, s4
2829 ; GFX9-SDAG-NEXT: v_or_b32_e32 v3, 0x400000, v0
2830 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
2831 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
2832 ; GFX9-SDAG-NEXT: s_mov_b32 s4, 0x7060302
2833 ; GFX9-SDAG-NEXT: v_perm_b32 v0, v0, v1, s4
2834 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2836 ; GFX9-GISEL-LABEL: fmul_select_v2bf16_test3:
2837 ; GFX9-GISEL: ; %bb.0:
2838 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2839 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
2840 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
2841 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
2842 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
2843 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
2844 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2845 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2847 ; GFX10-SDAG-LABEL: fmul_select_v2bf16_test3:
2848 ; GFX10-SDAG: ; %bb.0:
2849 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2850 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v5, 0x4000
2851 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
2852 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
2853 ; GFX10-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2854 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v5, vcc_lo
2855 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
2856 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2857 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3f80, v5, vcc_lo
2858 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
2859 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
2860 ; GFX10-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
2861 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
2862 ; GFX10-SDAG-NEXT: v_bfe_u32 v2, v1, 16, 1
2863 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
2864 ; GFX10-SDAG-NEXT: v_bfe_u32 v3, v0, 16, 1
2865 ; GFX10-SDAG-NEXT: v_add3_u32 v2, v2, v1, 0x7fff
2866 ; GFX10-SDAG-NEXT: v_or_b32_e32 v5, 0x400000, v0
2867 ; GFX10-SDAG-NEXT: v_add3_u32 v3, v3, v0, 0x7fff
2868 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v2, v4, vcc_lo
2869 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2870 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v3, v5, vcc_lo
2871 ; GFX10-SDAG-NEXT: v_perm_b32 v0, v0, v1, 0x7060302
2872 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2874 ; GFX10-GISEL-LABEL: fmul_select_v2bf16_test3:
2875 ; GFX10-GISEL: ; %bb.0:
2876 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2877 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
2878 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2879 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
2880 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2881 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2882 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2884 ; GFX11-SDAG-LABEL: fmul_select_v2bf16_test3:
2885 ; GFX11-SDAG: ; %bb.0:
2886 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2887 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v5, 0x4000
2888 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
2889 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
2890 ; GFX11-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2891 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_1)
2892 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v5, vcc_lo
2893 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
2894 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3f80, v5, vcc_lo
2895 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
2896 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2897 ; GFX11-SDAG-NEXT: v_dual_mul_f32 v0, v0, v2 :: v_dual_lshlrev_b32 v1, 16, v1
2898 ; GFX11-SDAG-NEXT: v_or_b32_e32 v5, 0x400000, v0
2899 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
2900 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
2901 ; GFX11-SDAG-NEXT: v_bfe_u32 v3, v0, 16, 1
2902 ; GFX11-SDAG-NEXT: v_bfe_u32 v2, v1, 16, 1
2903 ; GFX11-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
2904 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
2905 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
2906 ; GFX11-SDAG-NEXT: v_add3_u32 v3, v3, v0, 0x7fff
2907 ; GFX11-SDAG-NEXT: v_add3_u32 v2, v2, v1, 0x7fff
2908 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
2909 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, v2, v4, vcc_lo
2910 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
2911 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v3, v5, vcc_lo
2912 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2913 ; GFX11-SDAG-NEXT: v_perm_b32 v0, v0, v1, 0x7060302
2914 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2916 ; GFX11-GISEL-LABEL: fmul_select_v2bf16_test3:
2917 ; GFX11-GISEL: ; %bb.0:
2918 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2919 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
2920 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
2921 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
2922 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2923 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
2924 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
2925 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2926 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
2927 %y = select <2 x i1> %bool, <2 x bfloat> <bfloat 2.000000e+00, bfloat 2.000000e+00>, <2 x bfloat> <bfloat 1.000000e+00, bfloat 1.000000e+00>
2928 %ldexp = fmul <2 x bfloat> %x, %y
2929 ret <2 x bfloat> %ldexp
2932 define <2 x bfloat> @fmul_select_v2bf16_test4(<2 x bfloat> %x, <2 x i32> %bool.arg1, <2 x i32> %bool.arg2) {
2933 ; GFX7-SDAG-LABEL: fmul_select_v2bf16_test4:
2934 ; GFX7-SDAG: ; %bb.0:
2935 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2936 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2937 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
2938 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, 1.0, v1
2939 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v2, 1.0, 0.5, vcc
2940 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
2941 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v3, 1.0, 0.5, vcc
2942 ; GFX7-SDAG-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
2943 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2944 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
2945 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
2946 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2947 ; GFX7-SDAG-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
2948 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
2950 ; GFX7-GISEL-LABEL: fmul_select_v2bf16_test4:
2951 ; GFX7-GISEL: ; %bb.0:
2952 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2953 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
2954 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
2955 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2956 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
2957 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v3, v5
2958 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, -1, vcc
2959 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v2
2960 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
2961 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
2962 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
2963 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
2965 ; GFX9-SDAG-LABEL: fmul_select_v2bf16_test4:
2966 ; GFX9-SDAG: ; %bb.0:
2967 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2968 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v5, 0x3f80
2969 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x3f00
2970 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v2, v4
2971 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, v5, v6, vcc
2972 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
2973 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v6, vcc
2974 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
2975 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
2976 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
2977 ; GFX9-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
2978 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
2979 ; GFX9-SDAG-NEXT: v_bfe_u32 v3, v1, 16, 1
2980 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
2981 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
2982 ; GFX9-SDAG-NEXT: v_add3_u32 v3, v3, v1, s4
2983 ; GFX9-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
2984 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
2985 ; GFX9-SDAG-NEXT: v_bfe_u32 v2, v0, 16, 1
2986 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
2987 ; GFX9-SDAG-NEXT: v_add3_u32 v2, v2, v0, s4
2988 ; GFX9-SDAG-NEXT: v_or_b32_e32 v3, 0x400000, v0
2989 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
2990 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
2991 ; GFX9-SDAG-NEXT: s_mov_b32 s4, 0x7060302
2992 ; GFX9-SDAG-NEXT: v_perm_b32 v0, v0, v1, s4
2993 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2995 ; GFX9-GISEL-LABEL: fmul_select_v2bf16_test4:
2996 ; GFX9-GISEL: ; %bb.0:
2997 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2998 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
2999 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
3000 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
3001 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
3002 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
3003 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3004 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3006 ; GFX10-SDAG-LABEL: fmul_select_v2bf16_test4:
3007 ; GFX10-SDAG: ; %bb.0:
3008 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3009 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v5, 0x3f00
3010 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
3011 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3012 ; GFX10-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3013 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v5, vcc_lo
3014 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
3015 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3016 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3f80, v5, vcc_lo
3017 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
3018 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
3019 ; GFX10-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
3020 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v2
3021 ; GFX10-SDAG-NEXT: v_bfe_u32 v2, v1, 16, 1
3022 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
3023 ; GFX10-SDAG-NEXT: v_bfe_u32 v3, v0, 16, 1
3024 ; GFX10-SDAG-NEXT: v_add3_u32 v2, v2, v1, 0x7fff
3025 ; GFX10-SDAG-NEXT: v_or_b32_e32 v5, 0x400000, v0
3026 ; GFX10-SDAG-NEXT: v_add3_u32 v3, v3, v0, 0x7fff
3027 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, v2, v4, vcc_lo
3028 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3029 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v3, v5, vcc_lo
3030 ; GFX10-SDAG-NEXT: v_perm_b32 v0, v0, v1, 0x7060302
3031 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3033 ; GFX10-GISEL-LABEL: fmul_select_v2bf16_test4:
3034 ; GFX10-GISEL: ; %bb.0:
3035 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3036 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
3037 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
3038 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
3039 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
3040 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3041 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3043 ; GFX11-SDAG-LABEL: fmul_select_v2bf16_test4:
3044 ; GFX11-SDAG: ; %bb.0:
3045 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3046 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v5, 0x3f00
3047 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
3048 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3049 ; GFX11-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3050 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_1)
3051 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x3f80, v5, vcc_lo
3052 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v4
3053 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v2, 0x3f80, v5, vcc_lo
3054 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
3055 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3056 ; GFX11-SDAG-NEXT: v_dual_mul_f32 v0, v0, v2 :: v_dual_lshlrev_b32 v1, 16, v1
3057 ; GFX11-SDAG-NEXT: v_or_b32_e32 v5, 0x400000, v0
3058 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
3059 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v1, v3, v1
3060 ; GFX11-SDAG-NEXT: v_bfe_u32 v3, v0, 16, 1
3061 ; GFX11-SDAG-NEXT: v_bfe_u32 v2, v1, 16, 1
3062 ; GFX11-SDAG-NEXT: v_or_b32_e32 v4, 0x400000, v1
3063 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
3064 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
3065 ; GFX11-SDAG-NEXT: v_add3_u32 v3, v3, v0, 0x7fff
3066 ; GFX11-SDAG-NEXT: v_add3_u32 v2, v2, v1, 0x7fff
3067 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
3068 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, v2, v4, vcc_lo
3069 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3070 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v3, v5, vcc_lo
3071 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3072 ; GFX11-SDAG-NEXT: v_perm_b32 v0, v0, v1, 0x7060302
3073 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3075 ; GFX11-GISEL-LABEL: fmul_select_v2bf16_test4:
3076 ; GFX11-GISEL: ; %bb.0:
3077 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3078 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v3
3079 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
3080 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
3081 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3082 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
3083 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3084 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3085 %bool = icmp eq <2 x i32> %bool.arg1, %bool.arg2
3086 %y = select <2 x i1> %bool, <2 x bfloat> <bfloat 5.000000e-01, bfloat 5.000000e-01>, <2 x bfloat> <bfloat 1.000000e+00, bfloat 1.000000e+00>
3087 %ldexp = fmul <2 x bfloat> %x, %y
3088 ret <2 x bfloat> %ldexp
3091 define bfloat @fmul_select_bf16_test5(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3092 ; GFX7-SDAG-LABEL: fmul_select_bf16_test5:
3093 ; GFX7-SDAG: ; %bb.0:
3094 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3095 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3096 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x41000000
3097 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3098 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, v3, 2.0, vcc
3099 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3100 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3101 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3102 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3104 ; GFX7-GISEL-LABEL: fmul_select_bf16_test5:
3105 ; GFX7-GISEL: ; %bb.0:
3106 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3107 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
3108 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3109 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc
3110 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
3111 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3112 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3114 ; GFX9-SDAG-LABEL: fmul_select_bf16_test5:
3115 ; GFX9-SDAG: ; %bb.0:
3116 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3117 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x4100
3118 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x4000
3119 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3120 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3121 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3122 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3123 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3124 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3125 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3126 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3127 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3128 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3129 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3130 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3131 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3133 ; GFX9-GISEL-LABEL: fmul_select_bf16_test5:
3134 ; GFX9-GISEL: ; %bb.0:
3135 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3136 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3137 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc
3138 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3139 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3141 ; GFX10-SDAG-LABEL: fmul_select_bf16_test5:
3142 ; GFX10-SDAG: ; %bb.0:
3143 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3144 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x4000
3145 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3146 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3147 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4100, v3, vcc_lo
3148 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3149 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3150 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3151 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3152 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3153 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3154 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3155 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3156 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3158 ; GFX10-GISEL-LABEL: fmul_select_bf16_test5:
3159 ; GFX10-GISEL: ; %bb.0:
3160 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3161 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3162 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc_lo
3163 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3164 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3166 ; GFX11-SDAG-LABEL: fmul_select_bf16_test5:
3167 ; GFX11-SDAG: ; %bb.0:
3168 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3169 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0x4000 :: v_dual_lshlrev_b32 v0, 16, v0
3170 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3171 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3172 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4100, v3, vcc_lo
3173 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3174 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3175 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3176 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3177 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3178 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3179 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3180 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3181 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3182 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3183 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3184 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3186 ; GFX11-GISEL-LABEL: fmul_select_bf16_test5:
3187 ; GFX11-GISEL: ; %bb.0:
3188 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3189 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3190 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 3, 1, vcc_lo
3191 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
3192 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3193 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3194 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3195 %y = select i1 %bool, bfloat 2.000000e+00, bfloat 8.000000e+00
3196 %ldexp = fmul bfloat %x, %y
3200 define bfloat @fmul_select_bf16_test6(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3201 ; GFX7-SDAG-LABEL: fmul_select_bf16_test6:
3202 ; GFX7-SDAG: ; %bb.0:
3203 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3204 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3205 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x40400000
3206 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0xc1000000
3207 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3208 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3209 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3210 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3211 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3212 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3214 ; GFX7-GISEL-LABEL: fmul_select_bf16_test6:
3215 ; GFX7-GISEL: ; %bb.0:
3216 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3217 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0xc100
3218 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0x4040
3219 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3220 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
3221 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
3222 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
3223 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
3224 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3225 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3227 ; GFX9-SDAG-LABEL: fmul_select_bf16_test6:
3228 ; GFX9-SDAG: ; %bb.0:
3229 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3230 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x4040
3231 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xffffc100
3232 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3233 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3234 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3235 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3236 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3237 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3238 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3239 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3240 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3241 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3242 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3243 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3244 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3246 ; GFX9-GISEL-LABEL: fmul_select_bf16_test6:
3247 ; GFX9-GISEL: ; %bb.0:
3248 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3249 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xc100
3250 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0x4040
3251 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3252 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
3253 ; GFX9-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3254 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3256 ; GFX10-SDAG-LABEL: fmul_select_bf16_test6:
3257 ; GFX10-SDAG: ; %bb.0:
3258 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3259 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffc100
3260 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3261 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3262 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4040, v3, vcc_lo
3263 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3264 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3265 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3266 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3267 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3268 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3269 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3270 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3271 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3273 ; GFX10-GISEL-LABEL: fmul_select_bf16_test6:
3274 ; GFX10-GISEL: ; %bb.0:
3275 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3276 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0x4040
3277 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3278 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc100, vcc_lo
3279 ; GFX10-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3280 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3282 ; GFX11-SDAG-LABEL: fmul_select_bf16_test6:
3283 ; GFX11-SDAG: ; %bb.0:
3284 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3285 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0xffffc100 :: v_dual_lshlrev_b32 v0, 16, v0
3286 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3287 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3288 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4040, v3, vcc_lo
3289 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3290 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3291 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3292 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3293 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3294 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3295 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3296 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3297 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3298 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3299 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3300 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3302 ; GFX11-GISEL-LABEL: fmul_select_bf16_test6:
3303 ; GFX11-GISEL: ; %bb.0:
3304 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3305 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0x4040
3306 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3307 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3308 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0xc100, vcc_lo
3309 ; GFX11-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3310 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3311 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3312 %y = select i1 %bool, bfloat -8.000000e+00, bfloat 3.000000e+00
3313 %ldexp = fmul bfloat %x, %y
3317 define bfloat @fmul_select_bf16_test7(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3318 ; GFX7-SDAG-LABEL: fmul_select_bf16_test7:
3319 ; GFX7-SDAG: ; %bb.0:
3320 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3321 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3322 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0x41000000
3323 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3324 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, -4.0, v3, vcc
3325 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3326 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3327 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3328 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3330 ; GFX7-GISEL-LABEL: fmul_select_bf16_test7:
3331 ; GFX7-GISEL: ; %bb.0:
3332 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3333 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x4100
3334 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v4, 0xc080
3335 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3336 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
3337 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
3338 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
3339 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
3340 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3341 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3343 ; GFX9-SDAG-LABEL: fmul_select_bf16_test7:
3344 ; GFX9-SDAG: ; %bb.0:
3345 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3346 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffc080
3347 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x4100
3348 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3349 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3350 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3351 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3352 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3353 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3354 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3355 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3356 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3357 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3358 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3359 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3360 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3362 ; GFX9-GISEL-LABEL: fmul_select_bf16_test7:
3363 ; GFX9-GISEL: ; %bb.0:
3364 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3365 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x4100
3366 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0xc080
3367 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3368 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, v4, v3, vcc
3369 ; GFX9-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3370 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3372 ; GFX10-SDAG-LABEL: fmul_select_bf16_test7:
3373 ; GFX10-SDAG: ; %bb.0:
3374 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3375 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x4100
3376 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3377 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3378 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffc080, v3, vcc_lo
3379 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3380 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3381 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3382 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3383 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3384 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3385 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3386 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3387 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3389 ; GFX10-GISEL-LABEL: fmul_select_bf16_test7:
3390 ; GFX10-GISEL: ; %bb.0:
3391 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3392 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, 0xc080
3393 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3394 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x4100, vcc_lo
3395 ; GFX10-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3396 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3398 ; GFX11-SDAG-LABEL: fmul_select_bf16_test7:
3399 ; GFX11-SDAG: ; %bb.0:
3400 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3401 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0x4100 :: v_dual_lshlrev_b32 v0, 16, v0
3402 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3403 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3404 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffc080, v3, vcc_lo
3405 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3406 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3407 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3408 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3409 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3410 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3411 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3412 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3413 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3414 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3415 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3416 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3418 ; GFX11-GISEL-LABEL: fmul_select_bf16_test7:
3419 ; GFX11-GISEL: ; %bb.0:
3420 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3421 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v3, 0xc080
3422 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3423 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3424 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, v3, 0x4100, vcc_lo
3425 ; GFX11-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3426 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3427 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3428 %y = select i1 %bool, bfloat 8.000000e+00, bfloat -4.000000e+00
3429 %ldexp = fmul bfloat %x, %y
3433 define bfloat @fmul_select_bf16_test8(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3434 ; GFX7-SDAG-LABEL: fmul_select_bf16_test8:
3435 ; GFX7-SDAG: ; %bb.0:
3436 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3437 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3438 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3439 ; GFX7-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
3440 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3441 ; GFX7-SDAG-NEXT: v_lshlrev_b32_e32 v1, 31, v1
3442 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3443 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3444 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3446 ; GFX7-GISEL-LABEL: fmul_select_bf16_test8:
3447 ; GFX7-GISEL: ; %bb.0:
3448 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3449 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x8000
3450 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3451 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
3452 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
3453 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
3454 ; GFX7-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
3455 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3456 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3458 ; GFX9-SDAG-LABEL: fmul_select_bf16_test8:
3459 ; GFX9-SDAG: ; %bb.0:
3460 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3461 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3462 ; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc
3463 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, 15
3464 ; GFX9-SDAG-NEXT: v_lshlrev_b16_sdwa v1, v2, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3465 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3466 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3467 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3468 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3469 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3470 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3471 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3472 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3473 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3474 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3476 ; GFX9-GISEL-LABEL: fmul_select_bf16_test8:
3477 ; GFX9-GISEL: ; %bb.0:
3478 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3479 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x8000
3480 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3481 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
3482 ; GFX9-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3483 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3485 ; GFX10-SDAG-LABEL: fmul_select_bf16_test8:
3486 ; GFX10-SDAG: ; %bb.0:
3487 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3488 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3489 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3490 ; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
3491 ; GFX10-SDAG-NEXT: v_lshlrev_b16 v1, 15, v1
3492 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3493 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3494 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3495 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3496 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3497 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3498 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3499 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3500 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3502 ; GFX10-GISEL-LABEL: fmul_select_bf16_test8:
3503 ; GFX10-GISEL: ; %bb.0:
3504 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3505 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3506 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 0x8000, vcc_lo
3507 ; GFX10-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3508 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3510 ; GFX11-SDAG-LABEL: fmul_select_bf16_test8:
3511 ; GFX11-SDAG: ; %bb.0:
3512 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3513 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3514 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3515 ; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo
3516 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3517 ; GFX11-SDAG-NEXT: v_lshlrev_b16 v1, 15, v1
3518 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3519 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3520 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3521 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3522 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3523 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3524 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3525 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3526 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3527 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3528 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3529 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3531 ; GFX11-GISEL-LABEL: fmul_select_bf16_test8:
3532 ; GFX11-GISEL: ; %bb.0:
3533 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3534 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3535 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, 0x8000, vcc_lo
3536 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
3537 ; GFX11-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
3538 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3539 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3540 %y = select i1 %bool, bfloat -0.000000e+00, bfloat 0.000000e+00
3541 %ldexp = fmul bfloat %x, %y
3545 define bfloat @fmul_select_bf16_test9(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3546 ; GFX7-SDAG-LABEL: fmul_select_bf16_test9:
3547 ; GFX7-SDAG: ; %bb.0:
3548 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3549 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3550 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0xc2000000
3551 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0xc1800000
3552 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3553 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3554 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3555 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3556 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3557 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3559 ; GFX7-GISEL-LABEL: fmul_select_bf16_test9:
3560 ; GFX7-GISEL: ; %bb.0:
3561 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3562 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e64 v0, -v0
3563 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3564 ; GFX7-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
3565 ; GFX7-GISEL-NEXT: v_add_i32_e32 v1, vcc, 5, v1
3566 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
3567 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3568 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3570 ; GFX9-SDAG-LABEL: fmul_select_bf16_test9:
3571 ; GFX9-SDAG: ; %bb.0:
3572 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3573 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffc200
3574 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xffffc180
3575 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3576 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3577 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3578 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3579 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3580 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3581 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3582 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3583 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3584 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3585 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3586 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3587 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3589 ; GFX9-GISEL-LABEL: fmul_select_bf16_test9:
3590 ; GFX9-GISEL: ; %bb.0:
3591 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3592 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3593 ; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc
3594 ; GFX9-GISEL-NEXT: v_add_u32_e32 v1, 5, v1
3595 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0xffff8000
3596 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x7fff
3597 ; GFX9-GISEL-NEXT: v_med3_i32 v1, v1, v2, v3
3598 ; GFX9-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3599 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3601 ; GFX10-SDAG-LABEL: fmul_select_bf16_test9:
3602 ; GFX10-SDAG: ; %bb.0:
3603 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3604 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffc180
3605 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3606 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3607 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffc200, v3, vcc_lo
3608 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3609 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3610 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3611 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3612 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3613 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3614 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3615 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3616 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3618 ; GFX10-GISEL-LABEL: fmul_select_bf16_test9:
3619 ; GFX10-GISEL: ; %bb.0:
3620 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3621 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3622 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
3623 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
3624 ; GFX10-GISEL-NEXT: v_add_nc_u32_e32 v1, 5, v1
3625 ; GFX10-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
3626 ; GFX10-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3627 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3629 ; GFX11-SDAG-LABEL: fmul_select_bf16_test9:
3630 ; GFX11-SDAG: ; %bb.0:
3631 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3632 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0xffffc180 :: v_dual_lshlrev_b32 v0, 16, v0
3633 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3634 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3635 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffc200, v3, vcc_lo
3636 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3637 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3638 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3639 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3640 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3641 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3642 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3643 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3644 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3645 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3646 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3647 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3649 ; GFX11-GISEL-LABEL: fmul_select_bf16_test9:
3650 ; GFX11-GISEL: ; %bb.0:
3651 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3652 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3653 ; GFX11-GISEL-NEXT: v_mov_b32_e32 v2, 0x7fff
3654 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 0, -1, vcc_lo
3655 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3656 ; GFX11-GISEL-NEXT: v_add_nc_u32_e32 v1, 5, v1
3657 ; GFX11-GISEL-NEXT: v_med3_i32 v1, 0xffff8000, v1, v2
3658 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
3659 ; GFX11-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3660 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3661 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3662 %y = select i1 %bool, bfloat -1.600000e+01, bfloat -3.200000e+01
3663 %ldexp = fmul bfloat %x, %y
3667 define bfloat @fmul_select_bf16_test10_sel_log2val_pos65_pos56(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3668 ; GFX7-SDAG-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3669 ; GFX7-SDAG: ; %bb.0:
3670 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3671 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3672 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v3, 0xdb800000
3673 ; GFX7-SDAG-NEXT: v_bfrev_b32_e32 v4, 7
3674 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3675 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3676 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3677 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3678 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3679 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3681 ; GFX7-GISEL-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3682 ; GFX7-GISEL: ; %bb.0:
3683 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3684 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e64 v0, -v0
3685 ; GFX7-GISEL-NEXT: v_mov_b32_e32 v3, 0x41
3686 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3687 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, 56, v3, vcc
3688 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
3689 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3690 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3692 ; GFX9-SDAG-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3693 ; GFX9-SDAG: ; %bb.0:
3694 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3695 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffdb80
3696 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0xffffe000
3697 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3698 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3699 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3700 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3701 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3702 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3703 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3704 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3705 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3706 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3707 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3708 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3709 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3711 ; GFX9-GISEL-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3712 ; GFX9-GISEL: ; %bb.0:
3713 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3714 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x41
3715 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3716 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, 56, v3, vcc
3717 ; GFX9-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3718 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3720 ; GFX10-SDAG-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3721 ; GFX10-SDAG: ; %bb.0:
3722 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3723 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0xffffe000
3724 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3725 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3726 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffdb80, v3, vcc_lo
3727 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3728 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3729 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3730 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3731 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3732 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3733 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3734 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3735 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3737 ; GFX10-GISEL-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3738 ; GFX10-GISEL: ; %bb.0:
3739 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3740 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3741 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 56, 0x41, vcc_lo
3742 ; GFX10-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3743 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3745 ; GFX11-SDAG-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3746 ; GFX11-SDAG: ; %bb.0:
3747 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3748 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0xffffe000 :: v_dual_lshlrev_b32 v0, 16, v0
3749 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3750 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3751 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0xffffdb80, v3, vcc_lo
3752 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3753 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3754 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3755 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3756 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3757 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3758 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3759 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3760 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3761 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3762 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3763 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3765 ; GFX11-GISEL-LABEL: fmul_select_bf16_test10_sel_log2val_pos65_pos56:
3766 ; GFX11-GISEL: ; %bb.0:
3767 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3768 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3769 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 56, 0x41, vcc_lo
3770 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
3771 ; GFX11-GISEL-NEXT: v_ldexp_f16_e64 v0, -v0, v1
3772 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3773 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3774 %y = select i1 %bool, bfloat 0xRE000, bfloat 0xRDB80
3775 %ldexp = fmul bfloat %x, %y
3779 define bfloat @fmul_select_bf16_test11_sel_log2val_neg22_pos25(bfloat %x, i32 %bool.arg1, i32 %bool.arg2) {
3780 ; GFX7-SDAG-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3781 ; GFX7-SDAG: ; %bb.0:
3782 ; GFX7-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3783 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, 1.0, v0
3784 ; GFX7-SDAG-NEXT: v_bfrev_b32_e32 v3, 50
3785 ; GFX7-SDAG-NEXT: v_mov_b32_e32 v4, 0x34800000
3786 ; GFX7-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3787 ; GFX7-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3788 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3789 ; GFX7-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3790 ; GFX7-SDAG-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
3791 ; GFX7-SDAG-NEXT: s_setpc_b64 s[30:31]
3793 ; GFX7-GISEL-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3794 ; GFX7-GISEL: ; %bb.0:
3795 ; GFX7-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3796 ; GFX7-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
3797 ; GFX7-GISEL-NEXT: v_not_b32_e32 v3, 21
3798 ; GFX7-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3799 ; GFX7-GISEL-NEXT: v_cndmask_b32_e32 v1, 25, v3, vcc
3800 ; GFX7-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
3801 ; GFX7-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
3802 ; GFX7-GISEL-NEXT: s_setpc_b64 s[30:31]
3804 ; GFX9-SDAG-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3805 ; GFX9-SDAG: ; %bb.0:
3806 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3807 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x4c00
3808 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v4, 0x3480
3809 ; GFX9-SDAG-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3810 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, v3, v4, vcc
3811 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3812 ; GFX9-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3813 ; GFX9-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3814 ; GFX9-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3815 ; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff
3816 ; GFX9-SDAG-NEXT: v_add3_u32 v1, v1, v0, s4
3817 ; GFX9-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3818 ; GFX9-SDAG-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3819 ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc
3820 ; GFX9-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3821 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
3823 ; GFX9-GISEL-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3824 ; GFX9-GISEL: ; %bb.0:
3825 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3826 ; GFX9-GISEL-NEXT: v_not_b32_e32 v3, 21
3827 ; GFX9-GISEL-NEXT: v_cmp_eq_u32_e32 vcc, v1, v2
3828 ; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v1, 25, v3, vcc
3829 ; GFX9-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3830 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
3832 ; GFX10-SDAG-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3833 ; GFX10-SDAG: ; %bb.0:
3834 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3835 ; GFX10-SDAG-NEXT: v_mov_b32_e32 v3, 0x3480
3836 ; GFX10-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3837 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3838 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4c00, v3, vcc_lo
3839 ; GFX10-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3840 ; GFX10-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3841 ; GFX10-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3842 ; GFX10-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3843 ; GFX10-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3844 ; GFX10-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3845 ; GFX10-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3846 ; GFX10-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3847 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
3849 ; GFX10-GISEL-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3850 ; GFX10-GISEL: ; %bb.0:
3851 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3852 ; GFX10-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3853 ; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v1, 25, 0xffffffea, vcc_lo
3854 ; GFX10-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3855 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
3857 ; GFX11-SDAG-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3858 ; GFX11-SDAG: ; %bb.0:
3859 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3860 ; GFX11-SDAG-NEXT: v_dual_mov_b32 v3, 0x3480 :: v_dual_lshlrev_b32 v0, 16, v0
3861 ; GFX11-SDAG-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3862 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
3863 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 0x4c00, v3, vcc_lo
3864 ; GFX11-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
3865 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3866 ; GFX11-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
3867 ; GFX11-SDAG-NEXT: v_bfe_u32 v1, v0, 16, 1
3868 ; GFX11-SDAG-NEXT: v_or_b32_e32 v2, 0x400000, v0
3869 ; GFX11-SDAG-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3870 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3871 ; GFX11-SDAG-NEXT: v_add3_u32 v1, v1, v0, 0x7fff
3872 ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v0, v1, v2, vcc_lo
3873 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3874 ; GFX11-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3875 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
3877 ; GFX11-GISEL-LABEL: fmul_select_bf16_test11_sel_log2val_neg22_pos25:
3878 ; GFX11-GISEL: ; %bb.0:
3879 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3880 ; GFX11-GISEL-NEXT: v_cmp_eq_u32_e32 vcc_lo, v1, v2
3881 ; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v1, 25, 0xffffffea, vcc_lo
3882 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
3883 ; GFX11-GISEL-NEXT: v_ldexp_f16_e32 v0, v0, v1
3884 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
3885 %bool = icmp eq i32 %bool.arg1, %bool.arg2
3886 %y = select i1 %bool, bfloat 0xR3480, bfloat 0xR4C00
3887 %ldexp = fmul bfloat %x, %y