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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 183923026: Inline of Float64x2 operations round 1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 V(::, sin, MathSin, 730107143) \ 87 V(::, sin, MathSin, 730107143) \
88 V(::, cos, MathCos, 1282146521) \ 88 V(::, cos, MathCos, 1282146521) \
89 V(::, min, MathMin, 1022567780) \ 89 V(::, min, MathMin, 1022567780) \
90 V(::, max, MathMax, 612058870) \ 90 V(::, max, MathMax, 612058870) \
91 V(::, _doublePow, MathDoublePow, 1591032382) \ 91 V(::, _doublePow, MathDoublePow, 1591032382) \
92 V(Float32x4, Float32x4., Float32x4Constructor, 1314950569) \ 92 V(Float32x4, Float32x4., Float32x4Constructor, 1314950569) \
93 V(Float32x4, Float32x4.zero, Float32x4Zero, 1432281809) \ 93 V(Float32x4, Float32x4.zero, Float32x4Zero, 1432281809) \
94 V(Float32x4, Float32x4.splat, Float32x4Splat, 1148280442) \ 94 V(Float32x4, Float32x4.splat, Float32x4Splat, 1148280442) \
95 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, \ 95 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, \
96 872145194) \ 96 872145194) \
97 V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1511660322) \
97 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ 98 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \
98 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 927956119) \ 99 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 927956119) \
99 V(_Float32x4, get:x, Float32x4ShuffleX, 1351747629) \ 100 V(_Float32x4, get:x, Float32x4ShuffleX, 1351747629) \
100 V(_Float32x4, get:y, Float32x4ShuffleY, 217416201) \ 101 V(_Float32x4, get:y, Float32x4ShuffleY, 217416201) \
101 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144953512) \ 102 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144953512) \
102 V(_Float32x4, get:w, Float32x4ShuffleW, 1447728910) \ 103 V(_Float32x4, get:w, Float32x4ShuffleW, 1447728910) \
103 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198879138) \ 104 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198879138) \
104 V(_Float32x4, _cmpequal, Float32x4Equal, 1944929844) \ 105 V(_Float32x4, _cmpequal, Float32x4Equal, 1944929844) \
105 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 499965951) \ 106 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 499965951) \
106 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1003006845) \ 107 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1003006845) \
107 V(_Float32x4, _cmplt, Float32x4LessThan, 747070271) \ 108 V(_Float32x4, _cmplt, Float32x4LessThan, 747070271) \
108 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2008368570) \ 109 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2008368570) \
109 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1038562565) \ 110 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1038562565) \
110 V(_Float32x4, _min, Float32x4Min, 1166664658) \ 111 V(_Float32x4, _min, Float32x4Min, 1166664658) \
111 V(_Float32x4, _max, Float32x4Max, 343968921) \ 112 V(_Float32x4, _max, Float32x4Max, 343968921) \
112 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ 113 V(_Float32x4, _scale, Float32x4Scale, 803505531) \
113 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ 114 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \
114 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ 115 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \
115 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ 116 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \
116 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ 117 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \
117 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ 118 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \
118 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ 119 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \
119 V(_Float32x4, withX, Float32x4WithX, 795284225) \ 120 V(_Float32x4, withX, Float32x4WithX, 795284225) \
120 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ 121 V(_Float32x4, withY, Float32x4WithY, 1806065938) \
121 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ 122 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \
122 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ 123 V(_Float32x4, withW, Float32x4WithW, 1108437255) \
124 V(Float64x2, Float64x2., Float64x2Constructor, 1283521526) \
125 V(Float64x2, Float64x2.zero, Float64x2Zero, 1971574037) \
126 V(Float64x2, Float64x2.splat, Float64x2Splat, 823230813) \
127 V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1383666060) \
128 V(_Float64x2, get:x, Float64x2GetX, 176817227) \
129 V(_Float64x2, get:y, Float64x2GetY, 1858031019) \
123 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ 130 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \
124 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ 131 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \
125 893850947) \ 132 893850947) \
126 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ 133 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \
127 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ 134 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \
128 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ 135 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \
129 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ 136 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \
130 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ 137 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \
131 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ 138 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \
132 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ 139 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 M(MaterializeObject) \ 753 M(MaterializeObject) \
747 M(Int32x4BoolConstructor) \ 754 M(Int32x4BoolConstructor) \
748 M(Int32x4GetFlag) \ 755 M(Int32x4GetFlag) \
749 M(Int32x4Select) \ 756 M(Int32x4Select) \
750 M(Int32x4SetFlag) \ 757 M(Int32x4SetFlag) \
751 M(Int32x4ToFloat32x4) \ 758 M(Int32x4ToFloat32x4) \
752 M(BinaryInt32x4Op) \ 759 M(BinaryInt32x4Op) \
753 M(TestSmi) \ 760 M(TestSmi) \
754 M(BoxFloat64x2) \ 761 M(BoxFloat64x2) \
755 M(UnboxFloat64x2) \ 762 M(UnboxFloat64x2) \
763 M(BinaryFloat64x2Op) \
764 M(Float64x2Zero) \
765 M(Float64x2Constructor) \
766 M(Float64x2Splat) \
767 M(Float32x4ToFloat64x2) \
768 M(Float64x2ToFloat32x4) \
769 M(Simd64x2Shuffle) \
756 770
757 771
758 #define FORWARD_DECLARATION(type) class type##Instr; 772 #define FORWARD_DECLARATION(type) class type##Instr;
759 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 773 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
760 #undef FORWARD_DECLARATION 774 #undef FORWARD_DECLARATION
761 775
762 776
763 // Functions required in all concrete instruction classes. 777 // Functions required in all concrete instruction classes.
764 #define DECLARE_INSTRUCTION(type) \ 778 #define DECLARE_INSTRUCTION(type) \
765 virtual Tag tag() const { return k##type; } \ 779 virtual Tag tag() const { return k##type; } \
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 friend class Simd32x4GetSignMaskInstr; 1044 friend class Simd32x4GetSignMaskInstr;
1031 friend class Float32x4ConstructorInstr; 1045 friend class Float32x4ConstructorInstr;
1032 friend class Float32x4ComparisonInstr; 1046 friend class Float32x4ComparisonInstr;
1033 friend class Float32x4MinMaxInstr; 1047 friend class Float32x4MinMaxInstr;
1034 friend class Float32x4ScaleInstr; 1048 friend class Float32x4ScaleInstr;
1035 friend class Float32x4SqrtInstr; 1049 friend class Float32x4SqrtInstr;
1036 friend class Float32x4ZeroArgInstr; 1050 friend class Float32x4ZeroArgInstr;
1037 friend class Float32x4ClampInstr; 1051 friend class Float32x4ClampInstr;
1038 friend class Float32x4WithInstr; 1052 friend class Float32x4WithInstr;
1039 friend class Float32x4ToInt32x4Instr; 1053 friend class Float32x4ToInt32x4Instr;
1054 friend class Simd64x2ShuffleInstr;
1055 friend class Float32x4ToFloat64x2Instr;
1056 friend class Float64x2ToFloat32x4Instr;
1057 friend class Float64x2ZeroInstr;
1058 friend class Float64x2SplatInstr;
1059 friend class Float64x2ConstructorInstr;
1040 friend class Int32x4BoolConstructorInstr; 1060 friend class Int32x4BoolConstructorInstr;
1041 friend class Int32x4GetFlagInstr; 1061 friend class Int32x4GetFlagInstr;
1042 friend class Int32x4SetFlagInstr; 1062 friend class Int32x4SetFlagInstr;
1043 friend class Int32x4SelectInstr; 1063 friend class Int32x4SelectInstr;
1044 friend class Int32x4ToFloat32x4Instr; 1064 friend class Int32x4ToFloat32x4Instr;
1045 friend class BinaryInt32x4OpInstr; 1065 friend class BinaryInt32x4OpInstr;
1066 friend class BinaryFloat64x2OpInstr;
1046 friend class BinaryMintOpInstr; 1067 friend class BinaryMintOpInstr;
1047 friend class BinarySmiOpInstr; 1068 friend class BinarySmiOpInstr;
1048 friend class UnarySmiOpInstr; 1069 friend class UnarySmiOpInstr;
1049 friend class UnaryDoubleOpInstr; 1070 friend class UnaryDoubleOpInstr;
1050 friend class ShiftMintOpInstr; 1071 friend class ShiftMintOpInstr;
1051 friend class UnaryMintOpInstr; 1072 friend class UnaryMintOpInstr;
1052 friend class MathUnaryInstr; 1073 friend class MathUnaryInstr;
1053 friend class MathMinMaxInstr; 1074 friend class MathMinMaxInstr;
1054 friend class CheckClassInstr; 1075 friend class CheckClassInstr;
1055 friend class GuardFieldInstr; 1076 friend class GuardFieldInstr;
(...skipping 4660 matching lines...) Expand 10 before | Expand all | Expand 10 after
5716 5737
5717 virtual bool MayThrow() const { return false; } 5738 virtual bool MayThrow() const { return false; }
5718 5739
5719 private: 5740 private:
5720 const MethodRecognizer::Kind op_kind_; 5741 const MethodRecognizer::Kind op_kind_;
5721 5742
5722 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); 5743 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr);
5723 }; 5744 };
5724 5745
5725 5746
5747 class Simd64x2ShuffleInstr : public TemplateDefinition<1> {
5748 public:
5749 Simd64x2ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
5750 intptr_t mask,
5751 intptr_t deopt_id)
5752 : op_kind_(op_kind), mask_(mask) {
5753 SetInputAt(0, value);
5754 deopt_id_ = deopt_id;
5755 }
5756
5757 Value* value() const { return inputs_[0]; }
5758
5759 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5760
5761 intptr_t mask() const { return mask_; }
5762
5763 virtual void PrintOperandsTo(BufferFormatter* f) const;
5764
5765 virtual bool CanDeoptimize() const { return false; }
5766
5767 virtual Representation representation() const {
5768 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) ||
5769 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) {
5770 return kUnboxedDouble;
5771 }
5772 UNIMPLEMENTED();
5773 return kUnboxedDouble;
5774 }
5775
5776 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5777 ASSERT(idx == 0);
5778 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) ||
5779 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) {
5780 return kUnboxedFloat64x2;
5781 }
5782 UNIMPLEMENTED();
5783 return kUnboxedFloat64x2;
5784 }
5785
5786 virtual intptr_t DeoptimizationTarget() const {
5787 // Direct access since this instruction cannot deoptimize, and the deopt-id
5788 // was inherited from another instruction that could deoptimize.
5789 return deopt_id_;
5790 }
5791
5792 DECLARE_INSTRUCTION(Simd64x2Shuffle)
5793 virtual CompileType ComputeType() const;
5794
5795 virtual bool AllowsCSE() const { return true; }
5796 virtual EffectSet Effects() const { return EffectSet::None(); }
5797 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5798 virtual bool AttributesEqual(Instruction* other) const {
5799 return (op_kind() == other->AsSimd64x2Shuffle()->op_kind()) &&
5800 (mask() == other->AsSimd64x2Shuffle()->mask());
5801 }
5802
5803 virtual bool MayThrow() const { return false; }
5804
5805 private:
5806 const MethodRecognizer::Kind op_kind_;
5807 const intptr_t mask_;
5808
5809 DISALLOW_COPY_AND_ASSIGN(Simd64x2ShuffleInstr);
5810 };
5811
5812
5726 class Float32x4ToInt32x4Instr : public TemplateDefinition<1> { 5813 class Float32x4ToInt32x4Instr : public TemplateDefinition<1> {
5727 public: 5814 public:
5728 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) { 5815 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) {
5729 SetInputAt(0, left); 5816 SetInputAt(0, left);
5730 deopt_id_ = deopt_id; 5817 deopt_id_ = deopt_id;
5731 } 5818 }
5732 5819
5733 Value* left() const { return inputs_[0]; } 5820 Value* left() const { return inputs_[0]; }
5734 5821
5735 virtual void PrintOperandsTo(BufferFormatter* f) const; 5822 virtual void PrintOperandsTo(BufferFormatter* f) const;
(...skipping 23 matching lines...) Expand all
5759 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5846 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5760 virtual bool AttributesEqual(Instruction* other) const { return true; } 5847 virtual bool AttributesEqual(Instruction* other) const { return true; }
5761 5848
5762 virtual bool MayThrow() const { return false; } 5849 virtual bool MayThrow() const { return false; }
5763 5850
5764 private: 5851 private:
5765 DISALLOW_COPY_AND_ASSIGN(Float32x4ToInt32x4Instr); 5852 DISALLOW_COPY_AND_ASSIGN(Float32x4ToInt32x4Instr);
5766 }; 5853 };
5767 5854
5768 5855
5856 class Float32x4ToFloat64x2Instr : public TemplateDefinition<1> {
5857 public:
5858 Float32x4ToFloat64x2Instr(Value* left, intptr_t deopt_id) {
5859 SetInputAt(0, left);
5860 deopt_id_ = deopt_id;
5861 }
5862
5863 Value* left() const { return inputs_[0]; }
5864
5865 virtual void PrintOperandsTo(BufferFormatter* f) const;
5866
5867 virtual bool CanDeoptimize() const { return false; }
5868
5869 virtual Representation representation() const {
5870 return kUnboxedFloat64x2;
5871 }
5872
5873 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5874 ASSERT(idx == 0);
5875 return kUnboxedFloat32x4;
5876 }
5877
5878 virtual intptr_t DeoptimizationTarget() const {
5879 // Direct access since this instruction cannot deoptimize, and the deopt-id
5880 // was inherited from another instruction that could deoptimize.
5881 return deopt_id_;
5882 }
5883
5884 DECLARE_INSTRUCTION(Float32x4ToFloat64x2)
5885 virtual CompileType ComputeType() const;
5886
5887 virtual bool AllowsCSE() const { return true; }
5888 virtual EffectSet Effects() const { return EffectSet::None(); }
5889 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5890 virtual bool AttributesEqual(Instruction* other) const { return true; }
5891
5892 virtual bool MayThrow() const { return false; }
5893
5894 private:
5895 DISALLOW_COPY_AND_ASSIGN(Float32x4ToFloat64x2Instr);
5896 };
5897
5898
5899 class Float64x2ToFloat32x4Instr : public TemplateDefinition<1> {
5900 public:
5901 Float64x2ToFloat32x4Instr(Value* left, intptr_t deopt_id) {
5902 SetInputAt(0, left);
5903 deopt_id_ = deopt_id;
5904 }
5905
5906 Value* left() const { return inputs_[0]; }
5907
5908 virtual void PrintOperandsTo(BufferFormatter* f) const;
5909
5910 virtual bool CanDeoptimize() const { return false; }
5911
5912 virtual Representation representation() const {
5913 return kUnboxedFloat32x4;
5914 }
5915
5916 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5917 ASSERT(idx == 0);
5918 return kUnboxedFloat64x2;
5919 }
5920
5921 virtual intptr_t DeoptimizationTarget() const {
5922 // Direct access since this instruction cannot deoptimize, and the deopt-id
5923 // was inherited from another instruction that could deoptimize.
5924 return deopt_id_;
5925 }
5926
5927 DECLARE_INSTRUCTION(Float64x2ToFloat32x4)
5928 virtual CompileType ComputeType() const;
5929
5930 virtual bool AllowsCSE() const { return true; }
5931 virtual EffectSet Effects() const { return EffectSet::None(); }
5932 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5933 virtual bool AttributesEqual(Instruction* other) const { return true; }
5934
5935 virtual bool MayThrow() const { return false; }
5936
5937 private:
5938 DISALLOW_COPY_AND_ASSIGN(Float64x2ToFloat32x4Instr);
5939 };
5940
5941
5942 class Float64x2ConstructorInstr : public TemplateDefinition<2> {
5943 public:
5944 Float64x2ConstructorInstr(Value* value0, Value* value1, intptr_t deopt_id) {
5945 SetInputAt(0, value0);
5946 SetInputAt(1, value1);
5947 deopt_id_ = deopt_id;
5948 }
5949
5950 Value* value0() const { return inputs_[0]; }
5951 Value* value1() const { return inputs_[1]; }
5952
5953 virtual void PrintOperandsTo(BufferFormatter* f) const;
5954
5955 virtual bool CanDeoptimize() const { return false; }
5956
5957 virtual Representation representation() const {
5958 return kUnboxedFloat64x2;
5959 }
5960
5961 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5962 ASSERT(idx >= 0 && idx < 2);
5963 return kUnboxedDouble;
5964 }
5965
5966 virtual intptr_t DeoptimizationTarget() const {
5967 // Direct access since this instruction cannot deoptimize, and the deopt-id
5968 // was inherited from another instruction that could deoptimize.
5969 return deopt_id_;
5970 }
5971
5972 DECLARE_INSTRUCTION(Float64x2Constructor)
5973 virtual CompileType ComputeType() const;
5974
5975 virtual bool AllowsCSE() const { return true; }
5976 virtual EffectSet Effects() const { return EffectSet::None(); }
5977 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5978 virtual bool AttributesEqual(Instruction* other) const { return true; }
5979
5980 virtual bool MayThrow() const { return false; }
5981
5982 private:
5983 DISALLOW_COPY_AND_ASSIGN(Float64x2ConstructorInstr);
5984 };
5985
5986
5987 class Float64x2SplatInstr : public TemplateDefinition<1> {
5988 public:
5989 Float64x2SplatInstr(Value* value, intptr_t deopt_id) {
5990 SetInputAt(0, value);
5991 deopt_id_ = deopt_id;
5992 }
5993
5994 Value* value() const { return inputs_[0]; }
5995
5996 virtual void PrintOperandsTo(BufferFormatter* f) const;
5997
5998 virtual bool CanDeoptimize() const { return false; }
5999
6000 virtual Representation representation() const {
6001 return kUnboxedFloat64x2;
6002 }
6003
6004 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
6005 ASSERT(idx == 0);
6006 return kUnboxedDouble;
6007 }
6008
6009 virtual intptr_t DeoptimizationTarget() const {
6010 // Direct access since this instruction cannot deoptimize, and the deopt-id
6011 // was inherited from another instruction that could deoptimize.
6012 return deopt_id_;
6013 }
6014
6015 DECLARE_INSTRUCTION(Float64x2Splat)
6016 virtual CompileType ComputeType() const;
6017
6018 virtual bool AllowsCSE() const { return true; }
6019 virtual EffectSet Effects() const { return EffectSet::None(); }
6020 virtual EffectSet Dependencies() const { return EffectSet::None(); }
6021 virtual bool AttributesEqual(Instruction* other) const { return true; }
6022
6023 virtual bool MayThrow() const { return false; }
6024
6025 private:
6026 DISALLOW_COPY_AND_ASSIGN(Float64x2SplatInstr);
6027 };
6028
6029
6030 class Float64x2ZeroInstr : public TemplateDefinition<0> {
6031 public:
6032 explicit Float64x2ZeroInstr(intptr_t deopt_id) {
6033 deopt_id_ = deopt_id;
6034 }
6035
6036 virtual void PrintOperandsTo(BufferFormatter* f) const;
6037
6038 virtual bool CanDeoptimize() const { return false; }
6039
6040 virtual Representation representation() const {
6041 return kUnboxedFloat64x2;
6042 }
6043
6044 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
6045 UNIMPLEMENTED();
6046 return kUnboxedFloat64x2;
6047 }
6048
6049 virtual intptr_t DeoptimizationTarget() const {
6050 // Direct access since this instruction cannot deoptimize, and the deopt-id
6051 // was inherited from another instruction that could deoptimize.
6052 return deopt_id_;
6053 }
6054
6055 DECLARE_INSTRUCTION(Float64x2Zero)
6056 virtual CompileType ComputeType() const;
6057
6058 virtual bool AllowsCSE() const { return true; }
6059 virtual EffectSet Effects() const { return EffectSet::None(); }
6060 virtual EffectSet Dependencies() const { return EffectSet::None(); }
6061 virtual bool AttributesEqual(Instruction* other) const { return true; }
6062
6063 virtual bool MayThrow() const { return false; }
6064
6065 private:
6066 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr);
6067 };
6068
6069
5769 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { 6070 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> {
5770 public: 6071 public:
5771 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, 6072 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2,
5772 Value* value3, intptr_t deopt_id) { 6073 Value* value3, intptr_t deopt_id) {
5773 SetInputAt(0, value0); 6074 SetInputAt(0, value0);
5774 SetInputAt(1, value1); 6075 SetInputAt(1, value1);
5775 SetInputAt(2, value2); 6076 SetInputAt(2, value2);
5776 SetInputAt(3, value3); 6077 SetInputAt(3, value3);
5777 deopt_id_ = deopt_id; 6078 deopt_id_ = deopt_id;
5778 } 6079 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
6118 } 6419 }
6119 6420
6120 virtual bool MayThrow() const { return false; } 6421 virtual bool MayThrow() const { return false; }
6121 6422
6122 private: 6423 private:
6123 const Token::Kind op_kind_; 6424 const Token::Kind op_kind_;
6124 6425
6125 DISALLOW_COPY_AND_ASSIGN(BinaryInt32x4OpInstr); 6426 DISALLOW_COPY_AND_ASSIGN(BinaryInt32x4OpInstr);
6126 }; 6427 };
6127 6428
6429
6430 class BinaryFloat64x2OpInstr : public TemplateDefinition<2> {
6431 public:
6432 BinaryFloat64x2OpInstr(Token::Kind op_kind,
6433 Value* left,
6434 Value* right,
6435 intptr_t deopt_id)
6436 : op_kind_(op_kind) {
6437 SetInputAt(0, left);
6438 SetInputAt(1, right);
6439 deopt_id_ = deopt_id;
6440 }
6441
6442 Value* left() const { return inputs_[0]; }
6443 Value* right() const { return inputs_[1]; }
6444
6445 Token::Kind op_kind() const { return op_kind_; }
6446
6447 virtual bool CanDeoptimize() const { return false; }
6448
6449 virtual Representation representation() const {
6450 return kUnboxedFloat64x2;
6451 }
6452
6453 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
6454 ASSERT((idx == 0) || (idx == 1));
6455 return kUnboxedFloat64x2;
6456 }
6457
6458 virtual void PrintOperandsTo(BufferFormatter* f) const;
6459
6460 virtual intptr_t DeoptimizationTarget() const {
6461 // Direct access since this instruction cannot deoptimize, and the deopt-id
6462 // was inherited from another instruction that could deoptimize.
6463 return deopt_id_;
6464 }
6465
6466 DECLARE_INSTRUCTION(BinaryFloat64x2Op)
6467 virtual CompileType ComputeType() const;
6468
6469 virtual bool AllowsCSE() const { return true; }
6470 virtual EffectSet Effects() const { return EffectSet::None(); }
6471 virtual EffectSet Dependencies() const { return EffectSet::None(); }
6472 virtual bool AttributesEqual(Instruction* other) const {
6473 ASSERT(other->IsBinaryFloat64x2Op());
6474 return op_kind() == other->AsBinaryFloat64x2Op()->op_kind();
6475 }
6476
6477 virtual bool MayThrow() const { return false; }
6478
6479 private:
6480 const Token::Kind op_kind_;
6481
6482 DISALLOW_COPY_AND_ASSIGN(BinaryFloat64x2OpInstr);
6483 };
6484
6485
6128 class BinaryMintOpInstr : public TemplateDefinition<2> { 6486 class BinaryMintOpInstr : public TemplateDefinition<2> {
6129 public: 6487 public:
6130 BinaryMintOpInstr(Token::Kind op_kind, 6488 BinaryMintOpInstr(Token::Kind op_kind,
6131 Value* left, 6489 Value* left,
6132 Value* right, 6490 Value* right,
6133 intptr_t deopt_id) 6491 intptr_t deopt_id)
6134 : op_kind_(op_kind) { 6492 : op_kind_(op_kind) {
6135 SetInputAt(0, left); 6493 SetInputAt(0, left);
6136 SetInputAt(1, right); 6494 SetInputAt(1, right);
6137 // Override generated deopt-id. 6495 // Override generated deopt-id.
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
7203 ForwardInstructionIterator* current_iterator_; 7561 ForwardInstructionIterator* current_iterator_;
7204 7562
7205 private: 7563 private:
7206 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7564 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7207 }; 7565 };
7208 7566
7209 7567
7210 } // namespace dart 7568 } // namespace dart
7211 7569
7212 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7570 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698