mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
dc71dcb613
The patch adds support of i128 params lowering. The changes are quite trivial to support i128 as a "special case" of integer type. With this patch, we lower i128 params the same way as aggregates of size 16 bytes: .param .b8 _ [16]. Currently, NVPTX can't deal with the 128 bit integers: * in some cases because of failed assertions like ValVTs.size() == OutVals.size() && "Bad return value decomposition" * in other cases emitting PTX with .i128 or .u128 types (which are not valid [1]) [1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types Differential Revision: https://reviews.llvm.org/D34555 Patch by: Denys Zariaiev (denys.zariaiev@gmail.com) llvm-svn: 307326
29 lines
954 B
LLVM
29 lines
954 B
LLVM
; RUN: llc < %s -O0 -march=nvptx64 -mcpu=sm_20 | FileCheck %s
|
|
|
|
; CHECK-LABEL: .visible .func (.param .align 16 .b8 func_retval0[16]) callee(
|
|
define i128 @callee(i128) {
|
|
; CHECK: ld.param.v2.u64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [callee_param_0];
|
|
; CHECK: st.param.v2.b64 [func_retval0+0], {%[[REG0]], %[[REG1]]}
|
|
ret i128 %0
|
|
}
|
|
|
|
; CHECK-LABEL: .visible .func caller(
|
|
define void @caller(i128, i128*) {
|
|
start:
|
|
; CHECK-DAG: ld.param.v2.u64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [caller_param_0];
|
|
; CHECK-DAG: ld.param.u64 %[[OUT:rd[0-9]+]], [caller_param_1];
|
|
|
|
; CHECK: { // callseq 0, 0
|
|
; CHECK: .param .align 16 .b8 retval0[16];
|
|
; CHECK: call.uni (retval0),
|
|
; CHECK: ld.param.v2.b64 {%[[REG2:rd[0-9]+]], %[[REG3:rd[0-9]+]]}, [retval0+0];
|
|
; CHECK: } // callseq 0
|
|
%a = call i128 @callee(i128 %0)
|
|
|
|
; CHECK-DAG: st.u64 [%[[OUT]]], %[[REG2]];
|
|
; CHECK-DAG: st.u64 [%[[OUT]]+8], %[[REG3]];
|
|
store i128 %a, i128* %1
|
|
|
|
ret void
|
|
}
|