1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx908 < %s | FileCheck -check-prefix=CHECK %s
4 define void @raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset(float %val, <4 x i32> inreg %rsrc, i32 %voffset, i32 inreg %soffset) {
5 ; CHECK-LABEL: raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset:
7 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8 ; CHECK-NEXT: s_mov_b32 s11, s17
9 ; CHECK-NEXT: s_mov_b32 s10, s16
10 ; CHECK-NEXT: s_mov_b32 s9, s7
11 ; CHECK-NEXT: s_mov_b32 s8, s6
12 ; CHECK-NEXT: buffer_atomic_add_f32 v0, v1, s[8:11], s18 offen offset:24
13 ; CHECK-NEXT: s_waitcnt vmcnt(0)
14 ; CHECK-NEXT: s_setpc_b64 s[30:31]
15 %voffset.add = add i32 %voffset, 24
16 %ret = call float @llvm.amdgcn.raw.buffer.atomic.fadd.f32(float %val, <4 x i32> %rsrc, i32 %voffset.add, i32 %soffset, i32 0)
20 define void @raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__0_voffset__sgpr_soffset(float %val, <4 x i32> inreg %rsrc, i32 inreg %soffset) {
21 ; CHECK-LABEL: raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__0_voffset__sgpr_soffset:
23 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
24 ; CHECK-NEXT: s_mov_b32 s11, s17
25 ; CHECK-NEXT: s_mov_b32 s10, s16
26 ; CHECK-NEXT: s_mov_b32 s9, s7
27 ; CHECK-NEXT: s_mov_b32 s8, s6
28 ; CHECK-NEXT: buffer_atomic_add_f32 v0, off, s[8:11], s18
29 ; CHECK-NEXT: s_waitcnt vmcnt(0)
30 ; CHECK-NEXT: s_setpc_b64 s[30:31]
31 %ret = call float @llvm.amdgcn.raw.buffer.atomic.fadd.f32(float %val, <4 x i32> %rsrc, i32 0, i32 %soffset, i32 0)
35 define void @raw_buffer_atomic_add_v2f16_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset(<2 x half> %val, <4 x i32> inreg %rsrc, i32 %voffset, i32 inreg %soffset) {
36 ; CHECK-LABEL: raw_buffer_atomic_add_v2f16_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset:
38 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
39 ; CHECK-NEXT: s_mov_b32 s11, s17
40 ; CHECK-NEXT: s_mov_b32 s10, s16
41 ; CHECK-NEXT: s_mov_b32 s9, s7
42 ; CHECK-NEXT: s_mov_b32 s8, s6
43 ; CHECK-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[8:11], s18 offen
44 ; CHECK-NEXT: s_waitcnt vmcnt(0)
45 ; CHECK-NEXT: s_setpc_b64 s[30:31]
46 %ret = call <2 x half> @llvm.amdgcn.raw.buffer.atomic.fadd.v2f16(<2 x half> %val, <4 x i32> %rsrc, i32 %voffset, i32 %soffset, i32 0)
50 define void @raw_buffer_atomic_add_v2f16_noret__vgpr_val__sgpr_rsrc__0_voffset__sgpr_soffset(<2 x half> %val, <4 x i32> inreg %rsrc, i32 %voffset, i32 inreg %soffset) {
51 ; CHECK-LABEL: raw_buffer_atomic_add_v2f16_noret__vgpr_val__sgpr_rsrc__0_voffset__sgpr_soffset:
53 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
54 ; CHECK-NEXT: s_mov_b32 s11, s17
55 ; CHECK-NEXT: s_mov_b32 s10, s16
56 ; CHECK-NEXT: s_mov_b32 s9, s7
57 ; CHECK-NEXT: s_mov_b32 s8, s6
58 ; CHECK-NEXT: buffer_atomic_pk_add_f16 v0, off, s[8:11], s18 offset:92
59 ; CHECK-NEXT: s_waitcnt vmcnt(0)
60 ; CHECK-NEXT: s_setpc_b64 s[30:31]
61 %ret = call <2 x half> @llvm.amdgcn.raw.buffer.atomic.fadd.v2f16(<2 x half> %val, <4 x i32> %rsrc, i32 92, i32 %soffset, i32 0)
65 define void @raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset_slc(float %val, <4 x i32> inreg %rsrc, i32 %voffset, i32 inreg %soffset) {
66 ; CHECK-LABEL: raw_buffer_atomic_add_f32_noret__vgpr_val__sgpr_rsrc__vgpr_voffset__sgpr_soffset_slc:
68 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
69 ; CHECK-NEXT: s_mov_b32 s11, s17
70 ; CHECK-NEXT: s_mov_b32 s10, s16
71 ; CHECK-NEXT: s_mov_b32 s9, s7
72 ; CHECK-NEXT: s_mov_b32 s8, s6
73 ; CHECK-NEXT: buffer_atomic_add_f32 v0, v1, s[8:11], s18 offen slc
74 ; CHECK-NEXT: s_waitcnt vmcnt(0)
75 ; CHECK-NEXT: s_setpc_b64 s[30:31]
76 %ret = call float @llvm.amdgcn.raw.buffer.atomic.fadd.f32(float %val, <4 x i32> %rsrc, i32 %voffset, i32 %soffset, i32 2)
80 declare float @llvm.amdgcn.raw.buffer.atomic.fadd.f32(float, <4 x i32>, i32, i32, i32 immarg) #0
81 declare <2 x half> @llvm.amdgcn.raw.buffer.atomic.fadd.v2f16(<2 x half>, <4 x i32>, i32, i32, i32 immarg) #0
83 attributes #0 = { nounwind }