| Index: runtime/vm/intermediate_language_mips.cc
|
| diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
|
| index e824df18862e5c411a9bf1cc4128604139ea1d92..d61337d52f38a965917fbdb336448c81a91d5052 100644
|
| --- a/runtime/vm/intermediate_language_mips.cc
|
| +++ b/runtime/vm/intermediate_language_mips.cc
|
| @@ -3692,6 +3692,51 @@ void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| +LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
|
| + bool opt) const {
|
| + const intptr_t kNumInputs = 1;
|
| + const intptr_t kNumTemps = 0;
|
| + LocationSummary* summary = new(zone) LocationSummary(
|
| + zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
|
| + summary->set_in(0, Location::RequiresFpuRegister());
|
| + summary->set_out(0, Location::RequiresRegister());
|
| + return summary;
|
| +}
|
| +
|
| +
|
| +void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + ASSERT(compiler->is_optimizing());
|
| + const DRegister value = locs()->in(0).fpu_reg();
|
| + const Register result = locs()->out(0).reg();
|
| + if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
|
| + Label is_not_nan;
|
| + __ LoadObject(result, Bool::False());
|
| + __ cund(value, value);
|
| + __ bc1f(&is_not_nan);
|
| + __ LoadObject(result, Bool::True());
|
| + __ Bind(&is_not_nan);
|
| + } else {
|
| + ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
|
| + Label not_inf, done;
|
| + __ mfc1(TMP, EvenFRegisterOf(value));
|
| + __ mfc1(result, OddFRegisterOf(value));
|
| + // If the low word isn't zero, then it isn't infinity.
|
| + __ bne(TMP, ZR, ¬_inf);
|
| + // Mask off the sign bit.
|
| + __ AndImmediate(result, result, 0x7FFFFFFF);
|
| + // Compare with +infinity.
|
| + __ BranchNotEqual(result, Immediate(0x7FF00000), ¬_inf);
|
| +
|
| + __ LoadObject(result, Bool::True());
|
| + __ b(&done);
|
| +
|
| + __ Bind(¬_inf);
|
| + __ LoadObject(result, Bool::False());
|
| + __ Bind(&done);
|
| + }
|
| +}
|
| +
|
| +
|
| LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
|
| bool opt) const {
|
| UNIMPLEMENTED();
|
| @@ -4536,10 +4581,10 @@ static void InvokeDoublePow(FlowGraphCompiler* compiler,
|
| __ Bind(&try_sqrt);
|
| // Before calling pow, check if we could use sqrt instead of pow.
|
| __ LoadImmediate(result, kPosInfinity);
|
| - // base == -Infinity -> call pow;
|
| + // base == Infinity -> call pow;
|
| __ ceqd(base, result);
|
| Label do_pow;
|
| - __ b(&do_pow);
|
| + __ bc1t(&do_pow);
|
|
|
| // exponent == 0.5 ?
|
| __ LoadImmediate(result, 0.5);
|
|
|