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

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

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