Commit b360ef23 authored by lrn@chromium.org's avatar lrn@chromium.org

X64: Fix recently introduced bug in movq with 64-bit literal.

Review URL: http://codereview.chromium.org/155223


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1dbb07fe
...@@ -1084,18 +1084,19 @@ void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) { ...@@ -1084,18 +1084,19 @@ void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
// Sadly, there is no zero or sign extending move for 8-bit immediates. // Sadly, there is no zero or sign extending move for 8-bit immediates.
if (is_int32(value)) { if (is_int32(value)) {
movq(dst, Immediate(static_cast<int32_t>(value))); movq(dst, Immediate(static_cast<int32_t>(value)));
return;
} else if (is_uint32(value)) { } else if (is_uint32(value)) {
movl(dst, Immediate(static_cast<int32_t>(value))); movl(dst, Immediate(static_cast<int32_t>(value)));
return;
} }
// Value cannot be represented by 32 bits, so do a full 64 bit immediate // Value cannot be represented by 32 bits, so do a full 64 bit immediate
// value. // value.
} else { }
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
last_pc_ = pc_; last_pc_ = pc_;
emit_rex_64(dst); emit_rex_64(dst);
emit(0xB8 | dst.low_bits()); emit(0xB8 | dst.low_bits());
emitq(value, rmode); emitq(value, rmode);
}
} }
......
...@@ -5644,7 +5644,7 @@ void CompareStub::Generate(MacroAssembler* masm) { ...@@ -5644,7 +5644,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
// The representation of NaN values has all exponent bits (52..62) set, // The representation of NaN values has all exponent bits (52..62) set,
// and not all mantissa bits (0..51) clear. // and not all mantissa bits (0..51) clear.
// Read double representation into rax. // Read double representation into rax.
__ movq(rbx, 0x7ff0000000000000, RelocInfo::NONE); __ movq(rbx, V8_UINT64_C(0x7ff0000000000000), RelocInfo::NONE);
__ movq(rax, FieldOperand(rdx, HeapNumber::kValueOffset)); __ movq(rax, FieldOperand(rdx, HeapNumber::kValueOffset));
// Test that exponent bits are all set. // Test that exponent bits are all set.
__ or_(rbx, rax); __ or_(rbx, rax);
...@@ -5655,10 +5655,7 @@ void CompareStub::Generate(MacroAssembler* masm) { ...@@ -5655,10 +5655,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
// If all bits in the mantissa are zero the number is Infinity, and // If all bits in the mantissa are zero the number is Infinity, and
// we return zero. Otherwise it is a NaN, and we return non-zero. // we return zero. Otherwise it is a NaN, and we return non-zero.
// We cannot just return rax because only eax is tested on return. // We cannot just return rax because only eax is tested on return.
// TODO(X64): Solve this using movcc, when implemented. __ setcc(not_zero, rax);
__ movq(kScratchRegister, rax);
__ shr(kScratchRegister, Immediate(32));
__ or_(rax, kScratchRegister);
__ ret(0); __ ret(0);
__ bind(&not_identical); __ bind(&not_identical);
......
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