| Index: runtime/vm/flow_graph_optimizer.cc
|
| diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
|
| index 84879f5c9e46a2ed32f4687808a5d7137a6d9119..ce8165f1783877c3a3814ec26fbda3614448c0ba 100644
|
| --- a/runtime/vm/flow_graph_optimizer.cc
|
| +++ b/runtime/vm/flow_graph_optimizer.cc
|
| @@ -1505,8 +1505,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.
|
| @@ -1526,13 +1526,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;
|
| }
|
|
|
|
|
| @@ -1547,12 +1563,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;
|
| + }
|
| }
|
|
|
|
|
| @@ -1690,6 +1715,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;
|
| @@ -1698,7 +1724,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;
|
| @@ -6510,6 +6537,12 @@ void ConstantPropagator::VisitFloat32x4Shuffle(Float32x4ShuffleInstr* instr) {
|
| }
|
|
|
|
|
| +void ConstantPropagator::VisitSimd32x4GetSignMask(
|
| + Simd32x4GetSignMaskInstr* instr) {
|
| + SetValue(instr, non_constant_);
|
| +}
|
| +
|
| +
|
| void ConstantPropagator::VisitFloat32x4Zero(Float32x4ZeroInstr* instr) {
|
| SetValue(instr, non_constant_);
|
| }
|
| @@ -6561,6 +6594,7 @@ void ConstantPropagator::VisitFloat32x4ToUint32x4(
|
| SetValue(instr, non_constant_);
|
| }
|
|
|
| +
|
| void ConstantPropagator::VisitFloat32x4TwoArgShuffle(
|
| Float32x4TwoArgShuffleInstr* instr) {
|
| SetValue(instr, non_constant_);
|
|
|