Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 50ca8f2f51d49a21e60b191ce7e7851ff4929352..46fbd9c88f5a86dbd8bbbc795c63cac7710b970a 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -3517,17 +3517,16 @@ void MacroAssembler::TruncateDoubleToI(Register result_reg, |
} |
-void MacroAssembler::DoubleToI(Register result_reg, |
- XMMRegister input_reg, |
+void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg, |
XMMRegister scratch, |
MinusZeroMode minus_zero_mode, |
- Label* conversion_failed, |
- Label::Distance dst) { |
+ Label* lost_precision, Label* is_nan, |
+ Label* minus_zero, Label::Distance dst) { |
cvttsd2si(result_reg, input_reg); |
Cvtlsi2sd(xmm0, result_reg); |
ucomisd(xmm0, input_reg); |
- j(not_equal, conversion_failed, dst); |
- j(parity_even, conversion_failed, dst); // NaN. |
+ j(not_equal, lost_precision, dst); |
+ j(parity_even, is_nan, dst); // NaN. |
if (minus_zero_mode == FAIL_ON_MINUS_ZERO) { |
Label done; |
// The integer converted back is equal to the original. We |
@@ -3537,9 +3536,9 @@ void MacroAssembler::DoubleToI(Register result_reg, |
movmskpd(result_reg, input_reg); |
// Bit 0 contains the sign of the double in input_reg. |
// If input was positive, we are ok and return 0, otherwise |
- // jump to conversion_failed. |
+ // jump to minus_zero. |
andl(result_reg, Immediate(1)); |
- j(not_zero, conversion_failed, dst); |
+ j(not_zero, minus_zero, dst); |
bind(&done); |
} |
} |