ARM64: Rename TryConvertDoubleToInt64 function
There are two TryConvertDoubleToInt64 functions: one rounds, the other checks if a double can be exactly represented as an int. This patch renames the second instance to reflect its purpose more clearly. BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/258933008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
febbd1de7e
commit
dc438dceec
@ -1196,7 +1196,7 @@ void MathPowStub::Generate(MacroAssembler* masm) {
|
|||||||
if (exponent_type_ != INTEGER) {
|
if (exponent_type_ != INTEGER) {
|
||||||
// Detect integer exponents stored as doubles and handle those in the
|
// Detect integer exponents stored as doubles and handle those in the
|
||||||
// integer fast-path.
|
// integer fast-path.
|
||||||
__ TryConvertDoubleToInt64(exponent_integer, exponent_double,
|
__ TryRepresentDoubleAsInt64(exponent_integer, exponent_double,
|
||||||
scratch0_double, &exponent_is_integer);
|
scratch0_double, &exponent_is_integer);
|
||||||
|
|
||||||
if (exponent_type_ == ON_STACK) {
|
if (exponent_type_ == ON_STACK) {
|
||||||
|
@ -2757,7 +2757,7 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) {
|
|||||||
DeoptimizeIfMinusZero(input, instr->environment());
|
DeoptimizeIfMinusZero(input, instr->environment());
|
||||||
}
|
}
|
||||||
|
|
||||||
__ TryConvertDoubleToInt32(result, input, double_scratch());
|
__ TryRepresentDoubleAsInt32(result, input, double_scratch());
|
||||||
DeoptimizeIf(ne, instr->environment());
|
DeoptimizeIf(ne, instr->environment());
|
||||||
|
|
||||||
if (instr->tag_result()) {
|
if (instr->tag_result()) {
|
||||||
@ -5508,7 +5508,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr,
|
|||||||
// A heap number: load value and convert to int32 using non-truncating
|
// A heap number: load value and convert to int32 using non-truncating
|
||||||
// function. If the result is out of range, branch to deoptimize.
|
// function. If the result is out of range, branch to deoptimize.
|
||||||
__ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset));
|
__ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset));
|
||||||
__ TryConvertDoubleToInt32(output, dbl_scratch1, dbl_scratch2);
|
__ TryRepresentDoubleAsInt32(output, dbl_scratch1, dbl_scratch2);
|
||||||
DeoptimizeIf(ne, instr->environment());
|
DeoptimizeIf(ne, instr->environment());
|
||||||
|
|
||||||
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
||||||
|
@ -2284,7 +2284,7 @@ void MacroAssembler::LookupNumberStringCache(Register object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MacroAssembler::TryConvertDoubleToInt(Register as_int,
|
void MacroAssembler::TryRepresentDoubleAsInt(Register as_int,
|
||||||
FPRegister value,
|
FPRegister value,
|
||||||
FPRegister scratch_d,
|
FPRegister scratch_d,
|
||||||
Label* on_successful_conversion,
|
Label* on_successful_conversion,
|
||||||
|
@ -945,33 +945,33 @@ class MacroAssembler : public Assembler {
|
|||||||
DoubleRegister input,
|
DoubleRegister input,
|
||||||
DoubleRegister dbl_scratch);
|
DoubleRegister dbl_scratch);
|
||||||
|
|
||||||
// Try to convert a double to a signed 32-bit int.
|
// Try to represent a double as a signed 32-bit int.
|
||||||
// This succeeds if the result compares equal to the input, so inputs of -0.0
|
// This succeeds if the result compares equal to the input, so inputs of -0.0
|
||||||
// are converted to 0 and handled as a success.
|
// are represented as 0 and handled as a success.
|
||||||
//
|
//
|
||||||
// On output the Z flag is set if the conversion was successful.
|
// On output the Z flag is set if the operation was successful.
|
||||||
void TryConvertDoubleToInt32(Register as_int,
|
void TryRepresentDoubleAsInt32(Register as_int,
|
||||||
FPRegister value,
|
FPRegister value,
|
||||||
FPRegister scratch_d,
|
FPRegister scratch_d,
|
||||||
Label* on_successful_conversion = NULL,
|
Label* on_successful_conversion = NULL,
|
||||||
Label* on_failed_conversion = NULL) {
|
Label* on_failed_conversion = NULL) {
|
||||||
ASSERT(as_int.Is32Bits());
|
ASSERT(as_int.Is32Bits());
|
||||||
TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion,
|
TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
|
||||||
on_failed_conversion);
|
on_failed_conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to convert a double to a signed 64-bit int.
|
// Try to represent a double as a signed 64-bit int.
|
||||||
// This succeeds if the result compares equal to the input, so inputs of -0.0
|
// This succeeds if the result compares equal to the input, so inputs of -0.0
|
||||||
// are converted to 0 and handled as a success.
|
// are represented as 0 and handled as a success.
|
||||||
//
|
//
|
||||||
// On output the Z flag is set if the conversion was successful.
|
// On output the Z flag is set if the operation was successful.
|
||||||
void TryConvertDoubleToInt64(Register as_int,
|
void TryRepresentDoubleAsInt64(Register as_int,
|
||||||
FPRegister value,
|
FPRegister value,
|
||||||
FPRegister scratch_d,
|
FPRegister scratch_d,
|
||||||
Label* on_successful_conversion = NULL,
|
Label* on_successful_conversion = NULL,
|
||||||
Label* on_failed_conversion = NULL) {
|
Label* on_failed_conversion = NULL) {
|
||||||
ASSERT(as_int.Is64Bits());
|
ASSERT(as_int.Is64Bits());
|
||||||
TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion,
|
TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
|
||||||
on_failed_conversion);
|
on_failed_conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2073,7 +2073,7 @@ class MacroAssembler : public Assembler {
|
|||||||
Condition cond, // eq for new space, ne otherwise.
|
Condition cond, // eq for new space, ne otherwise.
|
||||||
Label* branch);
|
Label* branch);
|
||||||
|
|
||||||
// Try to convert a double to an int so that integer fast-paths may be
|
// Try to represent a double as an int so that integer fast-paths may be
|
||||||
// used. Not every valid integer value is guaranteed to be caught.
|
// used. Not every valid integer value is guaranteed to be caught.
|
||||||
// It supports both 32-bit and 64-bit integers depending whether 'as_int'
|
// It supports both 32-bit and 64-bit integers depending whether 'as_int'
|
||||||
// is a W or X register.
|
// is a W or X register.
|
||||||
@ -2081,8 +2081,8 @@ class MacroAssembler : public Assembler {
|
|||||||
// This does not distinguish between +0 and -0, so if this distinction is
|
// This does not distinguish between +0 and -0, so if this distinction is
|
||||||
// important it must be checked separately.
|
// important it must be checked separately.
|
||||||
//
|
//
|
||||||
// On output the Z flag is set if the conversion was successful.
|
// On output the Z flag is set if the operation was successful.
|
||||||
void TryConvertDoubleToInt(Register as_int,
|
void TryRepresentDoubleAsInt(Register as_int,
|
||||||
FPRegister value,
|
FPRegister value,
|
||||||
FPRegister scratch_d,
|
FPRegister scratch_d,
|
||||||
Label* on_successful_conversion = NULL,
|
Label* on_successful_conversion = NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user