i965: use double lowering pass
authorConnor Abbott <connor.w.abbott@intel.com>
Mon, 3 Aug 2015 22:02:05 +0000 (15:02 -0700)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:01 +0000 (11:25 +0200)
v2: also lower trunc, ceil, floor, fract and roundEven (Iago)
v3: also lower mod for doubles (Sam)

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_compiler.c
src/mesa/drivers/dri/i965/brw_nir.c

index 6141b0d58c3ba77257f9136c4cf7a7b1f876cd6c..eda0f6fa3280e5ac48de92b3ba2a66ddbfd27710 100644 (file)
@@ -77,6 +77,7 @@ shader_perf_log_mesa(void *data, const char *fmt, ...)
    .lower_fdiv = true,                                                        \
    .lower_scmp = true,                                                        \
    .lower_fmod32 = true,                                                      \
+   .lower_fmod64 = false,                                                     \
    .lower_bitfield_extract = true,                                            \
    .lower_bitfield_insert = true,                                             \
    .lower_uadd_carry = true,                                                  \
index 5475276d9cf9e3cfb0d5fa5e5ebbd535cf431902..4830774ebbb93b0acc67c21dc9eee09db44be9d4 100644 (file)
@@ -410,6 +410,15 @@ nir_optimize(nir_shader *nir, bool is_scalar)
       OPT(nir_opt_dead_cf);
       OPT(nir_opt_remove_phis);
       OPT(nir_opt_undef);
+      OPT_V(nir_lower_doubles, nir_lower_drcp |
+                               nir_lower_dsqrt |
+                               nir_lower_drsq |
+                               nir_lower_dtrunc |
+                               nir_lower_dfloor |
+                               nir_lower_dceil |
+                               nir_lower_dfract |
+                               nir_lower_dround_even |
+                               nir_lower_dmod);
    } while (progress);
 
    return nir;