nir/lower_idiv: make lowered divisions exact

I can't imagine any reasonable optimization which could break this, but
since it's lowered from an integer instructions, we shouldn't do anything
which could change the result.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081>
This commit is contained in:
Rhys Perry
2021-04-07 19:45:57 +01:00
committed by Marge Bot
parent a2619b97f5
commit 254360d96c
+2
View File
@@ -247,6 +247,8 @@ lower_idiv(nir_builder *b, nir_instr *instr, void *_data)
nir_ssa_def *numer = nir_ssa_for_alu_src(b, alu, 0);
nir_ssa_def *denom = nir_ssa_for_alu_src(b, alu, 1);
b->exact = true;
if (numer->bit_size < 32)
return convert_instr_small(b, alu->op, numer, denom, options);
else if (options->imprecise_32bit_lowering)