[Mesa-dev] [PATCH] [RFC] gallivm: Use new LLVM fast-math-flags API

Alex Smith asmith at feralinteractive.com
Wed Feb 28 15:25:43 UTC 2018


Hi,

Could this (commit 5d61fa4e68b7eb6d481a37efdbb35fdce675a6ad on master) be
backported to the 17.3 branch to allow it to build with LLVM 6?

Thanks,
Alex

On 6 November 2017 at 21:16, Marek Olšák <maraeo at gmail.com> wrote:

> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>
> Marek
>
> On Mon, Nov 6, 2017 at 10:09 PM, Tobias Droste <tdroste at gmx.de> wrote:
> > LLVM 6 changed the API on the fast-math-flags:
> > https://reviews.llvm.org/rL317488
> >
> > NOTE: This also enables the new flag 'ApproxFunc' to allow for
> > approximations for library functions (sin, cos, ...). I'm not completly
> > convinced, that this is something mesa should do.
> >
> > Signed-off-by: Tobias Droste <tdroste at gmx.de>
> > ---
> >  src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> > index d988910a7e..1319407290 100644
> > --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> > +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> > @@ -830,7 +830,11 @@ lp_create_builder(LLVMContextRef ctx, enum
> lp_float_mode float_mode)
> >        llvm::unwrap(builder)->setFastMathFlags(flags);
> >        break;
> >     case LP_FLOAT_MODE_UNSAFE_FP_MATH:
> > +#if HAVE_LLVM >= 0x0600
> > +      flags.setFast();
> > +#else
> >        flags.setUnsafeAlgebra();
> > +#endif
> >        llvm::unwrap(builder)->setFastMathFlags(flags);
> >        break;
> >     }
> > --
> > 2.14.3
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180228/233f271c/attachment.html>


More information about the mesa-dev mailing list