diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 562f1207d24..6c1ff658cd3 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5460,6 +5460,7 @@ typedef struct nir_lower_subgroups_options { uint8_t ballot_bit_size; uint8_t ballot_components; bool lower_to_scalar : 1; + bool lower_fp64 : 1; bool lower_vote_trivial : 1; bool lower_vote_feq : 1; bool lower_vote_ieq : 1; diff --git a/src/compiler/nir/nir_lower_subgroups.c b/src/compiler/nir/nir_lower_subgroups.c index 944c43a466e..90af472c4d1 100644 --- a/src/compiler/nir/nir_lower_subgroups.c +++ b/src/compiler/nir/nir_lower_subgroups.c @@ -1036,7 +1036,8 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options) return lower_vote_eq(b, intrin); } else { if (intrin->intrinsic == nir_intrinsic_vote_feq && - options->lower_vote_feq) + (options->lower_vote_feq || + (options->lower_fp64 && intrin->src[0].ssa->bit_size == 64))) return lower_vote_eq(b, intrin); if (intrin->intrinsic == nir_intrinsic_vote_ieq && options->lower_vote_ieq) @@ -1295,7 +1296,8 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options) if (intrin->def.bit_size == 1 && options->ballot_components == 1 && (options->lower_boolean_reduce || options->lower_reduce)) return lower_boolean_reduce(b, intrin, options); - if (options->lower_reduce) + if (options->lower_reduce || + (options->lower_fp64 && intrin->def.bit_size == 64)) return lower_scan_reduce(b, intrin, options); return ret; } @@ -1306,7 +1308,8 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options) if (intrin->def.bit_size == 1 && options->ballot_components == 1 && (options->lower_boolean_reduce || options->lower_reduce)) return lower_boolean_reduce(b, intrin, options); - if (options->lower_reduce) + if (options->lower_reduce || + (options->lower_fp64 && intrin->def.bit_size == 64)) return lower_scan_reduce(b, intrin, options); break;