[llvm] [SPARC] Use FMA instructions when we have UA2007 (PR #148434)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 20:19:52 PDT 2025


================
@@ -3570,6 +3572,15 @@ bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const {
   return isCheapToSpeculateCtlz(Ty);
 }
 
+bool SparcTargetLowering::isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
+                                                     EVT VT) const {
+  return !Subtarget->useSoftFloat();
----------------
koachan wrote:

No, in case of hardfloat non-UA2007 target then FMA isn't legal.
Should I only set this to true when FMA is legal?

https://github.com/llvm/llvm-project/pull/148434


More information about the llvm-commits mailing list