aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 395f1bf..ecbb0bf 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1208,10 +1208,9 @@ public:
/// convenient to write "2.0" and the like. Without this function we'd
/// have to duplicate its logic everywhere it's called.
bool isExactlyValue(double V) const {
- if (getValueType(0)==MVT::f64)
- return isExactlyValue(APFloat(V));
- else
- return isExactlyValue(APFloat((float)V));
+ APFloat Tmp(V);
+ Tmp.convert(Value.getSemantics(), APFloat::rmNearestTiesToEven);
+ return isExactlyValue(Tmp);
}
bool isExactlyValue(const APFloat& V) const;