summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-01-22 10:44:39 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-01-22 10:44:39 +0000
commit45ec0967f1ac09d223e94267c0004dc08670792e (patch)
treebba7deec82b9f7808eff253e2c1177818f9dd918 /compiler/optimizing/nodes.h
parentc54ec90cc3c7570be2a5a64717cd10c817e246c7 (diff)
parent884e54c8a45e49b58cb1127c8ed890f79f382601 (diff)
Merge "Revert "Revert "Change condition to opposite if lhs is constant"""
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 019be5d494..7067aabaa1 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2725,6 +2725,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 {
@@ -2734,13 +2736,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: