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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 V(::, cos, MathCos, 1282146521) \ | 86 V(::, cos, MathCos, 1282146521) \ |
87 V(::, min, MathMin, 1830216388) \ | 87 V(::, min, MathMin, 1830216388) \ |
88 V(::, max, MathMax, 234565686) \ | 88 V(::, max, MathMax, 234565686) \ |
89 V(::, _doublePow, MathDoublePow, 1728171041) \ | 89 V(::, _doublePow, MathDoublePow, 1728171041) \ |
90 V(Float32x4, Float32x4., Float32x4Constructor, 786169160) \ | 90 V(Float32x4, Float32x4., Float32x4Constructor, 786169160) \ |
91 V(Float32x4, Float32x4.zero, Float32x4Zero, 1589383280) \ | 91 V(Float32x4, Float32x4.zero, Float32x4Zero, 1589383280) \ |
92 V(Float32x4, Float32x4.splat, Float32x4Splat, 62513275) \ | 92 V(Float32x4, Float32x4.splat, Float32x4Splat, 62513275) \ |
93 V(Float32x4, Float32x4.fromUint32x4Bits, Float32x4FromUint32x4Bits, \ | 93 V(Float32x4, Float32x4.fromUint32x4Bits, Float32x4FromUint32x4Bits, \ |
94 770033146) \ | 94 770033146) \ |
95 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ | 95 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ |
| 96 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 927956119) \ |
96 V(_Float32x4, get:x, Float32x4ShuffleX, 1351717838) \ | 97 V(_Float32x4, get:x, Float32x4ShuffleX, 1351717838) \ |
97 V(_Float32x4, get:y, Float32x4ShuffleY, 217386410) \ | 98 V(_Float32x4, get:y, Float32x4ShuffleY, 217386410) \ |
98 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144923721) \ | 99 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144923721) \ |
99 V(_Float32x4, get:w, Float32x4ShuffleW, 1447699119) \ | 100 V(_Float32x4, get:w, Float32x4ShuffleW, 1447699119) \ |
100 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198849347) \ | 101 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198849347) \ |
101 V(_Float32x4, _cmpequal, Float32x4Equal, 2141256163) \ | 102 V(_Float32x4, _cmpequal, Float32x4Equal, 2141256163) \ |
102 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 696292270) \ | 103 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 696292270) \ |
103 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1199333164) \ | 104 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1199333164) \ |
104 V(_Float32x4, _cmplt, Float32x4LessThan, 943396590) \ | 105 V(_Float32x4, _cmplt, Float32x4LessThan, 943396590) \ |
105 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 57211241) \ | 106 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 57211241) \ |
106 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1234888884) \ | 107 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1234888884) \ |
107 V(_Float32x4, _min, Float32x4Min, 1166664658) \ | 108 V(_Float32x4, _min, Float32x4Min, 1166664658) \ |
108 V(_Float32x4, _max, Float32x4Max, 343968921) \ | 109 V(_Float32x4, _max, Float32x4Max, 343968921) \ |
109 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ | 110 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ |
110 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ | 111 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ |
111 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ | 112 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ |
112 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ | 113 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ |
113 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ | 114 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ |
114 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ | 115 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ |
115 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ | 116 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ |
116 V(_Float32x4, withX, Float32x4WithX, 795284225) \ | 117 V(_Float32x4, withX, Float32x4WithX, 795284225) \ |
117 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ | 118 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ |
118 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ | 119 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ |
119 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ | 120 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ |
120 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 1198101679) \ | |
121 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 2001324072) \ | |
122 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 928280031) \ | |
123 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 1046078993) \ | |
124 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 1001751955) \ | |
125 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 517444095) \ | 121 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 517444095) \ |
126 V(Uint32x4, Uint32x4.fromFloat32x4Bits, Uint32x4FromFloat32x4Bits, \ | 122 V(Uint32x4, Uint32x4.fromFloat32x4Bits, Uint32x4FromFloat32x4Bits, \ |
127 1080034855) \ | 123 1080034855) \ |
128 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 1674696792) \ | 124 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 1674696792) \ |
129 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 2013200152) \ | 125 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 2013200152) \ |
130 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 944733935) \ | 126 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 944733935) \ |
131 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 22746169) \ | 127 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 22746169) \ |
132 V(_Uint32x4, get:signMask, Uint32x4GetSignMask, 1858144083) \ | 128 V(_Uint32x4, get:signMask, Uint32x4GetSignMask, 1858144083) \ |
| 129 V(_Uint32x4, shuffle, Uint32x4Shuffle, 146209630) \ |
| 130 V(_Uint32x4, shuffleMix, Uint32x4ShuffleMix, 1251494596) \ |
133 V(_Uint32x4, select, Uint32x4Select, 72244182) \ | 131 V(_Uint32x4, select, Uint32x4Select, 72244182) \ |
134 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 1475542073) \ | 132 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 1475542073) \ |
135 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 830610988) \ | 133 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 830610988) \ |
136 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1714792414) \ | 134 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1714792414) \ |
137 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 1516924162) \ | 135 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 1516924162) \ |
138 V(_List, [], ObjectArrayGetIndexed, 1079829188) \ | 136 V(_List, [], ObjectArrayGetIndexed, 1079829188) \ |
139 V(_List, []=, ObjectArraySetIndexed, 748954698) \ | 137 V(_List, []=, ObjectArraySetIndexed, 748954698) \ |
140 V(_ImmutableList, [], ImmutableArrayGetIndexed, 25983597) \ | 138 V(_ImmutableList, [], ImmutableArrayGetIndexed, 25983597) \ |
141 V(_GrowableList, [], GrowableArrayGetIndexed, 1686777561) \ | 139 V(_GrowableList, [], GrowableArrayGetIndexed, 1686777561) \ |
142 V(_GrowableList, []=, GrowableArraySetIndexed, 327404102) \ | 140 V(_GrowableList, []=, GrowableArraySetIndexed, 327404102) \ |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 M(ShiftMintOp) \ | 663 M(ShiftMintOp) \ |
666 M(UnaryMintOp) \ | 664 M(UnaryMintOp) \ |
667 M(CheckArrayBound) \ | 665 M(CheckArrayBound) \ |
668 M(Constraint) \ | 666 M(Constraint) \ |
669 M(StringFromCharCode) \ | 667 M(StringFromCharCode) \ |
670 M(StringInterpolate) \ | 668 M(StringInterpolate) \ |
671 M(InvokeMathCFunction) \ | 669 M(InvokeMathCFunction) \ |
672 M(GuardField) \ | 670 M(GuardField) \ |
673 M(IfThenElse) \ | 671 M(IfThenElse) \ |
674 M(BinaryFloat32x4Op) \ | 672 M(BinaryFloat32x4Op) \ |
675 M(Float32x4Shuffle) \ | 673 M(Simd32x4Shuffle) \ |
| 674 M(Simd32x4ShuffleMix) \ |
676 M(Simd32x4GetSignMask) \ | 675 M(Simd32x4GetSignMask) \ |
677 M(Float32x4Constructor) \ | 676 M(Float32x4Constructor) \ |
678 M(Float32x4Zero) \ | 677 M(Float32x4Zero) \ |
679 M(Float32x4Splat) \ | 678 M(Float32x4Splat) \ |
680 M(Float32x4Comparison) \ | 679 M(Float32x4Comparison) \ |
681 M(Float32x4MinMax) \ | 680 M(Float32x4MinMax) \ |
682 M(Float32x4Scale) \ | 681 M(Float32x4Scale) \ |
683 M(Float32x4Sqrt) \ | 682 M(Float32x4Sqrt) \ |
684 M(Float32x4ZeroArg) \ | 683 M(Float32x4ZeroArg) \ |
685 M(Float32x4Clamp) \ | 684 M(Float32x4Clamp) \ |
686 M(Float32x4With) \ | 685 M(Float32x4With) \ |
687 M(Float32x4ToUint32x4) \ | 686 M(Float32x4ToUint32x4) \ |
688 M(Float32x4TwoArgShuffle) \ | |
689 M(MaterializeObject) \ | 687 M(MaterializeObject) \ |
690 M(Uint32x4BoolConstructor) \ | 688 M(Uint32x4BoolConstructor) \ |
691 M(Uint32x4GetFlag) \ | 689 M(Uint32x4GetFlag) \ |
692 M(Uint32x4Select) \ | 690 M(Uint32x4Select) \ |
693 M(Uint32x4SetFlag) \ | 691 M(Uint32x4SetFlag) \ |
694 M(Uint32x4ToFloat32x4) \ | 692 M(Uint32x4ToFloat32x4) \ |
695 M(BinaryUint32x4Op) \ | 693 M(BinaryUint32x4Op) \ |
696 | 694 |
697 | 695 |
698 #define FORWARD_DECLARATION(type) class type##Instr; | 696 #define FORWARD_DECLARATION(type) class type##Instr; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 953 |
956 // Classes that set or read deopt_id_. | 954 // Classes that set or read deopt_id_. |
957 friend class UnboxIntegerInstr; | 955 friend class UnboxIntegerInstr; |
958 friend class UnboxDoubleInstr; | 956 friend class UnboxDoubleInstr; |
959 friend class UnboxFloat32x4Instr; | 957 friend class UnboxFloat32x4Instr; |
960 friend class UnboxUint32x4Instr; | 958 friend class UnboxUint32x4Instr; |
961 friend class BinaryDoubleOpInstr; | 959 friend class BinaryDoubleOpInstr; |
962 friend class BinaryFloat32x4OpInstr; | 960 friend class BinaryFloat32x4OpInstr; |
963 friend class Float32x4ZeroInstr; | 961 friend class Float32x4ZeroInstr; |
964 friend class Float32x4SplatInstr; | 962 friend class Float32x4SplatInstr; |
965 friend class Float32x4ShuffleInstr; | 963 friend class Simd32x4ShuffleInstr; |
| 964 friend class Simd32x4ShuffleMixInstr; |
966 friend class Simd32x4GetSignMaskInstr; | 965 friend class Simd32x4GetSignMaskInstr; |
967 friend class Float32x4ConstructorInstr; | 966 friend class Float32x4ConstructorInstr; |
968 friend class Float32x4ComparisonInstr; | 967 friend class Float32x4ComparisonInstr; |
969 friend class Float32x4MinMaxInstr; | 968 friend class Float32x4MinMaxInstr; |
970 friend class Float32x4ScaleInstr; | 969 friend class Float32x4ScaleInstr; |
971 friend class Float32x4SqrtInstr; | 970 friend class Float32x4SqrtInstr; |
972 friend class Float32x4ZeroArgInstr; | 971 friend class Float32x4ZeroArgInstr; |
973 friend class Float32x4ClampInstr; | 972 friend class Float32x4ClampInstr; |
974 friend class Float32x4WithInstr; | 973 friend class Float32x4WithInstr; |
975 friend class Float32x4ToUint32x4Instr; | 974 friend class Float32x4ToUint32x4Instr; |
976 friend class Float32x4TwoArgShuffleInstr; | |
977 friend class Uint32x4BoolConstructorInstr; | 975 friend class Uint32x4BoolConstructorInstr; |
978 friend class Uint32x4GetFlagInstr; | 976 friend class Uint32x4GetFlagInstr; |
979 friend class Uint32x4SetFlagInstr; | 977 friend class Uint32x4SetFlagInstr; |
980 friend class Uint32x4SelectInstr; | 978 friend class Uint32x4SelectInstr; |
981 friend class Uint32x4ToFloat32x4Instr; | 979 friend class Uint32x4ToFloat32x4Instr; |
982 friend class BinaryUint32x4OpInstr; | 980 friend class BinaryUint32x4OpInstr; |
983 friend class BinaryMintOpInstr; | 981 friend class BinaryMintOpInstr; |
984 friend class BinarySmiOpInstr; | 982 friend class BinarySmiOpInstr; |
985 friend class UnarySmiOpInstr; | 983 friend class UnarySmiOpInstr; |
986 friend class UnaryDoubleOpInstr; | 984 friend class UnaryDoubleOpInstr; |
(...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4984 | 4982 |
4985 virtual bool MayThrow() const { return false; } | 4983 virtual bool MayThrow() const { return false; } |
4986 | 4984 |
4987 private: | 4985 private: |
4988 const Token::Kind op_kind_; | 4986 const Token::Kind op_kind_; |
4989 | 4987 |
4990 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); | 4988 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); |
4991 }; | 4989 }; |
4992 | 4990 |
4993 | 4991 |
4994 class Float32x4ShuffleInstr : public TemplateDefinition<1> { | 4992 class Simd32x4ShuffleInstr : public TemplateDefinition<1> { |
4995 public: | 4993 public: |
4996 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, | 4994 Simd32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, |
4997 intptr_t mask, | 4995 intptr_t mask, |
4998 intptr_t deopt_id) | 4996 intptr_t deopt_id) |
4999 : op_kind_(op_kind), mask_(mask) { | 4997 : op_kind_(op_kind), mask_(mask) { |
5000 SetInputAt(0, value); | 4998 SetInputAt(0, value); |
5001 deopt_id_ = deopt_id; | 4999 deopt_id_ = deopt_id; |
5002 } | 5000 } |
5003 | 5001 |
5004 Value* value() const { return inputs_[0]; } | 5002 Value* value() const { return inputs_[0]; } |
5005 | 5003 |
5006 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5004 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5007 | 5005 |
5008 intptr_t mask() const { return mask_; } | 5006 intptr_t mask() const { return mask_; } |
5009 | 5007 |
5010 virtual void PrintOperandsTo(BufferFormatter* f) const; | 5008 virtual void PrintOperandsTo(BufferFormatter* f) const; |
5011 | 5009 |
5012 virtual bool CanDeoptimize() const { return false; } | 5010 virtual bool CanDeoptimize() const { return false; } |
5013 | 5011 |
5014 virtual Representation representation() const { | 5012 virtual Representation representation() const { |
5015 if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) || | 5013 if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) || |
5016 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) || | 5014 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) || |
5017 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) || | 5015 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) || |
5018 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW)) { | 5016 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW)) { |
5019 return kUnboxedDouble; | 5017 return kUnboxedDouble; |
5020 } | 5018 } |
| 5019 if ((op_kind_ == MethodRecognizer::kUint32x4Shuffle)) { |
| 5020 return kUnboxedUint32x4; |
| 5021 } |
| 5022 ASSERT((op_kind_ == MethodRecognizer::kFloat32x4Shuffle)); |
5021 return kUnboxedFloat32x4; | 5023 return kUnboxedFloat32x4; |
5022 } | 5024 } |
5023 | 5025 |
5024 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5026 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5025 ASSERT(idx == 0); | 5027 ASSERT(idx == 0); |
| 5028 if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) || |
| 5029 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) || |
| 5030 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) || |
| 5031 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW) || |
| 5032 (op_kind_ == MethodRecognizer::kFloat32x4Shuffle)) { |
| 5033 return kUnboxedFloat32x4; |
| 5034 } |
| 5035 ASSERT((op_kind_ == MethodRecognizer::kUint32x4Shuffle)); |
| 5036 return kUnboxedUint32x4; |
| 5037 } |
| 5038 |
| 5039 virtual intptr_t DeoptimizationTarget() const { |
| 5040 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5041 // was inherited from another instruction that could deoptimize. |
| 5042 return deopt_id_; |
| 5043 } |
| 5044 |
| 5045 DECLARE_INSTRUCTION(Simd32x4Shuffle) |
| 5046 virtual CompileType ComputeType() const; |
| 5047 |
| 5048 virtual bool AllowsCSE() const { return true; } |
| 5049 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5050 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5051 virtual bool AttributesEqual(Instruction* other) const { |
| 5052 return (op_kind() == other->AsSimd32x4Shuffle()->op_kind()) && |
| 5053 (mask() == other->AsSimd32x4Shuffle()->mask()); |
| 5054 } |
| 5055 |
| 5056 virtual bool MayThrow() const { return false; } |
| 5057 |
| 5058 private: |
| 5059 const MethodRecognizer::Kind op_kind_; |
| 5060 const intptr_t mask_; |
| 5061 |
| 5062 DISALLOW_COPY_AND_ASSIGN(Simd32x4ShuffleInstr); |
| 5063 }; |
| 5064 |
| 5065 |
| 5066 class Simd32x4ShuffleMixInstr : public TemplateDefinition<2> { |
| 5067 public: |
| 5068 Simd32x4ShuffleMixInstr(MethodRecognizer::Kind op_kind, Value* xy, |
| 5069 Value* zw, intptr_t mask, intptr_t deopt_id) |
| 5070 : op_kind_(op_kind), mask_(mask) { |
| 5071 SetInputAt(0, xy); |
| 5072 SetInputAt(1, zw); |
| 5073 deopt_id_ = deopt_id; |
| 5074 } |
| 5075 |
| 5076 Value* xy() const { return inputs_[0]; } |
| 5077 Value* zw() const { return inputs_[1]; } |
| 5078 |
| 5079 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
| 5080 |
| 5081 intptr_t mask() const { return mask_; } |
| 5082 |
| 5083 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5084 |
| 5085 virtual bool CanDeoptimize() const { return false; } |
| 5086 |
| 5087 virtual Representation representation() const { |
| 5088 if (op_kind() == MethodRecognizer::kUint32x4ShuffleMix) { |
| 5089 return kUnboxedUint32x4; |
| 5090 } |
| 5091 ASSERT(op_kind() == MethodRecognizer::kFloat32x4ShuffleMix); |
5026 return kUnboxedFloat32x4; | 5092 return kUnboxedFloat32x4; |
5027 } | 5093 } |
5028 | 5094 |
| 5095 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5096 ASSERT((idx == 0) || (idx == 1)); |
| 5097 if (op_kind() == MethodRecognizer::kUint32x4ShuffleMix) { |
| 5098 return kUnboxedUint32x4; |
| 5099 } |
| 5100 ASSERT(op_kind() == MethodRecognizer::kFloat32x4ShuffleMix); |
| 5101 return kUnboxedFloat32x4; |
| 5102 } |
| 5103 |
5029 virtual intptr_t DeoptimizationTarget() const { | 5104 virtual intptr_t DeoptimizationTarget() const { |
5030 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5105 // Direct access since this instruction cannot deoptimize, and the deopt-id |
5031 // was inherited from another instruction that could deoptimize. | 5106 // was inherited from another instruction that could deoptimize. |
5032 return deopt_id_; | 5107 return deopt_id_; |
5033 } | 5108 } |
5034 | 5109 |
5035 DECLARE_INSTRUCTION(Float32x4Shuffle) | 5110 DECLARE_INSTRUCTION(Simd32x4ShuffleMix) |
5036 virtual CompileType ComputeType() const; | 5111 virtual CompileType ComputeType() const; |
5037 | 5112 |
5038 virtual bool AllowsCSE() const { return true; } | 5113 virtual bool AllowsCSE() const { return true; } |
5039 virtual EffectSet Effects() const { return EffectSet::None(); } | 5114 virtual EffectSet Effects() const { return EffectSet::None(); } |
5040 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5115 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
5041 virtual bool AttributesEqual(Instruction* other) const { | 5116 virtual bool AttributesEqual(Instruction* other) const { |
5042 return op_kind() == other->AsFloat32x4Shuffle()->op_kind() && | 5117 return (op_kind() == other->AsSimd32x4ShuffleMix()->op_kind()) && |
5043 mask() == other->AsFloat32x4Shuffle()->mask(); | 5118 (mask() == other->AsSimd32x4ShuffleMix()->mask()); |
5044 } | 5119 } |
5045 | 5120 |
5046 virtual bool MayThrow() const { return false; } | 5121 virtual bool MayThrow() const { return false; } |
5047 | 5122 |
5048 private: | 5123 private: |
5049 const MethodRecognizer::Kind op_kind_; | 5124 const MethodRecognizer::Kind op_kind_; |
5050 const intptr_t mask_; | 5125 const intptr_t mask_; |
5051 | 5126 |
5052 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr); | 5127 DISALLOW_COPY_AND_ASSIGN(Simd32x4ShuffleMixInstr); |
5053 }; | 5128 }; |
5054 | 5129 |
5055 | 5130 |
5056 class Float32x4ConstructorInstr : public TemplateDefinition<4> { | 5131 class Float32x4ConstructorInstr : public TemplateDefinition<4> { |
5057 public: | 5132 public: |
5058 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, | 5133 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, |
5059 Value* value3, intptr_t deopt_id) { | 5134 Value* value3, intptr_t deopt_id) { |
5060 SetInputAt(0, value0); | 5135 SetInputAt(0, value0); |
5061 SetInputAt(1, value1); | 5136 SetInputAt(1, value1); |
5062 SetInputAt(2, value2); | 5137 SetInputAt(2, value2); |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5745 | 5820 |
5746 virtual bool MayThrow() const { return false; } | 5821 virtual bool MayThrow() const { return false; } |
5747 | 5822 |
5748 private: | 5823 private: |
5749 const MethodRecognizer::Kind op_kind_; | 5824 const MethodRecognizer::Kind op_kind_; |
5750 | 5825 |
5751 DISALLOW_COPY_AND_ASSIGN(Simd32x4GetSignMaskInstr); | 5826 DISALLOW_COPY_AND_ASSIGN(Simd32x4GetSignMaskInstr); |
5752 }; | 5827 }; |
5753 | 5828 |
5754 | 5829 |
5755 class Float32x4TwoArgShuffleInstr : public TemplateDefinition<2> { | |
5756 public: | |
5757 Float32x4TwoArgShuffleInstr(MethodRecognizer::Kind op_kind, Value* left, | |
5758 Value* right, intptr_t deopt_id) | |
5759 : op_kind_(op_kind) { | |
5760 SetInputAt(0, left); | |
5761 SetInputAt(1, right); | |
5762 deopt_id_ = deopt_id; | |
5763 } | |
5764 | |
5765 Value* left() const { return inputs_[0]; } | |
5766 Value* right() const { return inputs_[1]; } | |
5767 | |
5768 MethodRecognizer::Kind op_kind() const { return op_kind_; } | |
5769 | |
5770 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
5771 | |
5772 virtual bool CanDeoptimize() const { return false; } | |
5773 | |
5774 virtual Representation representation() const { | |
5775 return kUnboxedFloat32x4; | |
5776 } | |
5777 | |
5778 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | |
5779 ASSERT((idx == 0) || (idx == 1)); | |
5780 return kUnboxedFloat32x4; | |
5781 } | |
5782 | |
5783 virtual intptr_t DeoptimizationTarget() const { | |
5784 // Direct access since this instruction cannot deoptimize, and the deopt-id | |
5785 // was inherited from another instruction that could deoptimize. | |
5786 return deopt_id_; | |
5787 } | |
5788 | |
5789 DECLARE_INSTRUCTION(Float32x4TwoArgShuffle) | |
5790 virtual CompileType ComputeType() const; | |
5791 | |
5792 virtual bool AllowsCSE() const { return true; } | |
5793 virtual EffectSet Effects() const { return EffectSet::None(); } | |
5794 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
5795 virtual bool AttributesEqual(Instruction* other) const { | |
5796 return op_kind() == other->AsFloat32x4TwoArgShuffle()->op_kind(); | |
5797 } | |
5798 | |
5799 virtual bool MayThrow() const { return false; } | |
5800 | |
5801 private: | |
5802 const MethodRecognizer::Kind op_kind_; | |
5803 | |
5804 DISALLOW_COPY_AND_ASSIGN(Float32x4TwoArgShuffleInstr); | |
5805 }; | |
5806 | |
5807 | |
5808 class Uint32x4SelectInstr : public TemplateDefinition<3> { | 5830 class Uint32x4SelectInstr : public TemplateDefinition<3> { |
5809 public: | 5831 public: |
5810 Uint32x4SelectInstr(Value* mask, Value* trueValue, Value* falseValue, | 5832 Uint32x4SelectInstr(Value* mask, Value* trueValue, Value* falseValue, |
5811 intptr_t deopt_id) { | 5833 intptr_t deopt_id) { |
5812 SetInputAt(0, mask); | 5834 SetInputAt(0, mask); |
5813 SetInputAt(1, trueValue); | 5835 SetInputAt(1, trueValue); |
5814 SetInputAt(2, falseValue); | 5836 SetInputAt(2, falseValue); |
5815 deopt_id_ = deopt_id; | 5837 deopt_id_ = deopt_id; |
5816 } | 5838 } |
5817 | 5839 |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6901 ForwardInstructionIterator* current_iterator_; | 6923 ForwardInstructionIterator* current_iterator_; |
6902 | 6924 |
6903 private: | 6925 private: |
6904 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6926 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
6905 }; | 6927 }; |
6906 | 6928 |
6907 | 6929 |
6908 } // namespace dart | 6930 } // namespace dart |
6909 | 6931 |
6910 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6932 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |