Index: runtime/vm/intermediate_language.h |
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
index 28d0cea62a73fa8c4f0eee1c974987f953eefc2c..09feebc11b6ed47061474371ce0addf98d796e76 100644 |
--- a/runtime/vm/intermediate_language.h |
+++ b/runtime/vm/intermediate_language.h |
@@ -131,6 +131,11 @@ class Range; |
V(_Float64x2, abs, Float64x2Abs, 778551930) \ |
V(_Float64x2, sqrt, Float64x2Sqrt, 591345168) \ |
V(_Float64x2, get:signMask, Float64x2GetSignMask, 601579087) \ |
+ V(_Float64x2, scale, Float64x2Scale, 1781090062) \ |
+ V(_Float64x2, withX, Float64x2WithX, 1624377250) \ |
+ V(_Float64x2, withY, Float64x2WithY, 2078610265) \ |
+ V(_Float64x2, min, Float64x2Min, 876488999) \ |
+ V(_Float64x2, max, Float64x2Max, 389912972) \ |
V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ |
V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ |
893850947) \ |
@@ -772,6 +777,7 @@ class EmbeddedArray<T, 0> { |
M(Float64x2ToFloat32x4) \ |
M(Simd64x2Shuffle) \ |
M(Float64x2ZeroArg) \ |
+ M(Float64x2OneArg) \ |
#define FORWARD_DECLARATION(type) class type##Instr; |
@@ -1058,6 +1064,7 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) |
friend class Float32x4ToInt32x4Instr; |
friend class Simd64x2ShuffleInstr; |
friend class Float64x2ZeroArgInstr; |
+ friend class Float64x2OneArgInstr; |
friend class Float32x4ToFloat64x2Instr; |
friend class Float64x2ToFloat32x4Instr; |
friend class Float64x2ZeroInstr; |
@@ -6122,6 +6129,66 @@ class Float64x2ZeroArgInstr : public TemplateDefinition<1> { |
}; |
+class Float64x2OneArgInstr : public TemplateDefinition<2> { |
+ public: |
+ Float64x2OneArgInstr(MethodRecognizer::Kind op_kind, Value* left, |
+ Value* right, intptr_t deopt_id) : op_kind_(op_kind) { |
+ SetInputAt(0, left); |
+ SetInputAt(1, right); |
+ deopt_id_ = deopt_id; |
+ } |
+ |
+ Value* left() const { return inputs_[0]; } |
+ Value* right() const { return inputs_[1]; } |
+ |
+ MethodRecognizer::Kind op_kind() const { return op_kind_; } |
+ |
+ virtual void PrintOperandsTo(BufferFormatter* f) const; |
+ |
+ virtual bool CanDeoptimize() const { return false; } |
+ |
+ virtual Representation representation() const { |
+ return kUnboxedFloat64x2; |
+ } |
+ |
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
+ if (idx == 0) { |
+ return kUnboxedFloat64x2; |
+ } |
+ ASSERT(idx == 1); |
+ if ((op_kind() == MethodRecognizer::kFloat64x2WithX) || |
+ (op_kind() == MethodRecognizer::kFloat64x2WithY) || |
+ (op_kind() == MethodRecognizer::kFloat64x2Scale)) { |
+ return kUnboxedDouble; |
+ } |
+ return kUnboxedFloat64x2; |
+ } |
+ |
+ virtual intptr_t DeoptimizationTarget() const { |
+ // Direct access since this instruction cannot deoptimize, and the deopt-id |
+ // was inherited from another instruction that could deoptimize. |
+ return deopt_id_; |
+ } |
+ |
+ DECLARE_INSTRUCTION(Float64x2OneArg) |
+ virtual CompileType ComputeType() const; |
+ |
+ virtual bool AllowsCSE() const { return true; } |
+ virtual EffectSet Effects() const { return EffectSet::None(); } |
+ virtual EffectSet Dependencies() const { return EffectSet::None(); } |
+ virtual bool AttributesEqual(Instruction* other) const { |
+ return op_kind() == other->AsFloat64x2OneArg()->op_kind(); |
+ } |
+ |
+ virtual bool MayThrow() const { return false; } |
+ |
+ private: |
+ const MethodRecognizer::Kind op_kind_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(Float64x2OneArgInstr); |
+}; |
+ |
+ |
class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { |
public: |
Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, |