diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2007-10-07 11:45:55 +0000 |
---|---|---|
committer | Neil Booth <neil@daikokuya.co.uk> | 2007-10-07 11:45:55 +0000 |
commit | 5f00973393f24c093c5631b3a662cca54f777e49 (patch) | |
tree | 23358596dcd3b0a1dff45ad642f1dc9a43de2616 /llvm/lib/VMCore/ConstantFold.cpp | |
parent | c330d008f48a3a7a396743f4cf4bdebbdafa8ba7 (diff) | |
download | bcm5719-llvm-5f00973393f24c093c5631b3a662cca54f777e49.tar.gz bcm5719-llvm-5f00973393f24c093c5631b3a662cca54f777e49.zip |
convertFromInteger, as originally written, expected sign-extended
input. APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input. Make this
assumption explicit in the function name.
llvm-svn: 42732
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index 72077db3780..8234900032c 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/lib/VMCore/ConstantFold.cpp @@ -216,7 +216,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V, uint32_t BitWidth = cast<IntegerType>(SrcTy)->getBitWidth(); APFloat apf = APFloat(APInt(DestTy->getPrimitiveSizeInBits(), 2, zero)); - (void)apf.convertFromInteger(api.getRawData(), BitWidth, + (void)apf.convertFromZeroExtendedInteger(api.getRawData(), BitWidth, opc==Instruction::SIToFP, APFloat::rmNearestTiesToEven); return ConstantFP::get(DestTy, apf); |