[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Jim Laskey
jlaskey at apple.com
Wed Aug 17 10:43:03 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.165 -> 1.166
---
Log message:
Switched to using BitsToDouble for int_to_float to avoid aliasing problem.
---
Diffs of the changes: (+4 -4)
LegalizeDAG.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.165 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.166
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.165 Wed Aug 17 04:44:59 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Aug 17 12:42:52 2005
@@ -15,6 +15,7 @@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetOptions.h"
@@ -204,10 +205,9 @@
SDOperand Load = DAG.getLoad(MVT::f64, Store2, StackSlot,
DAG.getSrcValue(NULL));
// FP constant to bias correct the final result
- uint64_t SignedBias = 0x4330000080000000ULL;
- uint64_t UnsignedBias = 0x4330000000000000ULL;
- SDOperand Bias = DAG.getConstantFP(isSigned ? *(double *)&SignedBias
- : *(double *)&UnsignedBias,
+ SDOperand Bias = DAG.getConstantFP(isSigned ?
+ BitsToDouble(0x4330000080000000ULL)
+ : BitsToDouble(0x4330000000000000ULL),
MVT::f64);
// subtract the bias
SDOperand Sub = DAG.getNode(ISD::SUB, MVT::f64, Load, Bias);
More information about the llvm-commits
mailing list