From 5d4df3ac23bb07743823118a344ce831b102dabf Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 28 Oct 2022 17:02:13 -0700 Subject: [PATCH] intel/compiler: Run extra fp64 lowering pass on devices that don't support int64. In some cases nir_lower_int64 will emit fp64 operations which aren't natively supported on any Intel hardware (e.g. ftrunc, frem). An extra pass of nir_opt_algebraic (for frem) and nir_lower_doubles is required in order to take care of them. This fixes several int64 test-cases on MTL hardware. Reviewed-by: Lionel Landwerlin Reviewed-by: Mykhailo Skorokhodov Part-of: --- src/intel/compiler/brw_nir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 760b661..8cbf39a 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -951,7 +951,10 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir, brw_nir_optimize(nir, compiler, is_scalar, true); OPT(nir_lower_doubles, softfp64, nir->options->lower_doubles_options); - OPT(nir_lower_int64); + if (OPT(nir_lower_int64)) { + OPT(nir_opt_algebraic); + OPT(nir_lower_doubles, softfp64, nir->options->lower_doubles_options); + } OPT(nir_lower_bit_size, lower_bit_size_callback, (void *)compiler); -- 2.7.4