diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp index f3799b15ed6..447f17bcf91 100644 --- a/src/intel/compiler/brw_fs_generator.cpp +++ b/src/intel/compiler/brw_fs_generator.cpp @@ -2260,6 +2260,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width, case SHADER_OPCODE_INT_QUOTIENT: case SHADER_OPCODE_INT_REMAINDER: case SHADER_OPCODE_POW: + assert(devinfo->verx10 < 125); assert(inst->conditional_mod == BRW_CONDITIONAL_NONE); if (devinfo->ver >= 6) { assert(inst->mlen == 0); diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 2f0cc634b92..1dd8d5e944e 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1100,6 +1100,14 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, OPT(nir_opt_algebraic_before_ffma); } while (progress); + if (devinfo->verx10 >= 125) { + const nir_lower_idiv_options options = { + .imprecise_32bit_lowering = false, + .allow_fp16 = false + }; + OPT(nir_lower_idiv, &options); + } + brw_nir_optimize(nir, compiler, is_scalar, false); if (is_scalar && nir_shader_has_local_variables(nir)) {