mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 17:50:39 +02:00
nir: add nir_shr builder
Sometimes we need to select between ishr/ushr based some condition; this builder makes this less verbose. Signed-off-by: Job Noorman <jnoorman@igalia.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37793>
This commit is contained in:
parent
10a8defecc
commit
18f69890d1
1 changed files with 6 additions and 0 deletions
|
|
@ -1213,6 +1213,12 @@ nir_ushr_imm(nir_builder *build, nir_def *x, uint32_t y)
|
|||
}
|
||||
}
|
||||
|
||||
static inline nir_def *
|
||||
nir_shr(nir_builder *build, bool is_signed, nir_def *x, nir_def *y)
|
||||
{
|
||||
return is_signed ? nir_ishr(build, x, y) : nir_ushr(build, x, y);
|
||||
}
|
||||
|
||||
static inline nir_def *
|
||||
nir_imod_imm(nir_builder *build, nir_def *x, uint64_t y)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue