Hello I want to transfer value (Value* src) of the type `FloatTyID` to `DoubleTyID`(I need all floats to be saved as 8 bytes).I have tried: builder.CreateCast(llvm::Instruction::FPExt, src, llvm::Type::getDoubleTy(llvmContext),””) I don`t know if I use CreateCast correctly and if this approach is correct at all. Thank you. Yakov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111114/8fe292a5/attachment.html>
Hi Yakov, that looks correct to me. You can also use CreateFPExt which is slightly simpler. Ciao, Duncan.> I want to transfer value (Value* src) of the type `FloatTyID` to `DoubleTyID`(I > need all floats to be saved as 8 bytes).I have tried: > > builder.CreateCast(llvm::Instruction::FPExt, src, > llvm::Type::getDoubleTy(llvmContext),””) > > I don`t know if I use CreateCast correctly and if this approach is correct at all. > > Thank you. > > Yakov > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
It doesnt work it fails with assertation that cast is invalid .What could be done? On 11/14/11, Duncan Sands <baldrick at free.fr> wrote:> Hi Yakov, that looks correct to me. You can also use CreateFPExt which is > slightly simpler. > > Ciao, Duncan. > > >> I want to transfer value (Value* src) of the type `FloatTyID` to >> `DoubleTyID`(I >> need all floats to be saved as 8 bytes).I have tried: >> >> builder.CreateCast(llvm::Instruction::FPExt, src, >> llvm::Type::getDoubleTy(llvmContext),””) >> >> I don`t know if I use CreateCast correctly and if this approach is >> correct at all. >> >> Thank you. >> >> Yakov >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Yakov