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:
m.m.capewell@googlemail.com 2014-04-28 13:33:14 +00:00
parent febbd1de7e
commit dc438dceec
4 changed files with 36 additions and 36 deletions

View File

@ -1196,8 +1196,8 @@ void MathPowStub::Generate(MacroAssembler* masm) {
if (exponent_type_ != INTEGER) {
// Detect integer exponents stored as doubles and handle those in the
// integer fast-path.
__ TryConvertDoubleToInt64(exponent_integer, exponent_double,
scratch0_double, &exponent_is_integer);
__ TryRepresentDoubleAsInt64(exponent_integer, exponent_double,
scratch0_double, &exponent_is_integer);
if (exponent_type_ == ON_STACK) {
FPRegister half_double = d3;

View File

@ -2757,7 +2757,7 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) {
DeoptimizeIfMinusZero(input, instr->environment());
}
__ TryConvertDoubleToInt32(result, input, double_scratch());
__ TryRepresentDoubleAsInt32(result, input, double_scratch());
DeoptimizeIf(ne, instr->environment());
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
// function. If the result is out of range, branch to deoptimize.
__ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset));
__ TryConvertDoubleToInt32(output, dbl_scratch1, dbl_scratch2);
__ TryRepresentDoubleAsInt32(output, dbl_scratch1, dbl_scratch2);
DeoptimizeIf(ne, instr->environment());
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {

View File

@ -2284,11 +2284,11 @@ void MacroAssembler::LookupNumberStringCache(Register object,
}
void MacroAssembler::TryConvertDoubleToInt(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion,
Label* on_failed_conversion) {
void MacroAssembler::TryRepresentDoubleAsInt(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion,
Label* on_failed_conversion) {
// Convert to an int and back again, then compare with the original value.
Fcvtzs(as_int, value);
Scvtf(scratch_d, as_int);

View File

@ -945,34 +945,34 @@ class MacroAssembler : public Assembler {
DoubleRegister input,
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
// 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.
void TryConvertDoubleToInt32(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL) {
// On output the Z flag is set if the operation was successful.
void TryRepresentDoubleAsInt32(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL) {
ASSERT(as_int.Is32Bits());
TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion,
on_failed_conversion);
TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_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
// 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.
void TryConvertDoubleToInt64(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL) {
// On output the Z flag is set if the operation was successful.
void TryRepresentDoubleAsInt64(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL) {
ASSERT(as_int.Is64Bits());
TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion,
on_failed_conversion);
TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
on_failed_conversion);
}
// ---- Object Utilities ----
@ -2073,7 +2073,7 @@ class MacroAssembler : public Assembler {
Condition cond, // eq for new space, ne otherwise.
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.
// It supports both 32-bit and 64-bit integers depending whether 'as_int'
// is a W or X register.
@ -2081,12 +2081,12 @@ class MacroAssembler : public Assembler {
// This does not distinguish between +0 and -0, so if this distinction is
// important it must be checked separately.
//
// On output the Z flag is set if the conversion was successful.
void TryConvertDoubleToInt(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL);
// On output the Z flag is set if the operation was successful.
void TryRepresentDoubleAsInt(Register as_int,
FPRegister value,
FPRegister scratch_d,
Label* on_successful_conversion = NULL,
Label* on_failed_conversion = NULL);
bool generating_stub_;
#if DEBUG