mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-13 21:10:39 +00:00

The TableGen-based calling convention definitions are inflexible, while writing a function to implement the calling convention is very straight-forward, and allows difficult cases to be handled more easily. With this patch adds support for: * Passing large scalars according to the RV32I calling convention * Byval arguments * Passing values on the stack when the argument registers are exhausted The custom CC_RISCV calling convention is also used for returns. This patch also documents the ABI lowering that a language frontend is expected to perform. I would like to work to simplify these requirements over time, but this will require further discussion within the LLVM community. We add PendingArgFlags CCState, as a companion to PendingLocs. The PendingLocs vector is used by a number of backends to handle arguments that are split during legalisation. However CCValAssign doesn't keep track of the original argument alignment. Therefore, add a PendingArgFlags vector which can be used to keep track of the ISD::ArgFlagsTy for every value added to PendingLocs. Differential Revision: https://reviews.llvm.org/D39898 llvm-svn: 320359
21 lines
794 B
TableGen
21 lines
794 B
TableGen
//===-- RISCVCallingConv.td - Calling Conventions RISCV ----*- tablegen -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This describes the calling conventions for the RISCV architecture.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// The RISC-V calling convention is handled with custom code in
|
|
// RISCVISelLowering.cpp (CC_RISCV).
|
|
|
|
def CSR : CalleeSavedRegs<(add X1, X3, X4, X8, X9, (sequence "X%u", 18, 27))>;
|
|
|
|
// Needed for implementation of RISCVRegisterInfo::getNoPreservedMask()
|
|
def CSR_NoRegs : CalleeSavedRegs<(add)>;
|