summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-04 03:37:38 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-04 03:37:38 +0000
commit0454316c79586cf713a029a96f1d3f16daaf59cc (patch)
tree95d6c296a900a400a78ea89bcad93094ef11c74e /llvm/lib
parent955162aaae6ab8e1f12ae0ee2aed5d337205d1ef (diff)
downloadbcm5719-llvm-0454316c79586cf713a029a96f1d3f16daaf59cc.tar.gz
bcm5719-llvm-0454316c79586cf713a029a96f1d3f16daaf59cc.zip
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. llvm-svn: 36733
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index ddfaffd87da..4d6c0db1054 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud