1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -global-isel=0 -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX10,GFX10-SDAG
3 ; RUN: llc < %s -global-isel=0 -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX11,GFX11-SDAG
4 ; RUN: llc < %s -global-isel=1 -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX10,GFX10-GISEL
5 ; RUN: llc < %s -global-isel=1 -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs | FileCheck %s -check-prefixes=GFX11,GFX11-GISEL
7 declare float @llvm.amdgcn.flat.atomic.fmin.f32.p1.f32(ptr %ptr, float %data)
8 declare float @llvm.amdgcn.flat.atomic.fmax.f32.p1.f32(ptr %ptr, float %data)
10 define amdgpu_cs void @flat_atomic_fmin_f32_noret(ptr %ptr, float %data) {
11 ; GFX10-LABEL: flat_atomic_fmin_f32_noret:
13 ; GFX10-NEXT: flat_atomic_fmin v[0:1], v2
14 ; GFX10-NEXT: s_endpgm
16 ; GFX11-LABEL: flat_atomic_fmin_f32_noret:
18 ; GFX11-NEXT: flat_atomic_min_f32 v[0:1], v2
19 ; GFX11-NEXT: s_endpgm
20 %ret = call float @llvm.amdgcn.flat.atomic.fmin.f32.p1.f32(ptr %ptr, float %data)
24 define amdgpu_cs void @flat_atomic_fmax_f32_noret(ptr %ptr, float %data) {
25 ; GFX10-LABEL: flat_atomic_fmax_f32_noret:
27 ; GFX10-NEXT: flat_atomic_fmax v[0:1], v2
28 ; GFX10-NEXT: s_endpgm
30 ; GFX11-LABEL: flat_atomic_fmax_f32_noret:
32 ; GFX11-NEXT: flat_atomic_max_f32 v[0:1], v2
33 ; GFX11-NEXT: s_endpgm
34 %ret = call float @llvm.amdgcn.flat.atomic.fmax.f32.p1.f32(ptr %ptr, float %data)
38 define amdgpu_cs float @flat_atomic_fmin_f32_rtn(ptr %ptr, float %data, ptr %out) {
39 ; GFX10-LABEL: flat_atomic_fmin_f32_rtn:
41 ; GFX10-NEXT: flat_atomic_fmin v0, v[0:1], v2 glc
42 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
43 ; GFX10-NEXT: flat_store_dword v[3:4], v0
44 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
45 ; GFX10-NEXT: ; return to shader part epilog
47 ; GFX11-LABEL: flat_atomic_fmin_f32_rtn:
49 ; GFX11-NEXT: flat_atomic_min_f32 v0, v[0:1], v2 glc
50 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
51 ; GFX11-NEXT: flat_store_b32 v[3:4], v0
52 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
53 ; GFX11-NEXT: ; return to shader part epilog
54 %ret = call float @llvm.amdgcn.flat.atomic.fmin.f32.p1.f32(ptr %ptr, float %data)
55 store float %ret, ptr %out
59 define amdgpu_cs float @flat_atomic_fmax_f32_rtn(ptr %ptr, float %data, ptr %out) {
60 ; GFX10-LABEL: flat_atomic_fmax_f32_rtn:
62 ; GFX10-NEXT: flat_atomic_fmax v0, v[0:1], v2 glc
63 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
64 ; GFX10-NEXT: flat_store_dword v[3:4], v0
65 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
66 ; GFX10-NEXT: ; return to shader part epilog
68 ; GFX11-LABEL: flat_atomic_fmax_f32_rtn:
70 ; GFX11-NEXT: flat_atomic_max_f32 v0, v[0:1], v2 glc
71 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
72 ; GFX11-NEXT: flat_store_b32 v[3:4], v0
73 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
74 ; GFX11-NEXT: ; return to shader part epilog
75 %ret = call float @llvm.amdgcn.flat.atomic.fmax.f32.p1.f32(ptr %ptr, float %data)
76 store float %ret, ptr %out
79 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: