diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-05-04 03:37:38 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-05-04 03:37:38 +0000 |
commit | e4b4394b2f53c6ee8690669164710b109274a574 (patch) | |
tree | 94eca57895f96d61e391e515210c3a61c5a4934c /lib/ExecutionEngine/Interpreter | |
parent | 05047444099daca7b269549e2c003a5e45f805da (diff) | |
download | external_llvm-e4b4394b2f53c6ee8690669164710b109274a574.zip external_llvm-e4b4394b2f53c6ee8690669164710b109274a574.tar.gz external_llvm-e4b4394b2f53c6ee8690669164710b109274a574.tar.bz2 |
Bitcast all the bits of a floating point value, not just one. The zero
extension is needed because the constructor for the Destination value
causes the APInt to have a bit width of 1.
Patch by Guoling Han.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index ddfaffd..4d6c0db 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1087,8 +1087,10 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy, Dest.PointerVal = Src.PointerVal; } else if (DstTy->isInteger()) { if (SrcTy == Type::FloatTy) { + Dest.IntVal.zext(sizeof(Src.FloatVal) * 8); Dest.IntVal.floatToBits(Src.FloatVal); } else if (SrcTy == Type::DoubleTy) { + Dest.IntVal.zext(sizeof(Src.DoubleVal) * 8); Dest.IntVal.doubleToBits(Src.DoubleVal); } else if (SrcTy->isInteger()) { Dest.IntVal = Src.IntVal; |