nir: Add nir_[iu]shr_imm and nir_udiv_imm helpers and use them.
authorEric Anholt <eric@anholt.net>
Fri, 21 Aug 2020 18:21:33 +0000 (11:21 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 24 Aug 2020 16:53:17 +0000 (09:53 -0700)
commitd84a16e4817c33eb8cf7d47cc15e6a3ee6385cd1
treeeb4902d78278a581532a3272b54d0dfe7c431bc0
parente78b887f76706ed0667457079474c31ac08374d0
nir: Add nir_[iu]shr_imm and nir_udiv_imm helpers and use them.

I was doing math manually in a lowering pass for converting a division to
a ushr, and this will let the pass be expressed more naturally.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6378>
src/compiler/nir/nir_builder.h
src/compiler/nir/nir_format_convert.h
src/compiler/nir/nir_lower_bit_size.c
src/compiler/nir/nir_lower_double_ops.c
src/compiler/nir/nir_lower_int64.c
src/compiler/nir/nir_opt_idiv_const.c