OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 V(Float64x2, Float64x2., Float64x2Constructor, 1283521526) \ | 124 V(Float64x2, Float64x2., Float64x2Constructor, 1283521526) \ |
125 V(Float64x2, Float64x2.zero, Float64x2Zero, 1971574037) \ | 125 V(Float64x2, Float64x2.zero, Float64x2Zero, 1971574037) \ |
126 V(Float64x2, Float64x2.splat, Float64x2Splat, 823230813) \ | 126 V(Float64x2, Float64x2.splat, Float64x2Splat, 823230813) \ |
127 V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1383666060) \ | 127 V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1383666060) \ |
128 V(_Float64x2, get:x, Float64x2GetX, 176817227) \ | 128 V(_Float64x2, get:x, Float64x2GetX, 176817227) \ |
129 V(_Float64x2, get:y, Float64x2GetY, 1858031019) \ | 129 V(_Float64x2, get:y, Float64x2GetY, 1858031019) \ |
130 V(_Float64x2, _negate, Float64x2Negate, 1345265430) \ | 130 V(_Float64x2, _negate, Float64x2Negate, 1345265430) \ |
131 V(_Float64x2, abs, Float64x2Abs, 778551930) \ | 131 V(_Float64x2, abs, Float64x2Abs, 778551930) \ |
132 V(_Float64x2, sqrt, Float64x2Sqrt, 591345168) \ | 132 V(_Float64x2, sqrt, Float64x2Sqrt, 591345168) \ |
133 V(_Float64x2, get:signMask, Float64x2GetSignMask, 601579087) \ | 133 V(_Float64x2, get:signMask, Float64x2GetSignMask, 601579087) \ |
| 134 V(_Float64x2, scale, Float64x2Scale, 1781090062) \ |
| 135 V(_Float64x2, withX, Float64x2WithX, 1624377250) \ |
| 136 V(_Float64x2, withY, Float64x2WithY, 2078610265) \ |
| 137 V(_Float64x2, min, Float64x2Min, 876488999) \ |
| 138 V(_Float64x2, max, Float64x2Max, 389912972) \ |
134 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ | 139 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ |
135 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ | 140 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ |
136 893850947) \ | 141 893850947) \ |
137 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ | 142 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ |
138 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ | 143 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ |
139 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ | 144 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ |
140 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ | 145 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ |
141 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ | 146 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ |
142 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ | 147 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ |
143 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ | 148 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 M(BoxFloat64x2) \ | 770 M(BoxFloat64x2) \ |
766 M(UnboxFloat64x2) \ | 771 M(UnboxFloat64x2) \ |
767 M(BinaryFloat64x2Op) \ | 772 M(BinaryFloat64x2Op) \ |
768 M(Float64x2Zero) \ | 773 M(Float64x2Zero) \ |
769 M(Float64x2Constructor) \ | 774 M(Float64x2Constructor) \ |
770 M(Float64x2Splat) \ | 775 M(Float64x2Splat) \ |
771 M(Float32x4ToFloat64x2) \ | 776 M(Float32x4ToFloat64x2) \ |
772 M(Float64x2ToFloat32x4) \ | 777 M(Float64x2ToFloat32x4) \ |
773 M(Simd64x2Shuffle) \ | 778 M(Simd64x2Shuffle) \ |
774 M(Float64x2ZeroArg) \ | 779 M(Float64x2ZeroArg) \ |
| 780 M(Float64x2OneArg) \ |
775 | 781 |
776 | 782 |
777 #define FORWARD_DECLARATION(type) class type##Instr; | 783 #define FORWARD_DECLARATION(type) class type##Instr; |
778 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) | 784 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
779 #undef FORWARD_DECLARATION | 785 #undef FORWARD_DECLARATION |
780 | 786 |
781 | 787 |
782 // Functions required in all concrete instruction classes. | 788 // Functions required in all concrete instruction classes. |
783 #define DECLARE_INSTRUCTION(type) \ | 789 #define DECLARE_INSTRUCTION(type) \ |
784 virtual Tag tag() const { return k##type; } \ | 790 virtual Tag tag() const { return k##type; } \ |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 friend class Float32x4ComparisonInstr; | 1057 friend class Float32x4ComparisonInstr; |
1052 friend class Float32x4MinMaxInstr; | 1058 friend class Float32x4MinMaxInstr; |
1053 friend class Float32x4ScaleInstr; | 1059 friend class Float32x4ScaleInstr; |
1054 friend class Float32x4SqrtInstr; | 1060 friend class Float32x4SqrtInstr; |
1055 friend class Float32x4ZeroArgInstr; | 1061 friend class Float32x4ZeroArgInstr; |
1056 friend class Float32x4ClampInstr; | 1062 friend class Float32x4ClampInstr; |
1057 friend class Float32x4WithInstr; | 1063 friend class Float32x4WithInstr; |
1058 friend class Float32x4ToInt32x4Instr; | 1064 friend class Float32x4ToInt32x4Instr; |
1059 friend class Simd64x2ShuffleInstr; | 1065 friend class Simd64x2ShuffleInstr; |
1060 friend class Float64x2ZeroArgInstr; | 1066 friend class Float64x2ZeroArgInstr; |
| 1067 friend class Float64x2OneArgInstr; |
1061 friend class Float32x4ToFloat64x2Instr; | 1068 friend class Float32x4ToFloat64x2Instr; |
1062 friend class Float64x2ToFloat32x4Instr; | 1069 friend class Float64x2ToFloat32x4Instr; |
1063 friend class Float64x2ZeroInstr; | 1070 friend class Float64x2ZeroInstr; |
1064 friend class Float64x2SplatInstr; | 1071 friend class Float64x2SplatInstr; |
1065 friend class Float64x2ConstructorInstr; | 1072 friend class Float64x2ConstructorInstr; |
1066 friend class Int32x4BoolConstructorInstr; | 1073 friend class Int32x4BoolConstructorInstr; |
1067 friend class Int32x4GetFlagInstr; | 1074 friend class Int32x4GetFlagInstr; |
1068 friend class Int32x4SetFlagInstr; | 1075 friend class Int32x4SetFlagInstr; |
1069 friend class Int32x4SelectInstr; | 1076 friend class Int32x4SelectInstr; |
1070 friend class Int32x4ToFloat32x4Instr; | 1077 friend class Int32x4ToFloat32x4Instr; |
(...skipping 5044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6115 | 6122 |
6116 virtual bool MayThrow() const { return false; } | 6123 virtual bool MayThrow() const { return false; } |
6117 | 6124 |
6118 private: | 6125 private: |
6119 const MethodRecognizer::Kind op_kind_; | 6126 const MethodRecognizer::Kind op_kind_; |
6120 | 6127 |
6121 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroArgInstr); | 6128 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroArgInstr); |
6122 }; | 6129 }; |
6123 | 6130 |
6124 | 6131 |
| 6132 class Float64x2OneArgInstr : public TemplateDefinition<2> { |
| 6133 public: |
| 6134 Float64x2OneArgInstr(MethodRecognizer::Kind op_kind, Value* left, |
| 6135 Value* right, intptr_t deopt_id) : op_kind_(op_kind) { |
| 6136 SetInputAt(0, left); |
| 6137 SetInputAt(1, right); |
| 6138 deopt_id_ = deopt_id; |
| 6139 } |
| 6140 |
| 6141 Value* left() const { return inputs_[0]; } |
| 6142 Value* right() const { return inputs_[1]; } |
| 6143 |
| 6144 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
| 6145 |
| 6146 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 6147 |
| 6148 virtual bool CanDeoptimize() const { return false; } |
| 6149 |
| 6150 virtual Representation representation() const { |
| 6151 return kUnboxedFloat64x2; |
| 6152 } |
| 6153 |
| 6154 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 6155 if (idx == 0) { |
| 6156 return kUnboxedFloat64x2; |
| 6157 } |
| 6158 ASSERT(idx == 1); |
| 6159 if ((op_kind() == MethodRecognizer::kFloat64x2WithX) || |
| 6160 (op_kind() == MethodRecognizer::kFloat64x2WithY) || |
| 6161 (op_kind() == MethodRecognizer::kFloat64x2Scale)) { |
| 6162 return kUnboxedDouble; |
| 6163 } |
| 6164 return kUnboxedFloat64x2; |
| 6165 } |
| 6166 |
| 6167 virtual intptr_t DeoptimizationTarget() const { |
| 6168 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 6169 // was inherited from another instruction that could deoptimize. |
| 6170 return deopt_id_; |
| 6171 } |
| 6172 |
| 6173 DECLARE_INSTRUCTION(Float64x2OneArg) |
| 6174 virtual CompileType ComputeType() const; |
| 6175 |
| 6176 virtual bool AllowsCSE() const { return true; } |
| 6177 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 6178 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 6179 virtual bool AttributesEqual(Instruction* other) const { |
| 6180 return op_kind() == other->AsFloat64x2OneArg()->op_kind(); |
| 6181 } |
| 6182 |
| 6183 virtual bool MayThrow() const { return false; } |
| 6184 |
| 6185 private: |
| 6186 const MethodRecognizer::Kind op_kind_; |
| 6187 |
| 6188 DISALLOW_COPY_AND_ASSIGN(Float64x2OneArgInstr); |
| 6189 }; |
| 6190 |
| 6191 |
6125 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { | 6192 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { |
6126 public: | 6193 public: |
6127 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, | 6194 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, |
6128 Value* value3, intptr_t deopt_id) { | 6195 Value* value3, intptr_t deopt_id) { |
6129 SetInputAt(0, value0); | 6196 SetInputAt(0, value0); |
6130 SetInputAt(1, value1); | 6197 SetInputAt(1, value1); |
6131 SetInputAt(2, value2); | 6198 SetInputAt(2, value2); |
6132 SetInputAt(3, value3); | 6199 SetInputAt(3, value3); |
6133 deopt_id_ = deopt_id; | 6200 deopt_id_ = deopt_id; |
6134 } | 6201 } |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7616 ForwardInstructionIterator* current_iterator_; | 7683 ForwardInstructionIterator* current_iterator_; |
7617 | 7684 |
7618 private: | 7685 private: |
7619 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7686 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7620 }; | 7687 }; |
7621 | 7688 |
7622 | 7689 |
7623 } // namespace dart | 7690 } // namespace dart |
7624 | 7691 |
7625 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7692 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |