2014-09-25 18:30:26 +00:00
|
|
|
; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
|
|
|
|
2014-10-17 23:32:49 +00:00
|
|
|
; FUNC-LABEL: {{^}}atomic_add_i32_offset:
|
2014-09-25 18:30:26 +00:00
|
|
|
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
|
2014-10-17 23:32:49 +00:00
|
|
|
define void @atomic_add_i32_offset(i32 addrspace(1)* %out, i32 %in) {
|
2014-09-25 18:30:26 +00:00
|
|
|
entry:
|
|
|
|
%0 = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-17 23:32:49 +00:00
|
|
|
; FUNC-LABEL: {{^}}atomic_add_i32_ret_offset:
|
2014-09-25 18:30:26 +00:00
|
|
|
; SI: BUFFER_ATOMIC_ADD [[RET:v[0-9]+]], s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
|
|
|
|
; SI: BUFFER_STORE_DWORD [[RET]]
|
2014-10-17 23:32:49 +00:00
|
|
|
define void @atomic_add_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
|
2014-09-25 18:30:26 +00:00
|
|
|
entry:
|
|
|
|
%0 = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
|
|
|
|
store i32 %0, i32 addrspace(1)* %out2
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-17 23:32:49 +00:00
|
|
|
; FUNC-LABEL: {{^}}atomic_add_i32_addr64:
|
2014-09-25 18:30:26 +00:00
|
|
|
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
|
2014-10-17 23:32:49 +00:00
|
|
|
define void @atomic_add_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
|
2014-09-25 18:30:26 +00:00
|
|
|
entry:
|
|
|
|
%ptr = getelementptr i32 addrspace(1)* %out, i64 %index
|
|
|
|
%0 = atomicrmw volatile add i32 addrspace(1)* %ptr, i32 %in seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-17 23:32:49 +00:00
|
|
|
; FUNC-LABEL: {{^}}atomic_add_i32_ret_addr64:
|
2014-09-25 18:30:26 +00:00
|
|
|
; SI: BUFFER_ATOMIC_ADD [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
|
|
|
|
; SI: BUFFER_STORE_DWORD [[RET]]
|
2014-10-17 23:32:49 +00:00
|
|
|
define void @atomic_add_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
|
2014-09-25 18:30:26 +00:00
|
|
|
entry:
|
|
|
|
%ptr = getelementptr i32 addrspace(1)* %out, i64 %index
|
|
|
|
%0 = atomicrmw volatile add i32 addrspace(1)* %ptr, i32 %in seq_cst
|
|
|
|
store i32 %0, i32 addrspace(1)* %out2
|
|
|
|
ret void
|
|
|
|
}
|