[llvm-commits] CVS: llvm/lib/Target/X86/X86CallingConv.td
Chris Lattner
sabre at nondot.org
Mon Feb 26 21:51:21 PST 2007
Changes in directory llvm/lib/Target/X86:
X86CallingConv.td updated: 1.2 -> 1.3
---
Log message:
fill in some holes
---
Diffs of the changes: (+33 -7)
X86CallingConv.td | 40 +++++++++++++++++++++++++++++++++-------
1 files changed, 33 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/X86/X86CallingConv.td
diff -u llvm/lib/Target/X86/X86CallingConv.td:1.2 llvm/lib/Target/X86/X86CallingConv.td:1.3
--- llvm/lib/Target/X86/X86CallingConv.td:1.2 Mon Feb 26 12:56:07 2007
+++ llvm/lib/Target/X86/X86CallingConv.td Mon Feb 26 23:51:05 2007
@@ -12,21 +12,30 @@
//
//===----------------------------------------------------------------------===//
-
class CCAction;
class CallingConv;
+/// CCPredicateAction - Instances of this class check some predicate, then
+/// delegate to another action if the predicate is true.
+class CCPredicateAction<CCAction A> : CCAction {
+ CCAction SubAction = A;
+}
/// CCMatchType - If the current argument is one of the specified types, apply
/// Action A.
-class CCMatchType<list<ValueType> VTs, CCAction A> : CCAction {
+class CCMatchType<list<ValueType> VTs, CCAction A> : CCPredicateAction<A> {
}
/// CCMatchIf - If the predicate matches, apply A.
-class CCMatchIf<string predicate, CCAction A> : CCAction {
+class CCMatchIf<string predicate, CCAction A> : CCPredicateAction<A> {
string Predicate = predicate;
}
+/// CCMatchIfCC - Match of the current calling convention is 'CC'.
+class CCMatchIfCC<string CC, CCAction A> : CCPredicateAction<A> {
+ string CallingConv = CC;
+}
+
/// CCAssignToReg - This action matches if there is a register in the specified
/// list that is still available. If so, it assigns the value to the first
/// available register and succeeds.
@@ -42,7 +51,6 @@
}
-
/// CCPromoteToType - If applied, this promotes the specified current value to
/// the specified type.
class CCPromoteToType<ValueType destTy> : CCAction {
@@ -64,6 +72,7 @@
// Return Value Calling Conventions
//===----------------------------------------------------------------------===//
+// Return-value conventions common to all X86 CC's.
def RetCC_X86Common : CallingConv<[
// Scalar values are returned in AX first, then DX.
CCMatchType<[i8] , CCAssignToReg<[AL]>>,
@@ -76,7 +85,7 @@
CCMatchType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[XMM0]>>
]>;
-// Return conventions for the X86-32 C calling convention.
+// X86-32 C return-value convention.
def RetCC_X86_32_C : CallingConv<[
// The X86-32 calling convention returns FP values in ST0, otherwise it is the
// same as the common X86 calling conv.
@@ -85,7 +94,7 @@
CCDelegateTo<RetCC_X86Common>
]>;
-// Return conventions for the X86-32 Fast calling convention.
+// X86-32 FastCC return-value convention.
def RetCC_X86_32_Fast : CallingConv<[
// The X86-32 fastcc returns FP values in XMM0 if the target has SSE2,
// otherwise it is the the C calling conventions.
@@ -94,7 +103,7 @@
CCDelegateTo<RetCC_X86Common>
]>;
-// Return conventions for the X86-64 C calling convention.
+// X86-64 C return-value convention.
def RetCC_X86_64_C : CallingConv<[
// The X86-64 calling convention always returns FP values in XMM0.
CCMatchType<[f32], CCAssignToReg<[XMM0]>>,
@@ -103,6 +112,23 @@
]>;
+
+// This is the root return-value convention for the X86-32 backend.
+def RetCC_X86_32 : CallingConv<[
+ // If FastCC, use RetCC_X86_32_Fast.
+ CCMatchIfCC<"CallingConv::Fast", CCDelegateTo<RetCC_X86_32_Fast>>,
+ // Otherwise, use RetCC_X86_32_C.
+ CCDelegateTo<RetCC_X86_32_C>
+]>;
+
+// This is the root return-value convention for the X86-64 backend.
+def RetCC_X86_64 : CallingConv<[
+ // Always just the same as C calling conv for X86-64.
+ CCDelegateTo<RetCC_X86_64_C>
+]>;
+
+
+
//===----------------------------------------------------------------------===//
// Argument Calling Conventions
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list