diff options
author | 2016-01-22 08:59:04 +0000 | |
---|---|---|
committer | 2016-01-22 08:59:04 +0000 | |
commit | 884e54c8a45e49b58cb1127c8ed890f79f382601 (patch) | |
tree | 0be051a729b2f2674c3148d8734e5520713ad546 /compiler/optimizing/nodes.h | |
parent | a05cacc11fa075246c38497c01b949745fadc54b (diff) |
Revert "Revert "Change condition to opposite if lhs is constant""
This reverts commit a05cacc11fa075246c38497c01b949745fadc54b.
Change-Id: Ifdc261fd4dfb2c538017fe1d69af723aafd4afef
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index c06d164523..cfb71791f4 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2706,6 +2706,8 @@ class HCondition : public HBinaryOperation { bool IsGtBias() const { return bias_ == ComparisonBias::kGtBias; } + bool IsLtBias() const { return bias_ == ComparisonBias::kLtBias; } + void SetBias(ComparisonBias bias) { bias_ = bias; } bool InstructionDataEquals(HInstruction* other) const OVERRIDE { @@ -2715,13 +2717,23 @@ class HCondition : public HBinaryOperation { bool IsFPConditionTrueIfNaN() const { DCHECK(Primitive::IsFloatingPointType(InputAt(0)->GetType())); IfCondition if_cond = GetCondition(); - return IsGtBias() ? ((if_cond == kCondGT) || (if_cond == kCondGE)) : (if_cond == kCondNE); + if (if_cond == kCondNE) { + return true; + } else if (if_cond == kCondEQ) { + return false; + } + return ((if_cond == kCondGT) || (if_cond == kCondGE)) && IsGtBias(); } bool IsFPConditionFalseIfNaN() const { DCHECK(Primitive::IsFloatingPointType(InputAt(0)->GetType())); IfCondition if_cond = GetCondition(); - return IsGtBias() ? ((if_cond == kCondLT) || (if_cond == kCondLE)) : (if_cond == kCondEQ); + if (if_cond == kCondEQ) { + return true; + } else if (if_cond == kCondNE) { + return false; + } + return ((if_cond == kCondLT) || (if_cond == kCondLE)) && IsGtBias(); } private: |