刘亚龙
2014-Jul-25 01:32 UTC
[LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
Hi all, -soft-float can not be rightly use by llc. All float function operation will call soft float, but not hard. My mips device cannot support half float type, so I hack the llvm, and add soft half float and add -soft-float option. I add the function define for __gnu_f2h_ieee() and __gnu_h2f_ieee (), and it can call the soft half float. However, all the others function about float also call the soft float, how I do make only __gnu_f2h_ieee() use soft float, other use hard float??? Thank you all !! Cheers, Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140724/d4a0a47b/attachment.html>
Jim Grosbach
2014-Jul-25 17:50 UTC
[LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
Hi Robin, It sounds like you want to support half (f16 in LLVM terms) as a storage only interchange format. AArch64 and X86 (among others) do the same thing. You shouldn’t need the “-soft-float” option or anything of that nature at all. That, as you’ve found, disables all hard float operations. There’s been some recent cleanup in how this is handled in LLVM that should help guide you in what the Mips backend needs to do. In particular, Tim Northover’s recent patch, r213374. Regards, Jim> On Jul 24, 2014, at 6:32 PM, 刘亚龙 <liuyalong.email at gmail.com> wrote: > > Hi all, > -soft-float can not be rightly use by llc. All float function operation will call soft float, but not hard. > My mips device cannot support half float type, so I hack the llvm, and add soft half float and add -soft-float option. > I add the function define for __gnu_f2h_ieee() and __gnu_h2f_ieee (), and it can call the soft half float. > However, all the others function about float also call the soft float, how I do make only __gnu_f2h_ieee() use soft float, other use hard float??? > > Thank you all !! > > Cheers, > Robin > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140725/495b37dc/attachment.html>
Tim Northover
2014-Jul-25 18:17 UTC
[LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
On 25 July 2014 18:50, Jim Grosbach <grosbach at apple.com> wrote:> It sounds like you want to support half (f16 in LLVM terms) as a storage > only interchange format. AArch64 and X86 (among others) do the same thing. > You shouldn’t need the “-soft-float” option or anything of that nature at > all. That, as you’ve found, disables all hard float operations. There’s been > some recent cleanup in how this is handled in LLVM that should help guide > you in what the Mips backend needs to do. In particular, Tim Northover’s > recent patch, r213374.As well as what's in that commit, you probably want to mark ISD::FP16_TO_FP and ISD::FP_TO_FP16 as "Expand" in MipsISelLowering.cpp. Then your implementations of "__gnu_..." should be called for fp16 conversions, but not normal floating point arithmetic. Cheers. Tim.
刘亚龙
2014-Jul-28 08:20 UTC
[LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
Hi Jim, X86 and ARM have the assembly instruction convert float to half/covert half to float, so they need not to call libcall, but MIPS have not. So we must add -soft-float option. The terrible thing is all function will be using soft, not FPU (hard). Cheers, Robin ------------------------------ liuyalong.email at gmail.com *From:* Jim Grosbach <grosbach at apple.com> *Date:* 2014-07-25 10:50 *To:* 刘亚龙 <liuyalong.email at gmail.com> *CC:* llvmdev <llvmdev at cs.uiuc.edu> *Subject:* Re: [LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc Hi Robin, It sounds like you want to support half (f16 in LLVM terms) as a storage only interchange format. AArch64 and X86 (among others) do the same thing. You shouldn’t need the “-soft-float” option or anything of that nature at all. That, as you’ve found, disables all hard float operations. There’s been some recent cleanup in how this is handled in LLVM that should help guide you in what the Mips backend needs to do. In particular, Tim Northover’s recent patch, r213374. Regards, Jim On Jul 24, 2014, at 6:32 PM, 刘亚龙 <liuyalong.email at gmail.com> wrote: Hi all, -soft-float can not be rightly use by llc. All float function operation will call soft float, but not hard. My mips device cannot support half float type, so I hack the llvm, and add soft half float and add -soft-float option. I add the function define for __gnu_f2h_ieee() and __gnu_h2f_ieee (), and it can call the soft half float. However, all the others function about float also call the soft float, how I do make only __gnu_f2h_ieee() use soft float, other use hard float??? Thank you all !! Cheers, Robin _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140728/e17a90e7/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Help!!!!Help!!!! " LLVM ERROR: Cannot select: 0x9fc9680: i32 = fp32_to_fp16 0x9fc0750 [ID=16] " problem!!!!!!!!!!!!!!!!!!
- TypePromoteFloat loses intermediate rounding operations
- TypePromoteFloat loses intermediate rounding operations
- [LLVMdev] Help!!!!Help!!!! " LLVM ERROR: Cannot select: 0x9fc9680: i32 = fp32_to_fp16 0x9fc0750 [ID=16] " problem!!!!!!!!!!!!!!!!!!
- [PATCH 2 of 8] FPU: create FPU init and destroy functions