<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Most excellent. Thanks!<div><br></div><div><br><div><div>On Jul 9, 2013, at 6:54 PM, Stephen Lin <<a href="mailto:stephenwlin@gmail.com">stephenwlin@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: stephenwlin<br>Date: Tue Jul  9 20:54:24 2013<br>New Revision: 185994<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=185994&view=rev">http://llvm.org/viewvc/llvm-project?rev=185994&view=rev</a><br>Log:<br>Explicitly define ARMISelLowering::isFMAFasterThanFMulAndFAdd. No functionality change.<br><br>Currently ARM is the only backend that supports FMA instructions (for at least some subtargets) but does not implement this virtual, so FMAs are never generated except from explicit fma intrinsic calls. Apparently this is due to the fact that it supports both fused (one rounding step) and unfused (two rounding step) multiply + add instructions. This patch clarifies that this the case without changing behavior by implementing the virtual function to simply return false, as the default TargetLoweringBase version does.<br><br>It is possible that some cpus perform the fused version faster than the unfused version and vice-versa, so the function implementation should be revisited if hard data is found.<br><br>Modified:<br>   llvm/trunk/lib/Target/ARM/ARMISelLowering.h<br><br>Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=185994&r1=185993&r2=185994&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=185994&r1=185993&r2=185994&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original)<br>+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Tue Jul  9 20:54:24 2013<br>@@ -458,6 +458,17 @@ namespace llvm {<br>    SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,<br>                              const ARMSubtarget *ST) const;<br><br>+    /// isFMAFasterThanFMulAndFAdd - Return true if an FMA operation is faster<br>+    /// than a pair of fmul and fadd instructions. fmuladd intrinsics will be<br>+    /// expanded to FMAs when this method returns true, otherwise fmuladd is<br>+    /// expanded to fmul + fadd.<br>+    ///<br>+    /// ARM supports both fused and unfused multiply-add operations; we already<br>+    /// lower a pair of fmul and fmadd to the latter so it's not clear that there<br>+    /// would be a gain or that the gain would be worthwhile enough to risk<br>+    /// correctness bugs.<br>+    virtual bool isFMAFasterThanFMulAndFAdd(EVT VT) const { return false; }<br>+<br>    SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const;<br><br>    SDValue LowerCallResult(SDValue Chain, SDValue InFlag,<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></div></body></html>