Commit b7999fd2 authored by titzer@chromium.org's avatar titzer@chromium.org

TF: Clear upper bits of ConvertFloat64ToUint32 because Win64.

R=bmeurer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/436623002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 73d975e1
......@@ -496,6 +496,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
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: {
......
......@@ -14,6 +14,12 @@ namespace v8 {
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; }
......@@ -21,26 +27,24 @@ struct LinkageHelperTraits {
static Register ContextReg() { return rsi; }
static Register RuntimeCallFunctionReg() { return rbx; }
static Register RuntimeCallArgCountReg() { return rax; }
#ifdef _WIN64
static RegList CCalleeSaveRegisters() {
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) {
if (kWin64) {
static Register register_parameters[] = {rcx, rdx, 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) {
} else {
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; }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment