[Mesa-dev] [PATCH 2/2] i965/compiler: Disable trig workarounds on KBL+

Anuj Phogat anuj.phogat at gmail.com
Tue Nov 8 23:49:52 UTC 2016


On Tue, Nov 8, 2016 at 1:21 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:

> The precision of our trig instructions instructions appears to have been
>
​s/​instructions instructions/instructions

> fixed on Kaby Lake.  Neither Ben nor I can find any documentation for this.
> However, the dEQP precision tests now pass with INTEL_PRECISE_TRIG=0 where
> they fail on Sky Lake.
>
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/mesa/drivers/dri/i965/brw_nir.c                   | 5 ++++-
>  src/mesa/drivers/dri/i965/brw_nir_trig_workarounds.py | 7 ++++---
>  2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_nir.c
> b/src/mesa/drivers/dri/i965/brw_nir.c
> index a93d825..1069438 100644
> --- a/src/mesa/drivers/dri/i965/brw_nir.c
> +++ b/src/mesa/drivers/dri/i965/brw_nir.c
> @@ -449,6 +449,7 @@ nir_optimize(nir_shader *nir, bool is_scalar)
>  nir_shader *
>  brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
>  {
> +   const struct gen_device_info *devinfo = compiler->devinfo;
>     bool progress; /* Written by OPT and OPT_V */
>     (void)progress;
>
> @@ -457,7 +458,9 @@ brw_preprocess_nir(const struct brw_compiler
> *compiler, nir_shader *nir)
>     if (nir->stage == MESA_SHADER_GEOMETRY)
>        OPT(nir_lower_gs_intrinsics);
>
> -   if (compiler->precise_trig)
> +   /* See also brw_nir_trig_workarounds.py */
> +   if (compiler->precise_trig &&
> +       !(devinfo->gen >= 10 || devinfo->is_kabylake))
>        OPT(brw_nir_apply_trig_workarounds);
>
>     static const nir_lower_tex_options tex_options = {
> diff --git a/src/mesa/drivers/dri/i965/brw_nir_trig_workarounds.py
> b/src/mesa/drivers/dri/i965/brw_nir_trig_workarounds.py
> index 67dab9a..3b8d0ce 100755
> --- a/src/mesa/drivers/dri/i965/brw_nir_trig_workarounds.py
> +++ b/src/mesa/drivers/dri/i965/brw_nir_trig_workarounds.py
> @@ -23,9 +23,10 @@
>
>  import nir_algebraic
>
> -# The SIN and COS instructions on Intel hardware can produce values
> -# slightly outside of the [-1.0, 1.0] range for a small set of values.
> -# Obviously, this can break everyone's expectations about trig functions.
> +# Prior to Kaby Lake, The SIN and COS instructions on Intel hardware can
> +# produce values slightly outside of the [-1.0, 1.0] range for a small
> set of
> +# values.  Obviously, this can break everyone's expectations about trig
> +# functions.  This appears to be fixed in Kaby Lake.
>  #
>  # According to an internal presentation, the COS instruction can produce
>  # a value up to 1.000027 for inputs in the range (0.08296, 0.09888).  One
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> 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/20161108/e597a476/attachment-0001.html>


More information about the mesa-dev mailing list