Module: Mesa
Branch: master
Commit: 254360d96cab8a5868d4f7b795c4b2816295f468
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=254360d96cab8a5868d4f7b795c4b2816295f468

Author: Rhys Perry <[email protected]>
Date:   Wed Apr  7 19:45:57 2021 +0100

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 <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081>

---

 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 c477fd53e85..1f1c940e22f 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)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to