intel/compiler: Lower integer division on XeHP.

It has been removed from the hardware.

[jordan.l.justen@intel.com: Move to brw_postprocess_nir]

v2: Switch to nir_lower_idiv_precise (Rhys).
v3: Fix for interface changes of nir_lower_idiv.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
This commit is contained in:
Francisco Jerez
2018-11-19 14:54:43 -08:00
committed by Marge Bot
parent 49b2d9f428
commit 262b647b25
2 changed files with 9 additions and 0 deletions

View File

@@ -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);

View File

@@ -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)) {