From f2ecc95e44c5798a15cde4aa67887bc562756ccd Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 31 Mar 2015 17:03:39 -0400 Subject: nir: add lowering for idiv/udiv/umod Based on the algo from NV50LegalizeSSA::handleDIV() and handleMOD(). See also trans_idiv() in freedreno/ir3/ir3_compiler.c (which was an adaptation of the nv50 code from Ilia Mirkin). A python/numpy script which implements the same algorithm (and is possibly useful for debugging or analysis) can be found here: http://people.freedesktop.org/~robclark/div-lowering.py I've tested this on i965 hacked up to insert the idiv lowering pass, and on freedreno with NIR frontend. Signed-off-by: Rob Clark Tested-by: Eric Anholt (vc4) --- src/glsl/Makefile.sources | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glsl/Makefile.sources') diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index c3b70d4..9bdcb80 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -33,6 +33,7 @@ NIR_FILES = \ nir/nir_lower_atomics.c \ nir/nir_lower_global_vars_to_local.c \ nir/nir_lower_locals_to_regs.c \ + nir/nir_lower_idiv.c \ nir/nir_lower_io.c \ nir/nir_lower_phis_to_scalar.c \ nir/nir_lower_samplers.cpp \ -- cgit v1.1