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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 22947006: Add signMask getter to Float32x4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/disassembler_x64.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index a8ec05ecdb04881a404230e4f34fdf402972d026..41bb43955972393ea38bb107af4d16fdef862b6a 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1507,8 +1507,8 @@ bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
call);
intptr_t mask = 0;
if (getter == MethodRecognizer::kFloat32x4Shuffle) {
- ASSERT(call->ArgumentCount() == 2);
// Extract shuffle mask.
+ ASSERT(call->ArgumentCount() == 2);
Definition* mask_definition = call->ArgumentAt(1);
if (!mask_definition->IsConstant()) {
// Not a constant.
@@ -1528,13 +1528,29 @@ bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
return false;
}
}
- Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr(
- getter,
- new Value(call->ArgumentAt(0)),
- mask,
- call->deopt_id());
- ReplaceCall(call, instr);
- return true;
+ if (getter == MethodRecognizer::kFloat32x4GetSignMask) {
+ Simd32x4GetSignMaskInstr* instr = new Simd32x4GetSignMaskInstr(
+ getter,
+ new Value(call->ArgumentAt(0)),
+ call->deopt_id());
+ ReplaceCall(call, instr);
+ return true;
+ } else {
+ ASSERT((getter == MethodRecognizer::kFloat32x4Shuffle) ||
+ (getter == MethodRecognizer::kFloat32x4ShuffleX) ||
+ (getter == MethodRecognizer::kFloat32x4ShuffleY) ||
+ (getter == MethodRecognizer::kFloat32x4ShuffleZ) ||
+ (getter == MethodRecognizer::kFloat32x4ShuffleW));
+ Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr(
+ getter,
+ new Value(call->ArgumentAt(0)),
+ mask,
+ call->deopt_id());
+ ReplaceCall(call, instr);
+ return true;
+ }
+ UNREACHABLE();
+ return false;
}
@@ -1549,12 +1565,21 @@ bool FlowGraphOptimizer::InlineUint32x4Getter(InstanceCallInstr* call,
call->deopt_id(),
call->env(),
call);
- Uint32x4GetFlagInstr* instr = new Uint32x4GetFlagInstr(
- getter,
- new Value(call->ArgumentAt(0)),
- call->deopt_id());
- ReplaceCall(call, instr);
- return true;
+ if (getter == MethodRecognizer::kUint32x4GetSignMask) {
+ Simd32x4GetSignMaskInstr* instr = new Simd32x4GetSignMaskInstr(
+ getter,
+ new Value(call->ArgumentAt(0)),
+ call->deopt_id());
+ ReplaceCall(call, instr);
+ return true;
+ } else {
+ Uint32x4GetFlagInstr* instr = new Uint32x4GetFlagInstr(
+ getter,
+ new Value(call->ArgumentAt(0)),
+ call->deopt_id());
+ ReplaceCall(call, instr);
+ return true;
+ }
}
@@ -1692,6 +1717,7 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
case MethodRecognizer::kFloat32x4ShuffleY:
case MethodRecognizer::kFloat32x4ShuffleZ:
case MethodRecognizer::kFloat32x4ShuffleW:
+ case MethodRecognizer::kFloat32x4GetSignMask:
if (!ic_data.HasReceiverClassId(kFloat32x4Cid) ||
!ic_data.HasOneTarget()) {
return false;
@@ -1700,7 +1726,8 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
case MethodRecognizer::kUint32x4GetFlagX:
case MethodRecognizer::kUint32x4GetFlagY:
case MethodRecognizer::kUint32x4GetFlagZ:
- case MethodRecognizer::kUint32x4GetFlagW: {
+ case MethodRecognizer::kUint32x4GetFlagW:
+ case MethodRecognizer::kUint32x4GetSignMask: {
if (!ic_data.HasReceiverClassId(kUint32x4Cid) ||
!ic_data.HasOneTarget()) {
return false;
@@ -6513,6 +6540,12 @@ void ConstantPropagator::VisitFloat32x4Shuffle(Float32x4ShuffleInstr* instr) {
}
+void ConstantPropagator::VisitSimd32x4GetSignMask(
+ Simd32x4GetSignMaskInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
void ConstantPropagator::VisitFloat32x4Zero(Float32x4ZeroInstr* instr) {
SetValue(instr, non_constant_);
}
@@ -6564,6 +6597,7 @@ void ConstantPropagator::VisitFloat32x4ToUint32x4(
SetValue(instr, non_constant_);
}
+
void ConstantPropagator::VisitFloat32x4TwoArgShuffle(
Float32x4TwoArgShuffleInstr* instr) {
SetValue(instr, non_constant_);
« no previous file with comments | « runtime/vm/disassembler_x64.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698