<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 6 October 2017 at 03:39, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 6 October 2017 at 12:31, Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
> On Fri, Oct 6, 2017 at 4:10 AM, Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br>
>> On Thu, Oct 5, 2017 at 10:08 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
>>> On Fri, Oct 6, 2017 at 3:50 AM, Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br>
>>>> Why? While it might technically be legal, always generating an unfused<br>
>>>> mul+add when the user explicitly requested fma() seems harsh...<br>
>>><br>
>>> It's slow on some chips. It doesn't need any other reason.<br>
>>><br>
>>> Marek<br>
>><br>
>> Presumably, if the developer asked for fma, then they don't care how<br>
>> fast or slow it is...<br>
><br>
> Feral asked for fma. They care. This debate is pointless. We just<br>
> won't use fma by default. Period.<br>
<br>
</span>They didn't ask for it with precise precision. I'm assuming if someone wants<br>
fma with precise precision we should give it to them. Like at least<br>
the fma manpage states.<br>
<br>
<a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/fma.xhtml" rel="noreferrer" target="_blank">https://www.khronos.org/<wbr>registry/OpenGL-Refpages/gl4/<wbr>html/fma.xhtml</a></blockquote><div><br></div><div>Some of our older games (e.g. Tomb Raider) do actually request precise (based on what the original D3D shader asks for), so changing the behaviour on GL to use the proper fma would likely regress performance on those.</div><div><br></div><div>D3D's mad (which we've been using fma to implement) is similarly vague as GLSL about what the actual precision requirements are with precise: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ff471418(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ff471418(v=vs.85).aspx</a></div><div class="gmail_quote"><br></div>"If shader authors use the mad instrinsic to calculate a result that the shader marked as precise, they indicate to the hardware to use any valid implementation of the mad instruction (fused or not) as long as the implementation is consistent for all uses of that mad intrinsic in any shader on that hardware"</div><div class="gmail_quote"><br></div><div class="gmail_quote">From some quick testing I just did it looks like the AMD D3D driver always implements mad as v_mac_f32 regardless of whether precise is requested.</div><div class="gmail_quote"><br></div><div class="gmail_quote">So seems like (at least from our perspective!) it's not really an issue to not actually get a fused op, and clearly hasn't been an issue since radeonsi never gives you fused right now.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Alex</div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Dave.<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>