Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: src/x64/codegen-x64.cc

Issue 155073: X64: Fix LoadFloatOperands. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
===================================================================
--- src/x64/codegen-x64.cc (revision 2356)
+++ src/x64/codegen-x64.cc (working copy)
@@ -4386,8 +4386,8 @@
Register left_reg = left_side.reg();
Register right_reg = right_side.reg();
- __ movq(kScratchRegister, left_side.reg());
- __ or_(kScratchRegister, right_side.reg());
+ __ movq(kScratchRegister, left_reg);
+ __ or_(kScratchRegister, right_reg);
__ testl(kScratchRegister, Immediate(kSmiTagMask));
is_smi.Branch(zero, taken);
// When non-smi, call out to the compare stub.
@@ -6493,17 +6493,18 @@
__ bind(&load_smi_lhs);
ASSERT(kSmiTagSize == 1);
ASSERT(kSmiTag == 0);
- __ lea(kScratchRegister, Operand(lhs, lhs, times_1, 0));
+ __ movsxlq(kScratchRegister, lhs);
+ __ sar(kScratchRegister, Immediate(kSmiTagSize));
__ push(kScratchRegister);
- __ fild_s(Operand(rsp, 0));
+ __ fild_d(Operand(rsp, 0));
__ pop(kScratchRegister);
__ jmp(&done_load_lhs);
__ bind(&load_smi_rhs);
- __ movq(kScratchRegister, rhs);
+ __ movsxlq(kScratchRegister, rhs);
__ sar(kScratchRegister, Immediate(kSmiTagSize));
__ push(kScratchRegister);
- __ fild_s(Operand(rsp, 0));
+ __ fild_d(Operand(rsp, 0));
__ pop(kScratchRegister);
__ bind(&done);
@@ -6512,24 +6513,18 @@
void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
Label* non_float) {
Label test_other, done;
- // Test if both operands are floats or smi -> scratch=k_is_float;
- // Otherwise scratch = k_not_float.
+ // Test if both operands are numbers (heap_numbers or smis).
+ // If not, jump to label non_float.
__ testl(rdx, Immediate(kSmiTagMask));
__ j(zero, &test_other); // argument in rdx is OK
- __ movq(kScratchRegister,
- Factory::heap_number_map(),
- RelocInfo::EMBEDDED_OBJECT);
- __ cmpq(kScratchRegister, FieldOperand(rdx, HeapObject::kMapOffset));
- __ j(not_equal, non_float); // argument in rdx is not a number -> NaN
+ __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),Factory::heap_number_map());
+ __ j(not_equal, non_float); // The argument in rdx is not a number.
__ bind(&test_other);
__ testl(rax, Immediate(kSmiTagMask));
__ j(zero, &done); // argument in rax is OK
- __ movq(kScratchRegister,
- Factory::heap_number_map(),
- RelocInfo::EMBEDDED_OBJECT);
- __ cmpq(kScratchRegister, FieldOperand(rax, HeapObject::kMapOffset));
- __ j(not_equal, non_float); // argument in rax is not a number -> NaN
+ __ Cmp(FieldOperand(rax, HeapObject::kMapOffset),Factory::heap_number_map());
+ __ j(not_equal, non_float); // The argument in rax is not a number.
// Fall-through: Both operands are numbers.
__ bind(&done);
@@ -6792,6 +6787,7 @@
__ testl(rax, Immediate(1));
__ j(not_zero, &operand_conversion_failure);
} else {
+ // TODO(X64): Verify that SSE3 is always supported, drop this code.
// Check if right operand is int32.
__ fist_s(Operand(rsp, 0 * kPointerSize));
__ fild_s(Operand(rsp, 0 * kPointerSize));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698