source: icGREP/icgrep-devel/llvm-3.5.0.src/test/CodeGen/R600/atomic_load_sub.ll @ 4574

Last change on this file since 4574 was 4574, checked in by cameron, 4 years ago

Updating to LLVM 3.6

File size: 1.4 KB
Line 
1; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3
4; FUNC-LABEL: {{^}}atomic_sub_local:
5; R600: LDS_SUB *
6; SI: ds_sub_u32
7define void @atomic_sub_local(i32 addrspace(3)* %local) {
8   %unused = atomicrmw volatile sub i32 addrspace(3)* %local, i32 5 seq_cst
9   ret void
10}
11
12; FUNC-LABEL: {{^}}atomic_sub_local_const_offset:
13; R600: LDS_SUB *
14; SI: ds_sub_u32 v{{[0-9]+}}, v{{[0-9]+}} offset:16
15define void @atomic_sub_local_const_offset(i32 addrspace(3)* %local) {
16  %gep = getelementptr i32 addrspace(3)* %local, i32 4
17  %val = atomicrmw volatile sub i32 addrspace(3)* %gep, i32 5 seq_cst
18  ret void
19}
20
21; FUNC-LABEL: {{^}}atomic_sub_ret_local:
22; R600: LDS_SUB_RET *
23; SI: ds_sub_rtn_u32
24define void @atomic_sub_ret_local(i32 addrspace(1)* %out, i32 addrspace(3)* %local) {
25  %val = atomicrmw volatile sub i32 addrspace(3)* %local, i32 5 seq_cst
26  store i32 %val, i32 addrspace(1)* %out
27  ret void
28}
29
30; FUNC-LABEL: {{^}}atomic_sub_ret_local_const_offset:
31; R600: LDS_SUB_RET *
32; SI: ds_sub_rtn_u32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}} offset:20
33define void @atomic_sub_ret_local_const_offset(i32 addrspace(1)* %out, i32 addrspace(3)* %local) {
34  %gep = getelementptr i32 addrspace(3)* %local, i32 5
35  %val = atomicrmw volatile sub i32 addrspace(3)* %gep, i32 5 seq_cst
36  store i32 %val, i32 addrspace(1)* %out
37  ret void
38}
Note: See TracBrowser for help on using the repository browser.