1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s
5 declare i32 @llvm.amdgcn.ds.add.gs.reg.rtn.i32(i32, i32 immarg)
6 declare i64 @llvm.amdgcn.ds.add.gs.reg.rtn.i64(i32, i32 immarg)
8 define amdgpu_gs void @test_add_32(i32 %arg) {
9 ; CHECK-LABEL: test_add_32:
11 ; CHECK-NEXT: ds_add_gs_reg_rtn v[0:1], v0 offset:16 gds
12 ; CHECK-NEXT: s_endpgm
13 %unused = call i32 @llvm.amdgcn.ds.add.gs.reg.rtn.i32(i32 %arg, i32 16)
17 define amdgpu_gs void @test_add_32_use(i32 %arg, ptr addrspace(1) %out) {
18 ; CHECK-LABEL: test_add_32_use:
20 ; CHECK-NEXT: ds_add_gs_reg_rtn v[3:4], v0 offset:16 gds
21 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
22 ; CHECK-NEXT: global_store_b32 v[1:2], v3, off
24 ; CHECK-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
25 ; CHECK-NEXT: s_endpgm
26 %res = call i32 @llvm.amdgcn.ds.add.gs.reg.rtn.i32(i32 %arg, i32 16)
27 store i32 %res, ptr addrspace(1) %out, align 4
31 define amdgpu_gs void @test_add_64(i32 %arg) {
32 ; CHECK-LABEL: test_add_64:
34 ; CHECK-NEXT: ds_add_gs_reg_rtn v[0:1], v0 offset:32 gds
35 ; CHECK-NEXT: s_endpgm
36 %unused = call i64 @llvm.amdgcn.ds.add.gs.reg.rtn.i64(i32 %arg, i32 32)
40 define amdgpu_gs void @test_add_64_use(i32 %arg, ptr addrspace(1) %out) {
41 ; CHECK-LABEL: test_add_64_use:
43 ; CHECK-NEXT: ds_add_gs_reg_rtn v[3:4], v0 offset:32 gds
44 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
45 ; CHECK-NEXT: global_store_b64 v[1:2], v[3:4], off
47 ; CHECK-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
48 ; CHECK-NEXT: s_endpgm
49 %res = call i64 @llvm.amdgcn.ds.add.gs.reg.rtn.i64(i32 %arg, i32 32)
50 store i64 %res, ptr addrspace(1) %out, align 4