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
23 ; CHECK-NEXT: s_endpgm
24 %res = call i32 @llvm.amdgcn.ds.add.gs.reg.rtn.i32(i32 %arg, i32 16)
25 store i32 %res, ptr addrspace(1) %out, align 4
29 define amdgpu_gs void @test_add_64(i32 %arg) {
30 ; CHECK-LABEL: test_add_64:
32 ; CHECK-NEXT: ds_add_gs_reg_rtn v[0:1], v0 offset:32 gds
33 ; CHECK-NEXT: s_endpgm
34 %unused = call i64 @llvm.amdgcn.ds.add.gs.reg.rtn.i64(i32 %arg, i32 32)
38 define amdgpu_gs void @test_add_64_use(i32 %arg, ptr addrspace(1) %out) {
39 ; CHECK-LABEL: test_add_64_use:
41 ; CHECK-NEXT: ds_add_gs_reg_rtn v[3:4], v0 offset:32 gds
42 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
43 ; CHECK-NEXT: global_store_b64 v[1:2], v[3:4], off
44 ; CHECK-NEXT: s_endpgm
45 %res = call i64 @llvm.amdgcn.ds.add.gs.reg.rtn.i64(i32 %arg, i32 32)
46 store i64 %res, ptr addrspace(1) %out, align 4