Fix LGapResolver::EmitMove for X64 when the dst is a double register and src is a...
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 12 Jul 2013 12:34:11 +0000 (12:34 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 12 Jul 2013 12:34:11 +0000 (12:34 +0000)
R=danno@chromium.org

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

Patch from Haitao Feng <haitao.feng@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/x64/lithium-gap-resolver-x64.cc

index adb1afa247c0e8aa0f2b653427c675081f6e048d..71db17c93156e9a55dc9724949d91bc17b444125 100644 (file)
@@ -205,16 +205,12 @@ void LGapResolver::EmitMove(int index) {
     } else if (destination->IsDoubleRegister()) {
       double v = cgen_->ToDouble(constant_source);
       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));
       XMMRegister dst = cgen_->ToDoubleRegister(destination);
       if (int_val == 0) {
         __ xorps(dst, dst);
       } else {
-        __ push(Immediate(upper));
-        __ push(Immediate(lower));
-        __ movsd(dst, Operand(rsp, 0));
-        __ addq(rsp, Immediate(kDoubleSize));
+        __ movq(kScratchRegister, int_val, RelocInfo::NONE64);
+        __ movq(dst, kScratchRegister);
       }
     } else {
       ASSERT(destination->IsStackSlot());