Summary: Support for i<N> and fp32/64 arguments (in register), return values and constants along with tests. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D73092
60 lines
2.2 KiB
TableGen
60 lines
2.2 KiB
TableGen
//===-- VECallingConv.td - Calling Conventions VE ----------*- tablegen -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This describes the calling conventions for the VE architectures.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Aurora VE
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def CC_VE : CallingConv<[
|
|
// All arguments get passed in generic registers if there is space.
|
|
|
|
// Promote i1/i8/i16 arguments to i32.
|
|
CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
|
|
|
|
// bool, char, int, enum, long --> generic integer 32 bit registers
|
|
CCIfType<[i32], CCAssignToRegWithShadow<
|
|
[SW0, SW1, SW2, SW3, SW4, SW5, SW6, SW7],
|
|
[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
|
|
// float --> generic floating point 32 bit registers
|
|
CCIfType<[f32], CCAssignToRegWithShadow<
|
|
[SF0, SF1, SF2, SF3, SF4, SF5, SF6, SF7],
|
|
[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
|
|
// long long/double --> generic 64 bit registers
|
|
CCIfType<[i64, f64],
|
|
CCAssignToReg<[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
]>;
|
|
|
|
def RetCC_VE : CallingConv<[
|
|
// Promote i1/i8/i16 arguments to i32.
|
|
CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
|
|
|
|
// bool, char, int, enum, long --> generic integer 32 bit registers
|
|
CCIfType<[i32], CCAssignToRegWithShadow<
|
|
[SW0, SW1, SW2, SW3, SW4, SW5, SW6, SW7],
|
|
[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
|
|
// float --> generic floating point 32 bit registers
|
|
CCIfType<[f32], CCAssignToRegWithShadow<
|
|
[SF0, SF1, SF2, SF3, SF4, SF5, SF6, SF7],
|
|
[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
|
|
// long long/double --> generic 64 bit registers
|
|
CCIfType<[i64, f64],
|
|
CCAssignToReg<[SX0, SX1, SX2, SX3, SX4, SX5, SX6, SX7]>>,
|
|
]>;
|
|
|
|
// Callee-saved registers
|
|
def CSR : CalleeSavedRegs<(add (sequence "SX%u", 18, 33))>;
|
|
def CSR_NoRegs : CalleeSavedRegs<(add)>;
|