diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index c59e962e8dd..fa203839adb 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -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) {