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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 2423843002: Add DoubleTestOp instruction (Closed)
Patch Set: Address comments Created 4 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
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index f92bbf439e83a7eab2e41ec5ef8942e67a1b97cf..04e559503683ed04ba89859b22455b2b841fb900 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -4142,6 +4142,49 @@ 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 = EvenDRegisterOf(locs()->in(0).fpu_reg());
+ const Register result = locs()->out(0).reg();
+ if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
+ __ LoadObject(result, Bool::False());
+ __ vcmpd(value, value);
+ __ vmstat();
+ __ LoadObject(result, Bool::True(), VS);
+ } else {
+ ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite);
+ Label done;
+ // TMP <- value[0:31], result <- value[32:63]
+ __ vmovrrd(TMP, result, value);
+ __ cmp(TMP, Operand(0));
+ __ LoadObject(result, Bool::False(), NE);
+ __ b(&done, NE);
+
+ // Mask off the sign bit.
+ __ AndImmediate(result, result, 0x7FFFFFFF);
+ // Compare with +infinity.
+ __ CompareImmediate(result, 0x7FF00000);
+ __ LoadObject(result, Bool::False(), NE);
+ __ b(&done, NE);
+
+ __ LoadObject(result, Bool::True());
+ __ Bind(&done);
+ }
+}
+
+
LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698