mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
86245071b5
Print the range of registers used with a single letter prefix. This better matches what the shader compiler produces and is overall less obnoxious than concatenating all of the subregister names together. Instead of SGPR0, it will print s0. Instead of SGPR0_SGPR1, it will print s[0:1] and so on. There doesn't appear to be a straightforward way to get the actual register info in the InstPrinter, so this parses the generated name to print with the new syntax. The required test changes are pretty nasty, and register matching regexes are now worse. Since there isn't a way to add to a variable in FileCheck, some of the tests now don't check the exact number of registers used, but I don't think that will be a real problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194443 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
956 B
LLVM
30 lines
956 B
LLVM
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
|
|
; RUN: llc -march=r600 -mcpu=cypress < %s | FileCheck -check-prefix=EG %s
|
|
|
|
define void @trunc_i64_to_i32_store(i32 addrspace(1)* %out, i64 %in) {
|
|
; SI-LABEL: @trunc_i64_to_i32_store
|
|
; SI: S_LOAD_DWORD s0, s[0:1], 11
|
|
; SI: V_MOV_B32_e32 v0, s0
|
|
; SI: BUFFER_STORE_DWORD v0
|
|
|
|
; EG-LABEL: @trunc_i64_to_i32_store
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
|
|
; EG: LSHR
|
|
; EG-NEXT: 2(
|
|
|
|
%result = trunc i64 %in to i32 store i32 %result, i32 addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|
|
|
|
; SI-LABEL: @trunc_shl_i64:
|
|
; SI: S_LOAD_DWORDX2
|
|
; SI: S_LOAD_DWORDX2 [[SREG:s\[[0-9]+:[0-9]+\]]]
|
|
; SI: V_LSHL_B64 v{{\[}}[[LO_VREG:[0-9]+]]:{{[0-9]+\]}}, [[SREG]], 2
|
|
; SI: BUFFER_STORE_DWORD v[[LO_VREG]],
|
|
define void @trunc_shl_i64(i32 addrspace(1)* %out, i64 %a) {
|
|
%b = shl i64 %a, 2
|
|
%result = trunc i64 %b to i32
|
|
store i32 %result, i32 addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|