Chromium Code Reviews| Index: runtime/vm/intermediate_language_mips.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language_mips.cc (revision 24410) |
| +++ runtime/vm/intermediate_language_mips.cc (working copy) |
| @@ -3037,13 +3037,18 @@ |
| LocationSummary* MathSqrtInstr::MakeLocationSummary() const { |
| - UNIMPLEMENTED(); |
| - return NULL; |
| + const intptr_t kNumInputs = 1; |
| + const intptr_t kNumTemps = 0; |
| + LocationSummary* summary = |
| + new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| + summary->set_in(0, Location::RequiresFpuRegister()); |
| + summary->set_out(Location::RequiresFpuRegister()); |
| + return summary; |
| } |
| void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| - UNIMPLEMENTED(); |
| + __ sqrtd(locs()->out().fpu_reg(), locs()->in(0).fpu_reg()); |
| } |
| @@ -3113,13 +3118,26 @@ |
| LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const { |
| - UNIMPLEMENTED(); |
| - return NULL; |
| + const intptr_t kNumInputs = 1; |
| + const intptr_t kNumTemps = 0; |
| + LocationSummary* result = new LocationSummary( |
| + kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| + result->set_in(0, Location::RequiresFpuRegister()); |
| + result->set_out(Location::RequiresRegister()); |
| + return result; |
| } |
| void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| - UNIMPLEMENTED(); |
| + Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptDoubleToSmi); |
| + Register result = locs()->out().reg(); |
| + DRegister value = locs()->in(0).fpu_reg(); |
| + __ cvtwd(STMP1, value); |
| + __ mfc1(result, STMP1); |
| + |
| + // Check for overflow and that it fits into Smi. |
| + __ BranchUnsignedLess(result, 0xC0000000, deopt); |
|
regis
2013/06/25 17:05:16
Why not BranchSignedLess?
Don't we check for < 0xC
zra
2013/06/25 17:34:30
Whoops. BranchSignedLess isn't the same as MI on A
|
| + __ SmiTag(result); |
| } |