1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX12,GFX12-SDAG
3 ; RUN: llc < %s -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX12,GFX12-GISEL
5 declare float @llvm.amdgcn.flat.atomic.fmin.num.f32.p1.f32(ptr %ptr, float %data)
6 declare float @llvm.amdgcn.flat.atomic.fmax.num.f32.p1.f32(ptr %ptr, float %data)
8 define amdgpu_cs void @flat_atomic_fmin_num_f32_noret(ptr %ptr, float %data) {
9 ; GFX12-LABEL: flat_atomic_fmin_num_f32_noret:
11 ; GFX12-NEXT: flat_atomic_min_num_f32 v[0:1], v2
12 ; GFX12-NEXT: s_endpgm
13 %ret = call float @llvm.amdgcn.flat.atomic.fmin.num.f32.p1.f32(ptr %ptr, float %data)
17 define amdgpu_cs void @flat_atomic_fmax_num_f32_noret(ptr %ptr, float %data) {
18 ; GFX12-LABEL: flat_atomic_fmax_num_f32_noret:
20 ; GFX12-NEXT: flat_atomic_max_num_f32 v[0:1], v2
21 ; GFX12-NEXT: s_endpgm
22 %ret = call float @llvm.amdgcn.flat.atomic.fmax.num.f32.p1.f32(ptr %ptr, float %data)
26 define amdgpu_cs float @flat_atomic_fmin_num_f32_rtn(ptr %ptr, float %data, ptr %out) {
27 ; GFX12-LABEL: flat_atomic_fmin_num_f32_rtn:
29 ; GFX12-NEXT: flat_atomic_min_num_f32 v0, v[0:1], v2 th:TH_ATOMIC_RETURN
30 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
31 ; GFX12-NEXT: flat_store_b32 v[3:4], v0
32 ; GFX12-NEXT: s_wait_dscnt 0x0
33 ; GFX12-NEXT: ; return to shader part epilog
34 %ret = call float @llvm.amdgcn.flat.atomic.fmin.num.f32.p1.f32(ptr %ptr, float %data)
35 store float %ret, ptr %out
39 define amdgpu_cs float @flat_atomic_fmax_num_f32_rtn(ptr %ptr, float %data, ptr %out) {
40 ; GFX12-LABEL: flat_atomic_fmax_num_f32_rtn:
42 ; GFX12-NEXT: flat_atomic_max_num_f32 v0, v[0:1], v2 th:TH_ATOMIC_RETURN
43 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
44 ; GFX12-NEXT: flat_store_b32 v[3:4], v0
45 ; GFX12-NEXT: s_wait_dscnt 0x0
46 ; GFX12-NEXT: ; return to shader part epilog
47 %ret = call float @llvm.amdgcn.flat.atomic.fmax.num.f32.p1.f32(ptr %ptr, float %data)
48 store float %ret, ptr %out
51 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: