[Mesa-dev] [PATCH] ac/nir: use llvm fma intrinsic if nir instruction is exact.

Jason Ekstrand jason at jlekstrand.net
Fri Oct 6 03:42:35 UTC 2017


On Thu, Oct 5, 2017 at 7:39 PM, Dave Airlie <airlied at gmail.com> wrote:

> On 6 October 2017 at 12:31, Marek Olšák <maraeo at gmail.com> wrote:
> > On Fri, Oct 6, 2017 at 4:10 AM, Connor Abbott <cwabbott0 at gmail.com>
> wrote:
> >> On Thu, Oct 5, 2017 at 10:08 PM, Marek Olšák <maraeo at gmail.com> wrote:
> >>> On Fri, Oct 6, 2017 at 3:50 AM, Connor Abbott <cwabbott0 at gmail.com>
> wrote:
> >>>> Why? While it might technically be legal, always generating an unfused
> >>>> mul+add when the user explicitly requested fma() seems harsh...
> >>>
> >>> It's slow on some chips. It doesn't need any other reason.
> >>>
> >>> Marek
> >>
> >> Presumably, if the developer asked for fma, then they don't care how
> >> fast or slow it is...
> >
> > Feral asked for fma. They care. This debate is pointless. We just
> > won't use fma by default. Period.
>
> They didn't ask for it with precise precision. I'm assuming if someone
> wants
> fma with precise precision we should give it to them. Like at least
> the fma manpage states.
>

Eh, fma() doesn't guarantee additional precision so anyone who's counting
on that is in for some trouble.  If someone uses fma() explicitly its
because they either care about speed (in which case fma on radeon doesn't
make sense from what Marek says) or because they want to explicitly control
the order of operations.  Giving them the slow thing just because the GPU
has that instruction is *not* what they want.

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171005/120d335f/attachment.html>


More information about the mesa-dev mailing list