Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: src/IceTargetLoweringX8632Traits.h

Issue 1592033002: Merge lowerCall and lowerRet between x86 and x64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changed to use Variable::NoRegister Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698