mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-18 06:38:41 +00:00
[mips] Add Mips-specific CCIf's for accessing the MipsCCState. NFC.
Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6213 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223662 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ae16ff1c42
commit
b856112d87
@ -20,6 +20,29 @@ class CCIfSubtarget<string F, CCAction A, string Invert = "">
|
|||||||
// The inverse of CCIfSubtarget
|
// The inverse of CCIfSubtarget
|
||||||
class CCIfSubtargetNot<string F, CCAction A> : CCIfSubtarget<F, A, "!">;
|
class CCIfSubtargetNot<string F, CCAction A> : CCIfSubtarget<F, A, "!">;
|
||||||
|
|
||||||
|
/// Match if the original argument (before lowering) was a float.
|
||||||
|
/// For example, this is true for i32's that were lowered from soft-float.
|
||||||
|
class CCIfOrigArgWasNotFloat<CCAction A>
|
||||||
|
: CCIf<"!static_cast<MipsCCState *>(&State)->WasOriginalArgFloat(ValNo)",
|
||||||
|
A>;
|
||||||
|
|
||||||
|
/// Match if the original argument (before lowering) was a 128-bit float (i.e.
|
||||||
|
/// long double).
|
||||||
|
class CCIfOrigArgWasF128<CCAction A>
|
||||||
|
: CCIf<"static_cast<MipsCCState *>(&State)->WasOriginalArgF128(ValNo)", A>;
|
||||||
|
|
||||||
|
/// Match if this specific argument is a vararg.
|
||||||
|
/// This is slightly different fro CCIfIsVarArg which matches if any argument is
|
||||||
|
/// a vararg.
|
||||||
|
class CCIfArgIsVarArg<CCAction A>
|
||||||
|
: CCIf<"!static_cast<MipsCCState *>(&State)->IsCallOperandFixed(ValNo)", A>;
|
||||||
|
|
||||||
|
|
||||||
|
/// Match if the special calling conv is the specified value.
|
||||||
|
class CCIfSpecialCallingConv<string CC, CCAction A>
|
||||||
|
: CCIf<"static_cast<MipsCCState *>(&State)->getSpecialCallingConv() == "
|
||||||
|
"MipsCCState::" # CC, A>;
|
||||||
|
|
||||||
// For soft-float, f128 values are returned in A0_64 rather than V1_64.
|
// For soft-float, f128 values are returned in A0_64 rather than V1_64.
|
||||||
def RetCC_F128SoftFloat : CallingConv<[
|
def RetCC_F128SoftFloat : CallingConv<[
|
||||||
CCAssignToReg<[V0_64, A0_64]>
|
CCAssignToReg<[V0_64, A0_64]>
|
||||||
@ -105,9 +128,7 @@ def CC_MipsN : CallingConv<[
|
|||||||
CCIfInReg<CCPromoteToUpperBitsInType<i64>>>>,
|
CCIfInReg<CCPromoteToUpperBitsInType<i64>>>>,
|
||||||
|
|
||||||
// All integers (except soft-float integers) are promoted to 64-bit.
|
// All integers (except soft-float integers) are promoted to 64-bit.
|
||||||
CCIfType<[i8, i16, i32],
|
CCIfType<[i8, i16, i32], CCIfOrigArgWasNotFloat<CCPromoteToType<i64>>>,
|
||||||
CCIf<"!static_cast<MipsCCState *>(&State)->WasOriginalArgFloat(ValNo)",
|
|
||||||
CCPromoteToType<i64>>>,
|
|
||||||
|
|
||||||
// The only i32's we have left are soft-float arguments.
|
// The only i32's we have left are soft-float arguments.
|
||||||
CCIfSubtarget<"abiUsesSoftFloat()", CCIfType<[i32], CCDelegateTo<CC_MipsN_SoftFloat>>>,
|
CCIfSubtarget<"abiUsesSoftFloat()", CCIfType<[i32], CCDelegateTo<CC_MipsN_SoftFloat>>>,
|
||||||
@ -162,9 +183,7 @@ def RetCC_MipsN : CallingConv<[
|
|||||||
//
|
//
|
||||||
// f128 should only occur for the N64 ABI where long double is 128-bit. On
|
// f128 should only occur for the N64 ABI where long double is 128-bit. On
|
||||||
// N32, long double is equivalent to double.
|
// N32, long double is equivalent to double.
|
||||||
CCIfType<[i64],
|
CCIfType<[i64], CCIfOrigArgWasF128<CCDelegateTo<RetCC_F128>>>,
|
||||||
CCIf<"static_cast<MipsCCState *>(&State)->WasOriginalArgF128(ValNo)",
|
|
||||||
CCDelegateTo<RetCC_F128>>>,
|
|
||||||
|
|
||||||
// Aggregate returns are positioned at the lowest address in the slot for
|
// Aggregate returns are positioned at the lowest address in the slot for
|
||||||
// both little and big-endian targets. When passing in registers, this
|
// both little and big-endian targets. When passing in registers, this
|
||||||
@ -330,8 +349,7 @@ def CC_Mips16RetHelper : CallingConv<[
|
|||||||
def CC_Mips_FixedArg : CallingConv<[
|
def CC_Mips_FixedArg : CallingConv<[
|
||||||
// Mips16 needs special handling on some functions.
|
// Mips16 needs special handling on some functions.
|
||||||
CCIf<"State.getCallingConv() != CallingConv::Fast",
|
CCIf<"State.getCallingConv() != CallingConv::Fast",
|
||||||
CCIf<"static_cast<MipsCCState *>(&State)->getSpecialCallingConv() == "
|
CCIfSpecialCallingConv<"Mips16RetHelperConv",
|
||||||
"MipsCCState::Mips16RetHelperConv",
|
|
||||||
CCDelegateTo<CC_Mips16RetHelper>>>,
|
CCDelegateTo<CC_Mips16RetHelper>>>,
|
||||||
|
|
||||||
CCIfByVal<CCDelegateTo<CC_Mips_ByVal>>,
|
CCIfByVal<CCDelegateTo<CC_Mips_ByVal>>,
|
||||||
@ -348,8 +366,7 @@ def CC_Mips_FixedArg : CallingConv<[
|
|||||||
// N32, long double is equivalent to double.
|
// N32, long double is equivalent to double.
|
||||||
CCIfType<[i64],
|
CCIfType<[i64],
|
||||||
CCIfSubtargetNot<"abiUsesSoftFloat()",
|
CCIfSubtargetNot<"abiUsesSoftFloat()",
|
||||||
CCIf<"static_cast<MipsCCState *>(&State)->WasOriginalArgF128(ValNo)",
|
CCIfOrigArgWasF128<CCBitConvertToType<f64>>>>,
|
||||||
CCBitConvertToType<f64>>>>,
|
|
||||||
|
|
||||||
CCIfCC<"CallingConv::Fast", CCDelegateTo<CC_Mips_FastCC>>,
|
CCIfCC<"CallingConv::Fast", CCDelegateTo<CC_Mips_FastCC>>,
|
||||||
|
|
||||||
@ -369,9 +386,7 @@ def CC_Mips_VarArg : CallingConv<[
|
|||||||
]>;
|
]>;
|
||||||
|
|
||||||
def CC_Mips : CallingConv<[
|
def CC_Mips : CallingConv<[
|
||||||
CCIfVarArg<
|
CCIfVarArg<CCIfArgIsVarArg<CCDelegateTo<CC_Mips_VarArg>>>,
|
||||||
CCIf<"!static_cast<MipsCCState *>(&State)->IsCallOperandFixed(ValNo)",
|
|
||||||
CCDelegateTo<CC_Mips_VarArg>>>,
|
|
||||||
CCDelegateTo<CC_Mips_FixedArg>
|
CCDelegateTo<CC_Mips_FixedArg>
|
||||||
]>;
|
]>;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user