X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.
[oota-llvm.git] / lib / Target / X86 / X86CallingConv.td
index 97d4636b814f685330989a17b929bcc08b26aa0a..3a940003a3b6fcf00e96b887ee30d1127e99c5e4 100644 (file)
@@ -2,8 +2,8 @@
 // 
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Chris Lattner and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 // 
 //===----------------------------------------------------------------------===//
 //
@@ -52,10 +52,12 @@ def RetCC_X86_32_C : CallingConv<[
 
 // 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.
-  CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>,
-  CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>,
+  // The X86-32 fastcc returns 1, 2, or 3 FP values in XMM0-2 if the target has
+  // SSE2, otherwise it is the the C calling conventions.
+  // This can happen when a float, 2 x float, or 3 x float vector is split by
+  // target lowering, and is returned in 1-3 sse regs.
+  CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0,XMM1,XMM2]>>>,
+  CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0,XMM1,XMM2]>>>,
   CCDelegateTo<RetCC_X86Common>
 ]>;
 
@@ -120,7 +122,7 @@ def CC_X86_64_C : CallingConv<[
   
   // Long doubles get stack slots whose size and alignment depends on the
   // subtarget.
-  CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+  CCIfType<[f80], CCAssignToStack<0, 0>>,
 
   // Vectors get 16-byte stack slots that are 16-byte aligned.
   CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>,
@@ -181,7 +183,7 @@ def CC_X86_32_Common : CallingConv<[
 
   // Long doubles get slots whose size and alignment depends on the
   // subtarget.
-  CCIfType<[f80], CCAssignToStackABISizeAlign<0>>,
+  CCIfType<[f80], CCAssignToStack<16, 4>>,
 
   // The first 4 vector arguments are passed in XMM registers.
   CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],