mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
168 lines
5.6 KiB
LLVM
168 lines
5.6 KiB
LLVM
; RUN: llc -march=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
|
; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8:
|
|
; SI: buffer_load_dword [[REG:v[0-9]+]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8(<4 x i8> addrspace(1)* %out, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_x2:
|
|
; SI: buffer_load_dword [[REG:v[0-9]+]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_x2(<4 x i8> addrspace(1)* %out0, <4 x i8> addrspace(1)* %out1, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out0, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out1, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_x3:
|
|
; SI: buffer_load_dword [[REG:v[0-9]+]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_x3(<4 x i8> addrspace(1)* %out0, <4 x i8> addrspace(1)* %out1, <4 x i8> addrspace(1)* %out2, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out0, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out1, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out2, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_x4:
|
|
; SI: buffer_load_dword [[REG:v[0-9]+]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: buffer_store_dword [[REG]]
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_x4(<4 x i8> addrspace(1)* %out0, <4 x i8> addrspace(1)* %out1, <4 x i8> addrspace(1)* %out2, <4 x i8> addrspace(1)* %out3, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out0, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out1, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out2, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out3, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_extra_use:
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI_DAG: buffer_store_byte
|
|
|
|
; After scalarizing v4i8 loads is fixed.
|
|
; XSI: buffer_load_dword
|
|
; XSI: V_BFE
|
|
; XSI: V_ADD
|
|
; XSI: V_ADD
|
|
; XSI: V_ADD
|
|
; XSI: buffer_store_dword
|
|
; XSI: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_extra_use(<4 x i8> addrspace(1)* %out0, <4 x i8> addrspace(1)* %out1, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
%add = add <4 x i8> %val, <i8 9, i8 9, i8 9, i8 9>
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out0, align 4
|
|
store <4 x i8> %add, <4 x i8> addrspace(1)* %out1, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_x2_extra_use:
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: v_add
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI_DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI-DAG: buffer_store_byte
|
|
; SI_DAG: buffer_store_byte
|
|
|
|
; XSI: buffer_load_dword
|
|
; XSI: BFE
|
|
; XSI: buffer_store_dword
|
|
; XSI: V_ADD
|
|
; XSI: buffer_store_dword
|
|
; XSI-NEXT: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_x2_extra_use(<4 x i8> addrspace(1)* %out0, <4 x i8> addrspace(1)* %out1, <4 x i8> addrspace(1)* %out2, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
%add = add <4 x i8> %val, <i8 9, i8 9, i8 9, i8 9>
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out0, align 4
|
|
store <4 x i8> %add, <4 x i8> addrspace(1)* %out1, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out2, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v3i8:
|
|
; SI-NOT: bfe
|
|
; SI-NOT: bfi
|
|
; SI: s_endpgm
|
|
define void @test_copy_v3i8(<3 x i8> addrspace(1)* %out, <3 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <3 x i8>, <3 x i8> addrspace(1)* %in, align 4
|
|
store <3 x i8> %val, <3 x i8> addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_volatile_load:
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_volatile_load(<4 x i8> addrspace(1)* %out, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load volatile <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store <4 x i8> %val, <4 x i8> addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|
|
|
|
; FUNC-LABEL: {{^}}test_copy_v4i8_volatile_store:
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_load_ubyte
|
|
; SI: buffer_store_byte
|
|
; SI: buffer_store_byte
|
|
; SI: buffer_store_byte
|
|
; SI: buffer_store_byte
|
|
; SI: s_endpgm
|
|
define void @test_copy_v4i8_volatile_store(<4 x i8> addrspace(1)* %out, <4 x i8> addrspace(1)* %in) nounwind {
|
|
%val = load <4 x i8>, <4 x i8> addrspace(1)* %in, align 4
|
|
store volatile <4 x i8> %val, <4 x i8> addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|