aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2020-06-08 06:23:50 +1000
committerMarge Bot <[email protected]>2020-06-10 22:52:41 +0000
commit9670c087a7a0c6927f847c2609852dceb2583360 (patch)
treef1474def391e5d651dae112961b684b19f1edcdc /src
parent59b44f90aa4db9425ed05d415c61ef63ced66726 (diff)
nvir/nir: use nir_lower_idiv
NIR provides a common implementation of this so we don't need to use a hand-written built-in library. v2: - use idiv_precise instead Especially important on SM70 where we don't have an assembler. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5377>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index 1ed34ae2652..fcf811f59cb 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -3285,6 +3285,11 @@ Converter::run()
NIR_PASS_V(nir, nir_lower_alu_to_scalar, NULL, NULL);
NIR_PASS_V(nir, nir_lower_phis_to_scalar);
+ /*TODO: improve this lowering/optimisation loop so that we can use
+ * nir_opt_idiv_const effectively before this.
+ */
+ NIR_PASS(progress, nir, nir_lower_idiv, nir_lower_idiv_precise);
+
do {
progress = false;
NIR_PASS(progress, nir, nir_copy_prop);