[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Jim Laskey
jlaskey at apple.com
Wed Aug 17 12:20:54 PDT 2005
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAGNodes.h updated: 1.54 -> 1.55
---
Log message:
Culling out use of unions for converting FP to bits and vice versa.
---
Diffs of the changes: (+2 -11)
SelectionDAGNodes.h | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.54 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.55
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.54 Wed Aug 17 13:58:38 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Wed Aug 17 14:20:43 2005
@@ -25,6 +25,7 @@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <vector>
@@ -742,17 +743,7 @@
/// As such, this method can be used to do an exact bit-for-bit comparison of
/// two floating point values.
bool isExactlyValue(double V) const {
- union {
- double V;
- uint64_t I;
- } T1;
- T1.V = Value;
- union {
- double V;
- uint64_t I;
- } T2;
- T2.V = V;
- return T1.I == T2.I;
+ return DoubleToBits(V) == DoubleToBits(Value);
}
static bool classof(const ConstantFPSDNode *) { return true; }
More information about the llvm-commits
mailing list