mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Fix Transforms/ConstProp/2007-02-05-BitCast.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
37d94b42a7
commit
775bd83050
@ -296,8 +296,12 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
||||
// Handle ConstantFP input.
|
||||
if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
|
||||
// FP -> Integral.
|
||||
if (DestTy->isInteger())
|
||||
if (DestTy == Type::Int32Ty) {
|
||||
return ConstantInt::get(DestTy, FloatToBits(FP->getValue()));
|
||||
} else {
|
||||
assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
|
||||
return ConstantInt::get(DestTy, DoubleToBits(FP->getValue()));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user