• Home
  • Raw
  • Download

Lines Matching +full:merge +full:- +full:base

2 // Use of this source code is governed by a BSD-style license that can be
12 #include "src/base/compiler-specific.h"
27 const Operator* op() const { return node()->op(); } in op()
28 IrOpcode::Value opcode() const { return node()->opcode(); } in opcode()
31 return op()->HasProperty(property); in HasProperty()
33 Node* InputAt(int index) const { return node()->InputAt(index); } in InputAt()
118 return this->HasValue() && this->Value() == value; in Is()
121 return this->HasValue() && low <= this->Value() && this->Value() <= high; in IsInRange()
124 return this->HasValue() && (this->Value() % n) == 0; in IsMultipleOf()
127 return this->HasValue() && this->Value() > 0 && in IsPowerOf2()
128 (this->Value() & (this->Value() - 1)) == 0; in IsPowerOf2()
131 return this->HasValue() && this->Value() < 0 && in IsNegativePowerOf2()
132 (-this->Value() & (-this->Value() - 1)) == 0; in IsNegativePowerOf2()
134 bool IsNegative() const { return this->HasValue() && this->Value() < 0; } in IsNegative()
156 return this->HasValue() && this->Value() == value; in Is()
159 return this->HasValue() && low <= this->Value() && this->Value() <= high; in IsInRange()
162 return this->Is(0.0) && std::signbit(this->Value()); in IsMinusZero()
164 bool IsNegative() const { return this->HasValue() && this->Value() < 0.0; } in IsNegative()
165 bool IsNaN() const { return this->HasValue() && std::isnan(this->Value()); } in IsNaN()
166 bool IsZero() const { return this->Is(0.0) && !std::signbit(this->Value()); } in IsZero()
168 return this->HasValue() && std::isnormal(this->Value()); in IsNormal()
171 return this->HasValue() && std::nearbyint(this->Value()) == this->Value(); in IsInteger()
174 if (!this->HasValue() || (this->Value() == 0.0)) { in IsPositiveOrNegativePowerOf2()
177 Double value = Double(this->Value()); in IsPositiveOrNegativePowerOf2()
179 base::bits::IsPowerOfTwo64(value.Significand()); in IsPositiveOrNegativePowerOf2()
195 return this->HasValue() && this->Value().address() == value.address(); in Is()
206 return this->HasValue() && this->Value() == value; in Is()
212 // machine-level load operations.
255 node()->ReplaceInput(0, left().node()); in SwapInputs()
256 node()->ReplaceInput(1, right().node()); in SwapInputs()
286 : scale_(-1), power_of_two_plus_one_(false) {
287 if (node->InputCount() < 2) return;
289 if (node->opcode() == kShiftOpcode) {
297 } else if (node->opcode() == kMulOpcode) {
325 bool matches() const { return scale_ != -1; } in matches()
349 scale_(-1), in AddMatcher()
354 : BinopMatcher(node, node->op()->HasProperty(Operator::kCommutative)), in AddMatcher()
355 scale_(-1), in AddMatcher()
357 Initialize(node, node->op()->HasProperty(Operator::kCommutative)); in AddMatcher()
360 bool HasIndexInput() const { return scale_ != -1; } in HasIndexInput()
363 return this->left().node()->InputAt(0); in IndexInput()
373 Matcher left_matcher(this->left().node(), true); in Initialize()
384 Matcher right_matcher(this->right().node(), true); in Initialize()
388 this->SwapInputs(); in Initialize()
392 if (this->right().opcode() == kAddOpcode && in Initialize()
393 this->left().opcode() != kAddOpcode) { in Initialize()
394 this->SwapInputs(); in Initialize()
395 } else if (this->right().opcode() == kSubOpcode && in Initialize()
396 this->left().opcode() != kSubOpcode) { in Initialize()
397 this->SwapInputs(); in Initialize()
421 typedef base::Flags<AddressOption, uint8_t> AddressOptions;
444 (node->op()->HasProperty(Operator::kCommutative) in BaseWithIndexAndDisplacementMatcher()
452 Node* base() const { return base_; } in base() function
469 // find all of the interesting cases (S = index * scale, B = base input, D = in Initialize()
481 if (node->InputCount() < 2) return; in Initialize()
486 Node* base = nullptr; in Initialize() local
492 if (m.HasIndexInput() && left->OwnedByAddressingOperand()) { in Initialize()
498 if (right->opcode() == AddMatcher::kSubOpcode && in Initialize()
499 right->OwnedByAddressingOperand()) { in Initialize()
502 // (S + (B - D)) in Initialize()
503 base = right_matcher.left().node(); in Initialize()
510 if (right->opcode() == AddMatcher::kAddOpcode && in Initialize()
511 right->OwnedByAddressingOperand()) { in Initialize()
515 base = right_matcher.left().node(); in Initialize()
519 base = right; in Initialize()
526 base = right; in Initialize()
531 if (left->opcode() == AddMatcher::kSubOpcode && in Initialize()
532 left->OwnedByAddressingOperand()) { in Initialize()
537 if (left_matcher.HasIndexInput() && left_left->OwnedBy(left)) { in Initialize()
538 // ((S - D) + B) in Initialize()
545 base = right; in Initialize()
547 // ((B - D) + B) in Initialize()
551 base = right; in Initialize()
557 if (left->opcode() == AddMatcher::kAddOpcode && in Initialize()
558 left->OwnedByAddressingOperand()) { in Initialize()
562 if (left_matcher.HasIndexInput() && left_left->OwnedBy(left)) { in Initialize()
570 base = right; in Initialize()
572 if (left->OwnedBy(node)) { in Initialize()
578 base = left_right; in Initialize()
582 base = left; in Initialize()
588 base = right; in Initialize()
595 base = right; in Initialize()
597 if (left->OwnedBy(node)) { in Initialize()
600 base = left_right; in Initialize()
604 base = left; in Initialize()
610 base = right; in Initialize()
616 base = left; in Initialize()
620 base = left; in Initialize()
628 switch (displacement->opcode()) { in Initialize()
646 if (base != nullptr) { in Initialize()
647 // If the scale requires explicitly using the index as the base, but a in Initialize()
648 // base is already part of the match, then the (1 << N + 1) scale factor in Initialize()
654 base = index; in Initialize()
661 base_ = base; in Initialize()
691 explicit DiamondMatcher(Node* merge);
695 return if_true_->OwnedBy(node()) && if_false_->OwnedBy(node()); in IfProjectionsAreOwned()
701 Node* Merge() const { return node(); } in Merge() function
704 DCHECK(IrOpcode::IsPhiOpcode(phi->opcode())); in TrueInputOf()
705 DCHECK_EQ(3, phi->InputCount()); in TrueInputOf()
706 DCHECK_EQ(Merge(), phi->InputAt(2)); in TrueInputOf()
707 return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 0 : 1); in TrueInputOf()
711 DCHECK(IrOpcode::IsPhiOpcode(phi->opcode())); in FalseInputOf()
712 DCHECK_EQ(3, phi->InputCount()); in FalseInputOf()
713 DCHECK_EQ(Merge(), phi->InputAt(2)); in FalseInputOf()
714 return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 1 : 0); in FalseInputOf()