| Index: src/ia32/lithium-gap-resolver-ia32.cc
|
| diff --git a/src/ia32/lithium-gap-resolver-ia32.cc b/src/ia32/lithium-gap-resolver-ia32.cc
|
| index 34b949085a15ce84a1d5d88aa75f568d381f0ff0..c80f89b86b9beb29b164ba201f48b1a39ac8861a 100644
|
| --- a/src/ia32/lithium-gap-resolver-ia32.cc
|
| +++ b/src/ia32/lithium-gap-resolver-ia32.cc
|
| @@ -295,22 +295,13 @@ void LGapResolver::EmitMove(int index) {
|
| uint64_t int_val = BitCast<uint64_t, double>(v);
|
| int32_t lower = static_cast<int32_t>(int_val);
|
| int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt);
|
| - if (CpuFeatures::IsSupported(SSE2)) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| - XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| - if (int_val == 0) {
|
| - __ xorps(dst, dst);
|
| - } else {
|
| - __ push(Immediate(upper));
|
| - __ push(Immediate(lower));
|
| - __ movsd(dst, Operand(esp, 0));
|
| - __ add(esp, Immediate(kDoubleSize));
|
| - }
|
| + XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| + if (int_val == 0) {
|
| + __ xorps(dst, dst);
|
| } else {
|
| __ push(Immediate(upper));
|
| __ push(Immediate(lower));
|
| - X87Register dst = cgen_->ToX87Register(destination);
|
| - cgen_->X87Mov(dst, MemOperand(esp, 0));
|
| + __ movsd(dst, Operand(esp, 0));
|
| __ add(esp, Immediate(kDoubleSize));
|
| }
|
| } else {
|
| @@ -328,59 +319,27 @@ void LGapResolver::EmitMove(int index) {
|
| }
|
|
|
| } else if (source->IsDoubleRegister()) {
|
| - if (CpuFeatures::IsSupported(SSE2)) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| - XMMRegister src = cgen_->ToDoubleRegister(source);
|
| - if (destination->IsDoubleRegister()) {
|
| - XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| - __ movaps(dst, src);
|
| - } else {
|
| - ASSERT(destination->IsDoubleStackSlot());
|
| - Operand dst = cgen_->ToOperand(destination);
|
| - __ movsd(dst, src);
|
| - }
|
| + XMMRegister src = cgen_->ToDoubleRegister(source);
|
| + if (destination->IsDoubleRegister()) {
|
| + XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| + __ movaps(dst, src);
|
| } else {
|
| - // load from the register onto the stack, store in destination, which must
|
| - // be a double stack slot in the non-SSE2 case.
|
| ASSERT(destination->IsDoubleStackSlot());
|
| Operand dst = cgen_->ToOperand(destination);
|
| - X87Register src = cgen_->ToX87Register(source);
|
| - cgen_->X87Mov(dst, src);
|
| + __ movsd(dst, src);
|
| }
|
| } else if (source->IsDoubleStackSlot()) {
|
| - if (CpuFeatures::IsSupported(SSE2)) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| - ASSERT(destination->IsDoubleRegister() ||
|
| - destination->IsDoubleStackSlot());
|
| - Operand src = cgen_->ToOperand(source);
|
| - if (destination->IsDoubleRegister()) {
|
| - XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| - __ movsd(dst, src);
|
| - } else {
|
| - // We rely on having xmm0 available as a fixed scratch register.
|
| - Operand dst = cgen_->ToOperand(destination);
|
| - __ movsd(xmm0, src);
|
| - __ movsd(dst, xmm0);
|
| - }
|
| + ASSERT(destination->IsDoubleRegister() ||
|
| + destination->IsDoubleStackSlot());
|
| + Operand src = cgen_->ToOperand(source);
|
| + if (destination->IsDoubleRegister()) {
|
| + XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
| + __ movsd(dst, src);
|
| } else {
|
| - // load from the stack slot on top of the floating point stack, and then
|
| - // store in destination. If destination is a double register, then it
|
| - // represents the top of the stack and nothing needs to be done.
|
| - if (destination->IsDoubleStackSlot()) {
|
| - Register tmp = EnsureTempRegister();
|
| - Operand src0 = cgen_->ToOperand(source);
|
| - Operand src1 = cgen_->HighOperand(source);
|
| - Operand dst0 = cgen_->ToOperand(destination);
|
| - Operand dst1 = cgen_->HighOperand(destination);
|
| - __ mov(tmp, src0); // Then use tmp to copy source to destination.
|
| - __ mov(dst0, tmp);
|
| - __ mov(tmp, src1);
|
| - __ mov(dst1, tmp);
|
| - } else {
|
| - Operand src = cgen_->ToOperand(source);
|
| - X87Register dst = cgen_->ToX87Register(destination);
|
| - cgen_->X87Mov(dst, src);
|
| - }
|
| + // We rely on having xmm0 available as a fixed scratch register.
|
| + Operand dst = cgen_->ToOperand(destination);
|
| + __ movsd(xmm0, src);
|
| + __ movsd(dst, xmm0);
|
| }
|
| } else {
|
| UNREACHABLE();
|
| @@ -445,7 +404,6 @@ void LGapResolver::EmitSwap(int index) {
|
| __ mov(src, tmp0);
|
| }
|
| } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| // XMM register-register swap. We rely on having xmm0
|
| // available as a fixed scratch register.
|
| XMMRegister src = cgen_->ToDoubleRegister(source);
|
| @@ -454,7 +412,6 @@ void LGapResolver::EmitSwap(int index) {
|
| __ movaps(src, dst);
|
| __ movaps(dst, xmm0);
|
| } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| // XMM register-memory swap. We rely on having xmm0
|
| // available as a fixed scratch register.
|
| ASSERT(source->IsDoubleStackSlot() || destination->IsDoubleStackSlot());
|
| @@ -467,7 +424,6 @@ void LGapResolver::EmitSwap(int index) {
|
| __ movsd(other, reg);
|
| __ movaps(reg, xmm0);
|
| } else if (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot()) {
|
| - CpuFeatureScope scope(cgen_->masm(), SSE2);
|
| // Double-width memory-to-memory. Spill on demand to use a general
|
| // purpose temporary register and also rely on having xmm0 available as
|
| // a fixed scratch register.
|
|
|