case kSSEFloat64ToUint32: {
// TODO(turbofan): X64 SSE cvttsd2siq should support operands.
__ cvttsd2siq(i.OutputRegister(), i.InputDoubleRegister(0));
+ __ andl(i.OutputRegister(), i.OutputRegister()); // clear upper bits.
+ // TODO(turbofan): generated code should not look at the upper 32 bits
+ // of the result, but those bits could escape to the outside world.
break;
}
case kSSEInt32ToFloat64: {
namespace internal {
namespace compiler {
+#ifdef _WIN64
+const bool kWin64 = true;
+#else
+const bool kWin64 = false;
+#endif
+
struct LinkageHelperTraits {
static Register ReturnValueReg() { return rax; }
static Register ReturnValue2Reg() { return rdx; }
static Register ContextReg() { return rsi; }
static Register RuntimeCallFunctionReg() { return rbx; }
static Register RuntimeCallArgCountReg() { return rax; }
-#ifdef _WIN64
static RegList CCalleeSaveRegisters() {
- return rbx.bit() | rdi.bit() | rsi.bit() | r12.bit() | r13.bit() |
- r14.bit() | r15.bit();
+ if (kWin64) {
+ return rbx.bit() | rdi.bit() | rsi.bit() | r12.bit() | r13.bit() |
+ r14.bit() | r15.bit();
+ } else {
+ return rbx.bit() | r12.bit() | r13.bit() | r14.bit() | r15.bit();
+ }
}
static Register CRegisterParameter(int i) {
- static Register register_parameters[] = {rcx, rdx, r8, r9};
- return register_parameters[i];
+ if (kWin64) {
+ static Register register_parameters[] = {rcx, rdx, r8, r9};
+ return register_parameters[i];
+ } else {
+ static Register register_parameters[] = {rdi, rsi, rdx, rcx, r8, r9};
+ return register_parameters[i];
+ }
}
- static int CRegisterParametersLength() { return 4; }
-#else
- static RegList CCalleeSaveRegisters() {
- return rbx.bit() | r12.bit() | r13.bit() | r14.bit() | r15.bit();
- }
- static Register CRegisterParameter(int i) {
- static Register register_parameters[] = {rdi, rsi, rdx, rcx, r8, r9};
- return register_parameters[i];
- }
- static int CRegisterParametersLength() { return 6; }
-#endif
+ static int CRegisterParametersLength() { return kWin64 ? 4 : 6; }
};