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

Side by Side Diff: src/compiler/node-matchers.h

Issue 1066393002: [turbofan] Add new Float32Abs and Float64Abs operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. Created 5 years, 8 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
« no previous file with comments | « src/compiler/mips64/instruction-selector-mips64.cc ('k') | src/compiler/opcodes.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_NODE_MATCHERS_H_ 5 #ifndef V8_COMPILER_NODE_MATCHERS_H_
6 #define V8_COMPILER_NODE_MATCHERS_H_ 6 #define V8_COMPILER_NODE_MATCHERS_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 // TODO(turbofan): Move ExternalReference out of assembler.h 10 // TODO(turbofan): Move ExternalReference out of assembler.h
(...skipping 12 matching lines...) Expand all
23 23
24 Node* node() const { return node_; } 24 Node* node() const { return node_; }
25 const Operator* op() const { return node()->op(); } 25 const Operator* op() const { return node()->op(); }
26 IrOpcode::Value opcode() const { return node()->opcode(); } 26 IrOpcode::Value opcode() const { return node()->opcode(); }
27 27
28 bool HasProperty(Operator::Property property) const { 28 bool HasProperty(Operator::Property property) const {
29 return op()->HasProperty(property); 29 return op()->HasProperty(property);
30 } 30 }
31 Node* InputAt(int index) const { return node()->InputAt(index); } 31 Node* InputAt(int index) const { return node()->InputAt(index); }
32 32
33 bool Equals(const Node* node) const { return node_ == node; }
34
33 bool IsComparison() const; 35 bool IsComparison() const;
34 36
35 #define DEFINE_IS_OPCODE(Opcode) \ 37 #define DEFINE_IS_OPCODE(Opcode) \
36 bool Is##Opcode() const { return opcode() == IrOpcode::k##Opcode; } 38 bool Is##Opcode() const { return opcode() == IrOpcode::k##Opcode; }
37 ALL_OP_LIST(DEFINE_IS_OPCODE) 39 ALL_OP_LIST(DEFINE_IS_OPCODE)
38 #undef DEFINE_IS_OPCODE 40 #undef DEFINE_IS_OPCODE
39 41
40 private: 42 private:
41 Node* node_; 43 Node* node_;
42 }; 44 };
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 136
135 // A pattern matcher for floating point constants. 137 // A pattern matcher for floating point constants.
136 template <typename T, IrOpcode::Value kOpcode> 138 template <typename T, IrOpcode::Value kOpcode>
137 struct FloatMatcher FINAL : public ValueMatcher<T, kOpcode> { 139 struct FloatMatcher FINAL : public ValueMatcher<T, kOpcode> {
138 explicit FloatMatcher(Node* node) : ValueMatcher<T, kOpcode>(node) {} 140 explicit FloatMatcher(Node* node) : ValueMatcher<T, kOpcode>(node) {}
139 141
140 bool IsMinusZero() const { 142 bool IsMinusZero() const {
141 return this->Is(0.0) && std::signbit(this->Value()); 143 return this->Is(0.0) && std::signbit(this->Value());
142 } 144 }
143 bool IsNaN() const { return this->HasValue() && std::isnan(this->Value()); } 145 bool IsNaN() const { return this->HasValue() && std::isnan(this->Value()); }
146 bool IsZero() const { return this->Is(0.0) && !std::signbit(this->Value()); }
144 }; 147 };
145 148
146 typedef FloatMatcher<float, IrOpcode::kFloat32Constant> Float32Matcher; 149 typedef FloatMatcher<float, IrOpcode::kFloat32Constant> Float32Matcher;
147 typedef FloatMatcher<double, IrOpcode::kFloat64Constant> Float64Matcher; 150 typedef FloatMatcher<double, IrOpcode::kFloat64Constant> Float64Matcher;
148 typedef FloatMatcher<double, IrOpcode::kNumberConstant> NumberMatcher; 151 typedef FloatMatcher<double, IrOpcode::kNumberConstant> NumberMatcher;
149 152
150 153
151 // A pattern matcher for heap object constants. 154 // A pattern matcher for heap object constants.
152 template <typename T> 155 template <typename T>
153 struct HeapObjectMatcher FINAL 156 struct HeapObjectMatcher FINAL
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 Node* branch_; 577 Node* branch_;
575 Node* if_true_; 578 Node* if_true_;
576 Node* if_false_; 579 Node* if_false_;
577 }; 580 };
578 581
579 } // namespace compiler 582 } // namespace compiler
580 } // namespace internal 583 } // namespace internal
581 } // namespace v8 584 } // namespace v8
582 585
583 #endif // V8_COMPILER_NODE_MATCHERS_H_ 586 #endif // V8_COMPILER_NODE_MATCHERS_H_
OLDNEW
« no previous file with comments | « src/compiler/mips64/instruction-selector-mips64.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698