This is so we can just use the same function when it's zero.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
unsigned rshift, unsigned bitwidth)
{
nir_ssa_def *value = ac_nir_load_arg(b, ac_args, arg);
- return nir_ubfe_imm(b, value, rshift, bitwidth);
+ if (rshift)
+ return nir_ubfe_imm(b, value, rshift, bitwidth);
+ else
+ return nir_iand_imm(b, value, BITFIELD_MASK(bitwidth));
}
static bool