Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 17634003: Fixes bugs in arm and mips intrinsifier. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698