Index: src/IceTargetLoweringX8632Traits.h |
diff --git a/src/IceTargetLoweringX8632Traits.h b/src/IceTargetLoweringX8632Traits.h |
index 22faa50926de19cb23a90ca6ed051841a4585a93..0d5ec1a545fc7901fd412c4f0e6ff2798c128ee3 100644 |
--- a/src/IceTargetLoweringX8632Traits.h |
+++ b/src/IceTargetLoweringX8632Traits.h |
@@ -662,10 +662,36 @@ public: |
llvm::report_fatal_error("no rdx in non-64-bit mode."); |
} |
+ // x86-32 calling convention: |
+ // |
+ // * The first four arguments of vector type, regardless of their position |
+ // relative to the other arguments in the argument list, are placed in |
+ // registers xmm0 - xmm3. |
+ // |
+ // This intends to match the section "IA-32 Function Calling Convention" of |
+ // the document "OS X ABI Function Call Guide" by Apple. |
+ |
/// The maximum number of arguments to pass in XMM registers |
static const uint32_t X86_MAX_XMM_ARGS = 4; |
/// The maximum number of arguments to pass in GPR registers |
static const uint32_t X86_MAX_GPR_ARGS = 0; |
+ /// Whether scalar floating point arguments are passed in XMM registers |
+ static const bool X86_PASS_SCALAR_FP_IN_XMM = false; |
Jim Stichnoth
2016/01/19 20:54:05
Can this be constexpr?
sehr
2016/01/19 21:47:35
Done.
|
+ /// Get the register for a given argument slot in the XMM registers. |
+ static inline int32_t getRegisterForXmmArgNum(uint32_t ArgNum) { |
Jim Stichnoth
2016/01/19 20:54:05
Remove "inline" for consistency?
sehr
2016/01/19 21:47:35
Done.
|
+ if (ArgNum >= X86_MAX_XMM_ARGS) { |
+ return Variable::NoRegister; |
+ } |
+ return static_cast<int32_t>(RegisterSet::Reg_xmm0 + ArgNum); |
Jim Stichnoth
2016/01/19 20:54:05
This would break if we for some reason decided to
sehr
2016/01/19 21:47:35
Done.
|
+ } |
+ /// Get the register for a given argument slot in the GPRs. |
+ static inline int32_t getRegisterForGprArgNum(Type Ty, uint32_t ArgNum) { |
+ assert(Ty == IceType_i64 || Ty == IceType_i32); |
+ (void)Ty; |
+ (void)ArgNum; |
+ return Variable::NoRegister; |
+ } |
+ |
/// The number of bits in a byte |
static const uint32_t X86_CHAR_BIT = 8; |
/// Stack alignment. This is defined in IceTargetLoweringX8632.cpp because it |