summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-24 06:52:40 +0000
committerDan Gohman <gohman@apple.com>2010-02-24 06:52:40 +0000
commite832693acbfc713bcaf44720efa8149e93a38027 (patch)
treee44715f6b93875ca5ab04613a97111de6329d7e3 /include/llvm/Constants.h
parent39516a632385cb8103c94fceb6cfed13897a24b4 (diff)
downloadllvm-e832693acbfc713bcaf44720efa8149e93a38027.tar.gz
llvm-e832693acbfc713bcaf44720efa8149e93a38027.tar.bz2
llvm-e832693acbfc713bcaf44720efa8149e93a38027.tar.xz
When forming SSE min and max nodes for UGE and ULE comparisons, it's
necessary to swap the operands to handle NaN and negative zero properly. Also, reintroduce logic for checking for NaN conditions when forming SSE min and max instructions, fixed to take into consideration NaNs and negative zeros. This allows forming min and max instructions in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index bd14303d67..c706329fb2 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -276,6 +276,12 @@ public:
return Val.isZero() && Val.isNegative();
}
+ /// isZero - Return true if the value is positive or negative zero.
+ bool isZero() const { return Val.isZero(); }
+
+ /// isNaN - Return true if the value is a NaN.
+ bool isNaN() const { return Val.isNaN(); }
+
/// isExactlyValue - We don't rely on operator== working on double values, as
/// it returns true for things that are clearly not equal, like -0.0 and 0.0.
/// As such, this method can be used to do an exact bit-for-bit comparison of