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

Unified Diff: runtime/vm/intermediate_language_arm64.cc

Issue 475563002: Inline Int32x4 constructor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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_arm64.cc
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index fdd4d1ef18d07f205c6cab913282eeee7cfe6147..3369e014bb5702105795a58319b5acb19b07f60a 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -3939,6 +3939,35 @@ void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
+ Isolate* isolate, bool opt) const {
+ const intptr_t kNumInputs = 4;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary = new(isolate) LocationSummary(
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresRegister());
+ summary->set_in(1, Location::RequiresRegister());
+ summary->set_in(2, Location::RequiresRegister());
+ summary->set_in(3, Location::RequiresRegister());
+ summary->set_out(0, Location::RequiresFpuRegister());
+ return summary;
+}
+
+
+void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ const Register v0 = locs()->in(0).reg();
+ const Register v1 = locs()->in(1).reg();
+ const Register v2 = locs()->in(2).reg();
+ const Register v3 = locs()->in(3).reg();
+ const VRegister result = locs()->out(0).fpu_reg();
+ __ veor(result, result, result);
+ __ vinsw(result, 0, v0);
+ __ vinsw(result, 1, v1);
+ __ vinsw(result, 2, v2);
+ __ vinsw(result, 3, v3);
+}
+
+
LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
Isolate* isolate, bool opt) const {
const intptr_t kNumInputs = 4;
@@ -5128,13 +5157,30 @@ void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* UnboxUint32Instr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
- UNIMPLEMENTED();
- return NULL;
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary = new(isolate) LocationSummary(
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresRegister());
+ summary->set_out(0, Location::SameAsFirstInput());
+ return summary;
}
void UnboxUint32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ const intptr_t value_cid = value()->Type()->ToCid();
+ const Register value = locs()->in(0).reg();
+ ASSERT(value == locs()->out(0).reg());
+
+ if (value_cid == kSmiCid) {
+ __ SmiUntag(value);
+ } else {
+ Label* deopt = compiler->AddDeoptStub(deopt_id_,
+ ICData::kDeoptUnboxInteger);
+ __ tsti(value, kSmiTagMask);
+ __ b(deopt, NE);
+ __ SmiUntag(value);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698