From bdd7935c2adc3ad190ee87958e714a36f33cedae Mon Sep 17 00:00:00 2001 From: Anton Shamin Date: Mon, 15 Feb 2016 12:48:36 +0600 Subject: Revert "Revert "Revert "Revert "Change condition to opposite if lhs is constant"""" This reverts commit d4aee949b3dd976295201b5310f13aa2df40afa1. Change-Id: I505b8c9863c310a3a708f580b00d425b750c9541 --- compiler/optimizing/nodes.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/nodes.h') 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(); } void SetBias(ComparisonBias bias) { SetPackedField(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: -- cgit v1.2.3-59-g8ed1b