<p dir="auto">I experienced  weird response when it comes to FMA on Julia 1.4 .</p>
<p dir="auto">First started Julia from the command line, without any flags (downloaded from julialang.org). Then I checked <code class="notranslate">mulladd</code> with code_native and find it's not using FMA CPU instructions and  <code class="notranslate">Base.Math.FMA_NATIVE</code> also showed false... that was strange since as long as I've used julia this was always true and FMA always used native instruction.</p>
<p dir="auto">Then I started Julia with <code class="notranslate">-O3</code>. Check thing again... <code class="notranslate">muladd</code> is correctly using native FMA, but <code class="notranslate">Base.Math.FMA_NATIVE</code> is false (makes sense since it's a precompile constant, but should  be fixed regardless).</p>
<p dir="auto">Then the strange behavior shows up. I then check julia again (without <code class="notranslate">-O3</code> flag) and native FMA is working correctly in <code class="notranslate">muladd</code>   (Base.Math.FMA_NATIVE still false).</p>
<p dir="auto">We currently check for support for FMA (fused multiply add) by doing</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const FMA_NATIVE = muladd(nextfloat(1.0),nextfloat(1.0),-nextfloat(1.0,2)) != 0"><pre class="notranslate"><code class="notranslate">const FMA_NATIVE = muladd(nextfloat(1.0),nextfloat(1.0),-nextfloat(1.0,2)) != 0
</code></pre></div>
<p dir="auto">From <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="483459999" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/33010" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/33010/hovercard?comment_id=523493896&amp;comment_type=issue_comment" href="https://github.com/JuliaLang/julia/pull/33010#issuecomment-523493896">#33010 (comment)</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/yuyichao/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yuyichao">@yuyichao</a> said:</p>
<blockquote>
<p dir="auto">This test is wrong. Llvm has all the freedom it want to return either values for muladd no matter if fma is available. Fwiw, arm / aarch 64 even have fast muladd instruction with intermediate rounding.</p>
</blockquote>