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

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

Issue 192573008: Inline Float64x2 methods with zero arguments (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
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 V(_Float32x4, withX, Float32x4WithX, 795284225) \ 120 V(_Float32x4, withX, Float32x4WithX, 795284225) \
121 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ 121 V(_Float32x4, withY, Float32x4WithY, 1806065938) \
122 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ 122 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \
123 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ 123 V(_Float32x4, withW, Float32x4WithW, 1108437255) \
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) \
131 V(_Float64x2, abs, Float64x2Abs, 778551930) \
132 V(_Float64x2, sqrt, Float64x2Sqrt, 591345168) \
133 V(_Float64x2, get:signMask, Float64x2GetSignMask, 601579087) \
130 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ 134 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \
131 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ 135 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \
132 893850947) \ 136 893850947) \
133 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ 137 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \
134 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ 138 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \
135 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ 139 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \
136 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ 140 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \
137 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ 141 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \
138 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ 142 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \
139 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ 143 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 M(TestSmi) \ 764 M(TestSmi) \
761 M(BoxFloat64x2) \ 765 M(BoxFloat64x2) \
762 M(UnboxFloat64x2) \ 766 M(UnboxFloat64x2) \
763 M(BinaryFloat64x2Op) \ 767 M(BinaryFloat64x2Op) \
764 M(Float64x2Zero) \ 768 M(Float64x2Zero) \
765 M(Float64x2Constructor) \ 769 M(Float64x2Constructor) \
766 M(Float64x2Splat) \ 770 M(Float64x2Splat) \
767 M(Float32x4ToFloat64x2) \ 771 M(Float32x4ToFloat64x2) \
768 M(Float64x2ToFloat32x4) \ 772 M(Float64x2ToFloat32x4) \
769 M(Simd64x2Shuffle) \ 773 M(Simd64x2Shuffle) \
774 M(Float64x2ZeroArg) \
775
srdjan 2014/03/10 20:45:58 Why the extra new line?
Cutch 2014/03/10 20:52:47 Done.
770 776
771 777
772 #define FORWARD_DECLARATION(type) class type##Instr; 778 #define FORWARD_DECLARATION(type) class type##Instr;
773 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 779 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
774 #undef FORWARD_DECLARATION 780 #undef FORWARD_DECLARATION
775 781
776 782
777 // Functions required in all concrete instruction classes. 783 // Functions required in all concrete instruction classes.
778 #define DECLARE_INSTRUCTION(type) \ 784 #define DECLARE_INSTRUCTION(type) \
779 virtual Tag tag() const { return k##type; } \ 785 virtual Tag tag() const { return k##type; } \
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 friend class Float32x4ConstructorInstr; 1051 friend class Float32x4ConstructorInstr;
1046 friend class Float32x4ComparisonInstr; 1052 friend class Float32x4ComparisonInstr;
1047 friend class Float32x4MinMaxInstr; 1053 friend class Float32x4MinMaxInstr;
1048 friend class Float32x4ScaleInstr; 1054 friend class Float32x4ScaleInstr;
1049 friend class Float32x4SqrtInstr; 1055 friend class Float32x4SqrtInstr;
1050 friend class Float32x4ZeroArgInstr; 1056 friend class Float32x4ZeroArgInstr;
1051 friend class Float32x4ClampInstr; 1057 friend class Float32x4ClampInstr;
1052 friend class Float32x4WithInstr; 1058 friend class Float32x4WithInstr;
1053 friend class Float32x4ToInt32x4Instr; 1059 friend class Float32x4ToInt32x4Instr;
1054 friend class Simd64x2ShuffleInstr; 1060 friend class Simd64x2ShuffleInstr;
1061 friend class Float64x2ZeroArgInstr;
1055 friend class Float32x4ToFloat64x2Instr; 1062 friend class Float32x4ToFloat64x2Instr;
1056 friend class Float64x2ToFloat32x4Instr; 1063 friend class Float64x2ToFloat32x4Instr;
1057 friend class Float64x2ZeroInstr; 1064 friend class Float64x2ZeroInstr;
1058 friend class Float64x2SplatInstr; 1065 friend class Float64x2SplatInstr;
1059 friend class Float64x2ConstructorInstr; 1066 friend class Float64x2ConstructorInstr;
1060 friend class Int32x4BoolConstructorInstr; 1067 friend class Int32x4BoolConstructorInstr;
1061 friend class Int32x4GetFlagInstr; 1068 friend class Int32x4GetFlagInstr;
1062 friend class Int32x4SetFlagInstr; 1069 friend class Int32x4SetFlagInstr;
1063 friend class Int32x4SelectInstr; 1070 friend class Int32x4SelectInstr;
1064 friend class Int32x4ToFloat32x4Instr; 1071 friend class Int32x4ToFloat32x4Instr;
(...skipping 4990 matching lines...) Expand 10 before | Expand all | Expand 10 after
6055 virtual EffectSet Dependencies() const { return EffectSet::None(); } 6062 virtual EffectSet Dependencies() const { return EffectSet::None(); }
6056 virtual bool AttributesEqual(Instruction* other) const { return true; } 6063 virtual bool AttributesEqual(Instruction* other) const { return true; }
6057 6064
6058 virtual bool MayThrow() const { return false; } 6065 virtual bool MayThrow() const { return false; }
6059 6066
6060 private: 6067 private:
6061 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr); 6068 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr);
6062 }; 6069 };
6063 6070
6064 6071
6072 class Float64x2ZeroArgInstr : public TemplateDefinition<1> {
6073 public:
6074 Float64x2ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left,
6075 intptr_t deopt_id) : op_kind_(op_kind) {
6076 SetInputAt(0, left);
6077 deopt_id_ = deopt_id;
6078 }
6079
6080 Value* left() const { return inputs_[0]; }
6081
6082 MethodRecognizer::Kind op_kind() const { return op_kind_; }
6083
6084 virtual void PrintOperandsTo(BufferFormatter* f) const;
6085
6086 virtual bool CanDeoptimize() const { return false; }
6087
6088 virtual Representation representation() const {
6089 if (op_kind() == MethodRecognizer::kFloat64x2GetSignMask) {
6090 // Smi.
6091 return kTagged;
6092 }
6093 return kUnboxedFloat64x2;
6094 }
6095
6096 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
6097 ASSERT(idx == 0);
6098 return kUnboxedFloat64x2;
6099 }
6100
6101 virtual intptr_t DeoptimizationTarget() const {
6102 // Direct access since this instruction cannot deoptimize, and the deopt-id
6103 // was inherited from another instruction that could deoptimize.
6104 return deopt_id_;
6105 }
6106
6107 DECLARE_INSTRUCTION(Float64x2ZeroArg)
6108 virtual CompileType ComputeType() const;
6109
6110 virtual bool AllowsCSE() const { return true; }
6111 virtual EffectSet Effects() const { return EffectSet::None(); }
6112 virtual EffectSet Dependencies() const { return EffectSet::None(); }
6113 virtual bool AttributesEqual(Instruction* other) const {
6114 return op_kind() == other->AsFloat64x2ZeroArg()->op_kind();
6115 }
6116
6117 virtual bool MayThrow() const { return false; }
6118
6119 private:
6120 const MethodRecognizer::Kind op_kind_;
6121
6122 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroArgInstr);
6123 };
6124
6125
6065 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { 6126 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> {
6066 public: 6127 public:
6067 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, 6128 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2,
6068 Value* value3, intptr_t deopt_id) { 6129 Value* value3, intptr_t deopt_id) {
6069 SetInputAt(0, value0); 6130 SetInputAt(0, value0);
6070 SetInputAt(1, value1); 6131 SetInputAt(1, value1);
6071 SetInputAt(2, value2); 6132 SetInputAt(2, value2);
6072 SetInputAt(3, value3); 6133 SetInputAt(3, value3);
6073 deopt_id_ = deopt_id; 6134 deopt_id_ = deopt_id;
6074 } 6135 }
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
7556 ForwardInstructionIterator* current_iterator_; 7617 ForwardInstructionIterator* current_iterator_;
7557 7618
7558 private: 7619 private:
7559 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7620 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7560 }; 7621 };
7561 7622
7562 7623
7563 } // namespace dart 7624 } // namespace dart
7564 7625
7565 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7626 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698