From 254360d96cab8a5868d4f7b795c4b2816295f468 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 7 Apr 2021 19:45:57 +0100 Subject: [PATCH] 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 Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/nir/nir_lower_idiv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c index c477fd5..1f1c940 100644 --- a/src/compiler/nir/nir_lower_idiv.c +++ b/src/compiler/nir/nir_lower_idiv.c @@ -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) -- 2.7.4