[llvm-dev] Inserting MachineInstr's
James Y Knight via llvm-dev
llvm-dev at lists.llvm.org
Mon Sep 7 22:00:49 PDT 2015
On Sep 7, 2015, at 9:40 PM, Chris.Dewhurst via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hi,
>
> I have a task to complete and I’m getting stuck. I can’t find anything comparable in the documentation. The shortest explanation I can give is as follows: I need to use double-precision floating point values for floating-point multiplies.
>
> Replace:
> fmuls %f20,%f21,%f8
>
> with the sequence:
> fstod %f20,%f0
> fstod %f21,%f2
> fmuld %f0,%f2,%f8
Are you sure you need to actually do this as a post-processing pass after code generation? Why not setOperationAction(ISD::FMUL, MVT::i32, Promote); SparcISelLowering.cpp? I believe that'd avoid having it get generated in the first place (although I've not tested it).
Also: which erratum are you trying to work around? UT699's "FMULS precision loss after FDIVD/FSQRTD"? If so, I'd think that the workaround option of adding a "std %fNN, [%sp-8]" after fdivd/fsqrtd instructions may be better?
More information about the llvm-dev
mailing list