1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-- -mcpu=tahiti < %s | FileCheck -check-prefix=SI %s
3 ; RUN: llc -mtriple=amdgcn-- -mcpu=fiji < %s | FileCheck -check-prefix=VI %s
5 define amdgpu_kernel void @test_fmin_legacy_uge_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
6 ; SI-LABEL: test_fmin_legacy_uge_f64:
8 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
9 ; SI-NEXT: s_mov_b32 s7, 0xf000
10 ; SI-NEXT: s_mov_b32 s10, 0
11 ; SI-NEXT: s_mov_b32 s11, s7
12 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
13 ; SI-NEXT: s_waitcnt lgkmcnt(0)
14 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
15 ; SI-NEXT: v_mov_b32_e32 v1, 0
16 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
17 ; SI-NEXT: s_mov_b32 s6, -1
18 ; SI-NEXT: s_mov_b32 s4, s0
19 ; SI-NEXT: s_mov_b32 s5, s1
20 ; SI-NEXT: s_waitcnt vmcnt(0)
21 ; SI-NEXT: v_cmp_nlt_f64_e32 vcc, v[0:1], v[2:3]
22 ; SI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
23 ; SI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
24 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
27 ; VI-LABEL: test_fmin_legacy_uge_f64:
29 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
30 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
31 ; VI-NEXT: s_waitcnt lgkmcnt(0)
32 ; VI-NEXT: v_mov_b32_e32 v1, s3
33 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
34 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
35 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
36 ; VI-NEXT: v_mov_b32_e32 v4, s0
37 ; VI-NEXT: v_mov_b32_e32 v5, s1
38 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
39 ; VI-NEXT: v_cmp_nlt_f64_e32 vcc, v[0:1], v[2:3]
40 ; VI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
41 ; VI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
42 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
44 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
45 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
46 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
48 %a = load double, double addrspace(1)* %gep.0, align 8
49 %b = load double, double addrspace(1)* %gep.1, align 8
51 %cmp = fcmp uge double %a, %b
52 %val = select i1 %cmp, double %b, double %a
53 store double %val, double addrspace(1)* %out, align 8
57 define amdgpu_kernel void @test_fmin_legacy_ugt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
58 ; SI-LABEL: test_fmin_legacy_ugt_f64:
60 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
61 ; SI-NEXT: s_mov_b32 s7, 0xf000
62 ; SI-NEXT: s_mov_b32 s10, 0
63 ; SI-NEXT: s_mov_b32 s11, s7
64 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
65 ; SI-NEXT: s_waitcnt lgkmcnt(0)
66 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
67 ; SI-NEXT: v_mov_b32_e32 v1, 0
68 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
69 ; SI-NEXT: s_mov_b32 s6, -1
70 ; SI-NEXT: s_mov_b32 s4, s0
71 ; SI-NEXT: s_mov_b32 s5, s1
72 ; SI-NEXT: s_waitcnt vmcnt(0)
73 ; SI-NEXT: v_cmp_nle_f64_e32 vcc, v[0:1], v[2:3]
74 ; SI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
75 ; SI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
76 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
79 ; VI-LABEL: test_fmin_legacy_ugt_f64:
81 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
82 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
83 ; VI-NEXT: s_waitcnt lgkmcnt(0)
84 ; VI-NEXT: v_mov_b32_e32 v1, s3
85 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
86 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
87 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
88 ; VI-NEXT: v_mov_b32_e32 v4, s0
89 ; VI-NEXT: v_mov_b32_e32 v5, s1
90 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
91 ; VI-NEXT: v_cmp_nle_f64_e32 vcc, v[0:1], v[2:3]
92 ; VI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
93 ; VI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
94 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
96 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
97 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
98 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
100 %a = load double, double addrspace(1)* %gep.0, align 8
101 %b = load double, double addrspace(1)* %gep.1, align 8
103 %cmp = fcmp ugt double %a, %b
104 %val = select i1 %cmp, double %b, double %a
105 store double %val, double addrspace(1)* %out, align 8
109 define amdgpu_kernel void @test_fmin_legacy_ule_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
110 ; SI-LABEL: test_fmin_legacy_ule_f64:
112 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
113 ; SI-NEXT: s_mov_b32 s7, 0xf000
114 ; SI-NEXT: s_mov_b32 s10, 0
115 ; SI-NEXT: s_mov_b32 s11, s7
116 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
117 ; SI-NEXT: s_waitcnt lgkmcnt(0)
118 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
119 ; SI-NEXT: v_mov_b32_e32 v1, 0
120 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
121 ; SI-NEXT: s_mov_b32 s6, -1
122 ; SI-NEXT: s_mov_b32 s4, s0
123 ; SI-NEXT: s_mov_b32 s5, s1
124 ; SI-NEXT: s_waitcnt vmcnt(0)
125 ; SI-NEXT: v_cmp_ngt_f64_e32 vcc, v[0:1], v[2:3]
126 ; SI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
127 ; SI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
128 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
131 ; VI-LABEL: test_fmin_legacy_ule_f64:
133 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
134 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
135 ; VI-NEXT: s_waitcnt lgkmcnt(0)
136 ; VI-NEXT: v_mov_b32_e32 v1, s3
137 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
138 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
139 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
140 ; VI-NEXT: v_mov_b32_e32 v4, s0
141 ; VI-NEXT: v_mov_b32_e32 v5, s1
142 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
143 ; VI-NEXT: v_cmp_ngt_f64_e32 vcc, v[0:1], v[2:3]
144 ; VI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
145 ; VI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
146 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
148 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
149 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
150 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
152 %a = load double, double addrspace(1)* %gep.0, align 8
153 %b = load double, double addrspace(1)* %gep.1, align 8
155 %cmp = fcmp ule double %a, %b
156 %val = select i1 %cmp, double %a, double %b
157 store double %val, double addrspace(1)* %out, align 8
161 define amdgpu_kernel void @test_fmin_legacy_ult_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
162 ; SI-LABEL: test_fmin_legacy_ult_f64:
164 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
165 ; SI-NEXT: s_mov_b32 s7, 0xf000
166 ; SI-NEXT: s_mov_b32 s10, 0
167 ; SI-NEXT: s_mov_b32 s11, s7
168 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
169 ; SI-NEXT: s_waitcnt lgkmcnt(0)
170 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
171 ; SI-NEXT: v_mov_b32_e32 v1, 0
172 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
173 ; SI-NEXT: s_mov_b32 s6, -1
174 ; SI-NEXT: s_mov_b32 s4, s0
175 ; SI-NEXT: s_mov_b32 s5, s1
176 ; SI-NEXT: s_waitcnt vmcnt(0)
177 ; SI-NEXT: v_cmp_nge_f64_e32 vcc, v[0:1], v[2:3]
178 ; SI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
179 ; SI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
180 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
183 ; VI-LABEL: test_fmin_legacy_ult_f64:
185 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
186 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
187 ; VI-NEXT: s_waitcnt lgkmcnt(0)
188 ; VI-NEXT: v_mov_b32_e32 v1, s3
189 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
190 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
191 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
192 ; VI-NEXT: v_mov_b32_e32 v4, s0
193 ; VI-NEXT: v_mov_b32_e32 v5, s1
194 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
195 ; VI-NEXT: v_cmp_nge_f64_e32 vcc, v[0:1], v[2:3]
196 ; VI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
197 ; VI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
198 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
200 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
201 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
202 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
204 %a = load double, double addrspace(1)* %gep.0, align 8
205 %b = load double, double addrspace(1)* %gep.1, align 8
207 %cmp = fcmp ult double %a, %b
208 %val = select i1 %cmp, double %a, double %b
209 store double %val, double addrspace(1)* %out, align 8
213 define amdgpu_kernel void @test_fmin_legacy_oge_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
214 ; SI-LABEL: test_fmin_legacy_oge_f64:
216 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
217 ; SI-NEXT: s_mov_b32 s7, 0xf000
218 ; SI-NEXT: s_mov_b32 s10, 0
219 ; SI-NEXT: s_mov_b32 s11, s7
220 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
221 ; SI-NEXT: s_waitcnt lgkmcnt(0)
222 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
223 ; SI-NEXT: v_mov_b32_e32 v1, 0
224 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
225 ; SI-NEXT: s_mov_b32 s6, -1
226 ; SI-NEXT: s_mov_b32 s4, s0
227 ; SI-NEXT: s_mov_b32 s5, s1
228 ; SI-NEXT: s_waitcnt vmcnt(0)
229 ; SI-NEXT: v_cmp_ge_f64_e32 vcc, v[0:1], v[2:3]
230 ; SI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
231 ; SI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
232 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
235 ; VI-LABEL: test_fmin_legacy_oge_f64:
237 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
238 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
239 ; VI-NEXT: s_waitcnt lgkmcnt(0)
240 ; VI-NEXT: v_mov_b32_e32 v1, s3
241 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
242 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
243 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
244 ; VI-NEXT: v_mov_b32_e32 v4, s0
245 ; VI-NEXT: v_mov_b32_e32 v5, s1
246 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
247 ; VI-NEXT: v_cmp_ge_f64_e32 vcc, v[0:1], v[2:3]
248 ; VI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
249 ; VI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
250 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
252 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
253 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
254 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
256 %a = load double, double addrspace(1)* %gep.0, align 8
257 %b = load double, double addrspace(1)* %gep.1, align 8
259 %cmp = fcmp oge double %a, %b
260 %val = select i1 %cmp, double %b, double %a
261 store double %val, double addrspace(1)* %out, align 8
265 define amdgpu_kernel void @test_fmin_legacy_ogt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
266 ; SI-LABEL: test_fmin_legacy_ogt_f64:
268 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
269 ; SI-NEXT: s_mov_b32 s7, 0xf000
270 ; SI-NEXT: s_mov_b32 s10, 0
271 ; SI-NEXT: s_mov_b32 s11, s7
272 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
273 ; SI-NEXT: s_waitcnt lgkmcnt(0)
274 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
275 ; SI-NEXT: v_mov_b32_e32 v1, 0
276 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
277 ; SI-NEXT: s_mov_b32 s6, -1
278 ; SI-NEXT: s_mov_b32 s4, s0
279 ; SI-NEXT: s_mov_b32 s5, s1
280 ; SI-NEXT: s_waitcnt vmcnt(0)
281 ; SI-NEXT: v_cmp_gt_f64_e32 vcc, v[0:1], v[2:3]
282 ; SI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
283 ; SI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
284 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
287 ; VI-LABEL: test_fmin_legacy_ogt_f64:
289 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
290 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
291 ; VI-NEXT: s_waitcnt lgkmcnt(0)
292 ; VI-NEXT: v_mov_b32_e32 v1, s3
293 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
294 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
295 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
296 ; VI-NEXT: v_mov_b32_e32 v4, s0
297 ; VI-NEXT: v_mov_b32_e32 v5, s1
298 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
299 ; VI-NEXT: v_cmp_gt_f64_e32 vcc, v[0:1], v[2:3]
300 ; VI-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
301 ; VI-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
302 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
304 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
305 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
306 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
308 %a = load double, double addrspace(1)* %gep.0, align 8
309 %b = load double, double addrspace(1)* %gep.1, align 8
311 %cmp = fcmp ogt double %a, %b
312 %val = select i1 %cmp, double %b, double %a
313 store double %val, double addrspace(1)* %out, align 8
317 define amdgpu_kernel void @test_fmin_legacy_ole_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
318 ; SI-LABEL: test_fmin_legacy_ole_f64:
320 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
321 ; SI-NEXT: s_mov_b32 s7, 0xf000
322 ; SI-NEXT: s_mov_b32 s10, 0
323 ; SI-NEXT: s_mov_b32 s11, s7
324 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
325 ; SI-NEXT: s_waitcnt lgkmcnt(0)
326 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
327 ; SI-NEXT: v_mov_b32_e32 v1, 0
328 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
329 ; SI-NEXT: s_mov_b32 s6, -1
330 ; SI-NEXT: s_mov_b32 s4, s0
331 ; SI-NEXT: s_mov_b32 s5, s1
332 ; SI-NEXT: s_waitcnt vmcnt(0)
333 ; SI-NEXT: v_cmp_le_f64_e32 vcc, v[0:1], v[2:3]
334 ; SI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
335 ; SI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
336 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
339 ; VI-LABEL: test_fmin_legacy_ole_f64:
341 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
342 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
343 ; VI-NEXT: s_waitcnt lgkmcnt(0)
344 ; VI-NEXT: v_mov_b32_e32 v1, s3
345 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
346 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
347 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
348 ; VI-NEXT: v_mov_b32_e32 v4, s0
349 ; VI-NEXT: v_mov_b32_e32 v5, s1
350 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
351 ; VI-NEXT: v_cmp_le_f64_e32 vcc, v[0:1], v[2:3]
352 ; VI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
353 ; VI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
354 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
356 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
357 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
358 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
360 %a = load double, double addrspace(1)* %gep.0, align 8
361 %b = load double, double addrspace(1)* %gep.1, align 8
363 %cmp = fcmp ole double %a, %b
364 %val = select i1 %cmp, double %a, double %b
365 store double %val, double addrspace(1)* %out, align 8
369 define amdgpu_kernel void @test_fmin_legacy_olt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #0 {
370 ; SI-LABEL: test_fmin_legacy_olt_f64:
372 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
373 ; SI-NEXT: s_mov_b32 s7, 0xf000
374 ; SI-NEXT: s_mov_b32 s10, 0
375 ; SI-NEXT: s_mov_b32 s11, s7
376 ; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
377 ; SI-NEXT: s_waitcnt lgkmcnt(0)
378 ; SI-NEXT: s_mov_b64 s[8:9], s[2:3]
379 ; SI-NEXT: v_mov_b32_e32 v1, 0
380 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[0:1], s[8:11], 0 addr64
381 ; SI-NEXT: s_mov_b32 s6, -1
382 ; SI-NEXT: s_mov_b32 s4, s0
383 ; SI-NEXT: s_mov_b32 s5, s1
384 ; SI-NEXT: s_waitcnt vmcnt(0)
385 ; SI-NEXT: v_cmp_lt_f64_e32 vcc, v[0:1], v[2:3]
386 ; SI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
387 ; SI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
388 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
391 ; VI-LABEL: test_fmin_legacy_olt_f64:
393 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
394 ; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
395 ; VI-NEXT: s_waitcnt lgkmcnt(0)
396 ; VI-NEXT: v_mov_b32_e32 v1, s3
397 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
398 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
399 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
400 ; VI-NEXT: v_mov_b32_e32 v4, s0
401 ; VI-NEXT: v_mov_b32_e32 v5, s1
402 ; VI-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
403 ; VI-NEXT: v_cmp_lt_f64_e32 vcc, v[0:1], v[2:3]
404 ; VI-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
405 ; VI-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
406 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
408 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
409 %gep.0 = getelementptr double, double addrspace(1)* %in, i32 %tid
410 %gep.1 = getelementptr double, double addrspace(1)* %gep.0, i32 1
412 %a = load double, double addrspace(1)* %gep.0, align 8
413 %b = load double, double addrspace(1)* %gep.1, align 8
415 %cmp = fcmp olt double %a, %b
416 %val = select i1 %cmp, double %a, double %b
417 store double %val, double addrspace(1)* %out, align 8
421 declare i32 @llvm.amdgcn.workitem.id.x() #1
423 attributes #0 = { nounwind }
424 attributes #1 = { nounwind readnone }