mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
R600/SI: Fix/add tests for atomicrmw add
The previous tests claimed to test constant offsets in the function name, but the tests weren't actually testing them. Clone the tests, and do testing of all combinations of the following: 1) with/without constant pointer offset 2) 32/64-bit addressing modes 3) Usage and non-usage of the return value from the atomicrmw Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220103 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
802463d861
commit
d9f9b51223
@ -1,17 +1,59 @@
|
||||
; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_offset:
|
||||
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
|
||||
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:0x10{{$}}
|
||||
define void @atomic_add_i32_offset(i32 addrspace(1)* %out, i32 %in) {
|
||||
entry:
|
||||
%gep = getelementptr i32 addrspace(1)* %out, i32 4
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
|
||||
ret void
|
||||
}
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_ret_offset:
|
||||
; SI: BUFFER_ATOMIC_ADD [[RET:v[0-9]+]], s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:0x10 glc {{$}}
|
||||
; SI: BUFFER_STORE_DWORD [[RET]]
|
||||
define void @atomic_add_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
|
||||
entry:
|
||||
%gep = getelementptr i32 addrspace(1)* %out, i32 4
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
|
||||
store i32 %0, i32 addrspace(1)* %out2
|
||||
ret void
|
||||
}
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_addr64_offset:
|
||||
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:0x10{{$}}
|
||||
define void @atomic_add_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
|
||||
entry:
|
||||
%ptr = getelementptr i32 addrspace(1)* %out, i64 %index
|
||||
%gep = getelementptr i32 addrspace(1)* %ptr, i32 4
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
|
||||
ret void
|
||||
}
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_ret_addr64_offset:
|
||||
; SI: BUFFER_ATOMIC_ADD [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:0x10 glc{{$}}
|
||||
; SI: BUFFER_STORE_DWORD [[RET]]
|
||||
define void @atomic_add_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
|
||||
entry:
|
||||
%ptr = getelementptr i32 addrspace(1)* %out, i64 %index
|
||||
%gep = getelementptr i32 addrspace(1)* %ptr, i32 4
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
|
||||
store i32 %0, i32 addrspace(1)* %out2
|
||||
ret void
|
||||
}
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32:
|
||||
; SI: BUFFER_ATOMIC_ADD v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
|
||||
define void @atomic_add_i32(i32 addrspace(1)* %out, i32 %in) {
|
||||
entry:
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
|
||||
ret void
|
||||
}
|
||||
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_ret_offset:
|
||||
; FUNC-LABEL: {{^}}atomic_add_i32_ret:
|
||||
; SI: BUFFER_ATOMIC_ADD [[RET:v[0-9]+]], s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
|
||||
; SI: BUFFER_STORE_DWORD [[RET]]
|
||||
define void @atomic_add_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
|
||||
define void @atomic_add_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
|
||||
entry:
|
||||
%0 = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
|
||||
store i32 %0, i32 addrspace(1)* %out2
|
||||
|
Loading…
x
Reference in New Issue
Block a user