From 121f30005ff3000ef7f401ba21e171577c1db4e5 Mon Sep 17 00:00:00 2001 From: SoroushIMG Date: Thu, 29 Sep 2022 14:59:06 +0100 Subject: [PATCH] nir: track whether a loop contains soft fp64 ops Reviewed-by: Mike Blumenkrantz Part-of: --- src/compiler/nir/nir.h | 3 +++ src/compiler/nir/nir_loop_analyze.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 0d3222b5d1e..06987a8eeee 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2871,6 +2871,9 @@ typedef struct { /* Estimated cost (in number of instructions) of the loop */ unsigned instr_cost; + /* Contains fp64 ops that will be lowered */ + bool has_soft_fp64; + /* Guessed trip count based on array indexing */ unsigned guessed_trip_count; diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c index 8e0b72e6d71..309cf580db9 100644 --- a/src/compiler/nir/nir_loop_analyze.c +++ b/src/compiler/nir/nir_loop_analyze.c @@ -216,8 +216,10 @@ instr_cost(loop_info_state *state, nir_instr *instr, cost *= 20; /* If it's full software, it's even more expensive */ - if (options->lower_doubles_options & nir_lower_fp64_full_software) + if (options->lower_doubles_options & nir_lower_fp64_full_software) { cost *= 100; + state->loop->info->has_soft_fp64 = true; + } return cost; } else {