diff options
| author | 2016-02-15 12:48:36 +0600 | |
|---|---|---|
| committer | 2016-03-11 18:28:55 +0600 | |
| commit | bdd7935c2adc3ad190ee87958e714a36f33cedae (patch) | |
| tree | 64563d52d699d63c22574dbc97e6d5410df94ac3 /compiler/optimizing/nodes.h | |
| parent | 2af7213a4e0d395fe22dcdce6ec10a3bd131023d (diff) | |
Revert "Revert "Revert "Revert "Change condition to opposite if lhs is constant""""
This reverts commit d4aee949b3dd976295201b5310f13aa2df40afa1.
Change-Id: I505b8c9863c310a3a708f580b00d425b750c9541
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 ecb690ff62..b3c51a1dbd 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2964,6 +2964,8 @@ class HCondition : public HBinaryOperation { virtual IfCondition GetOppositeCondition() const = 0; bool IsGtBias() const { return GetBias() == ComparisonBias::kGtBias; } + bool IsLtBias() const { return GetBias() == ComparisonBias::kLtBias; } + ComparisonBias GetBias() const { return GetPackedField<ComparisonBiasField>(); } void SetBias(ComparisonBias bias) { SetPackedField<ComparisonBiasField>(bias); } @@ -2974,13 +2976,23 @@ class HCondition : public HBinaryOperation { bool IsFPConditionTrueIfNaN() const { DCHECK(Primitive::IsFloatingPointType(InputAt(0)->GetType())) << 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())) << 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(); } protected: |