summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86CallingConv.td
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-28 06:20:01 +0000
committerChris Lattner <sabre@nondot.org>2007-02-28 06:20:01 +0000
commit011bcc8cdddf9693f01c854bb47133f9ed7092a4 (patch)
treeced17c345ce4c33cb6a360aa2bfe352ade8fa5ad /lib/Target/X86/X86CallingConv.td
parentfcf1a3de7a54d410678654bdbcd58b5bc924759c (diff)
downloadllvm-011bcc8cdddf9693f01c854bb47133f9ed7092a4.tar.gz
llvm-011bcc8cdddf9693f01c854bb47133f9ed7092a4.tar.bz2
llvm-011bcc8cdddf9693f01c854bb47133f9ed7092a4.tar.xz
add new CC_X86_32_FastCall calling conv, which describes fastcall on win32.
Factor out a CC_X86_32_Common convention, which is the part shared between ccc, stdcall and fastcall git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CallingConv.td')
-rw-r--r--lib/Target/X86/X86CallingConv.td39
1 files changed, 29 insertions, 10 deletions
diff --git a/lib/Target/X86/X86CallingConv.td b/lib/Target/X86/X86CallingConv.td
index 04a79043fd..f96b040461 100644
--- a/lib/Target/X86/X86CallingConv.td
+++ b/lib/Target/X86/X86CallingConv.td
@@ -111,22 +111,18 @@ def CC_X86_64_C : CallingConv<[
// X86 C Calling Convention
//===----------------------------------------------------------------------===//
-def CC_X86_32_C : CallingConv<[
- // Promote i8/i16 arguments to i32.
- CCIfType<[i8, i16], CCPromoteToType<i32>>,
-
- // The first 3 integer arguments, if marked 'inreg', are passed in integer
- // registers.
- CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX, ECX]>>>,
-
- // Other Integer/Float values get stored in stack slots that are 4 bytes in
+/// CC_X86_32_Common - In all X86-32 calling conventions, extra integers and FP
+/// values are spilled on the stack, and the first 4 vector values go in XMM
+/// regs.
+def CC_X86_32_Common : CallingConv<[
+ // Integer/Float values get stored in stack slots that are 4 bytes in
// size and 4-byte aligned.
CCIfType<[i32, f32], CCAssignToStack<4, 4>>,
// Doubles get 8-byte slots that are 4-byte aligned.
CCIfType<[f64], CCAssignToStack<8, 4>>,
- // The first 4 Vector arguments are passed in XMM registers.
+ // The first 4 vector arguments are passed in XMM registers.
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
CCAssignToReg<[XMM0, XMM1, XMM2, XMM3]>>,
@@ -134,5 +130,28 @@ def CC_X86_32_C : CallingConv<[
CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>
]>;
+def CC_X86_32_C : CallingConv<[
+ // Promote i8/i16 arguments to i32.
+ CCIfType<[i8, i16], CCPromoteToType<i32>>,
+
+ // The first 3 integer arguments, if marked 'inreg', are passed in integer
+ // registers.
+ CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX, ECX]>>>,
+
+ // Otherwise, same as everything else.
+ CCDelegateTo<CC_X86_32_Common>
+]>;
+
+
+def CC_X86_32_FastCall : CallingConv<[
+ // Promote i8/i16 arguments to i32.
+ CCIfType<[i8, i16], CCPromoteToType<i32>>,
+
+ // The first 2 integer arguments are passed in ECX/EDX
+ CCIfInReg<CCIfType<[i32], CCAssignToReg<[ECX, EDX]>>>,
+
+ // Otherwise, same as everything else.
+ CCDelegateTo<CC_X86_32_Common>
+]>;