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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 1425143003: VM: Improve and fix double negation on MIPS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 564245c75933cd51d091ead709543bb5dc1f6747..04713cd2f0f51a5329b3791f3277075e7473927d 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -4118,25 +4118,19 @@ void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = 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::RequiresFpuRegister());
- summary->set_temp(0, Location::RequiresFpuRegister());
return summary;
}
void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- // TODO(zra): Implement vneg.
- const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1));
- __ LoadObject(TMP, minus_one);
FpuRegister result = locs()->out(0).fpu_reg();
FpuRegister value = locs()->in(0).fpu_reg();
- FpuRegister temp_fp = locs()->temp(0).fpu_reg();
- __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag);
- __ muld(result, value, temp_fp);
+ __ negd(result, value);
}

Powered by Google App Engine
This is Rietveld 408576698