_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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.
From: Tim NorthoverDate: 2014-07-25 11:17To: 刘亚龙Subject: Re: [LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
On 25 July 2014 18:50, Jim Grosbach <gros...@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.
From: Jim GrosbachDate: 2014-07-25 10:50To: 刘亚龙CC: llvmdevSubject: Re: [LLVMdev] FPU cannot be compatible with -soft-float code on mips by llc
The –soft-float option won't be necessary once FP16_TO_FP and FP_TO_FP16 are set to 'Expand' as Tim suggested. This will cause LLVM to replace these nodes with a libcall while everything else continues to use the hardware support.
I believe you need to add these calls to MipsISelLowering.cpp:
setOperationAction(ISD::FP16_TO_FP, MVT::f32, Expand); // Conversion from half -> float
setOperationAction(ISD::FP_TO_FP16, MVT::f32, Expand); // Conversion from float -> half
setOperationAction(ISD::FP16_TO_FP, MVT::f64, Expand); // Conversion from half -> double
setOperationAction(ISD::FP_TO_FP16, MVT::f64, Expand); // Conversion from double -> half