diff options
author | Alyssa Rosenzweig <alyssa@collabora.com> | 2021-05-03 19:00:23 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-05 02:19:03 +0000 |
commit | 5e55824c626c170ce6f235b7a7e5190c3aeba688 (patch) | |
tree | 1cd40abcb2c2fd817349cc3ee5ea679977fd83c1 | |
parent | ff4ba3d4a77320d1522c3a807661511b4cc075ab (diff) |
pan/bi: Add imm_uintN helper
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10627>
-rw-r--r-- | src/panfrost/bifrost/compiler.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 4dad8518d25..6627d26070c 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -238,6 +238,15 @@ bi_imm_u16(uint16_t imm) } static inline bi_index +bi_imm_uintN(uint32_t imm, unsigned sz) +{ + assert(sz == 8 || sz == 16 || sz == 32); + return (sz == 8) ? bi_imm_u8(imm) : + (sz == 16) ? bi_imm_u16(imm) : + bi_imm_u32(imm); +} + +static inline bi_index bi_imm_f16(float imm) { return bi_imm_u16(_mesa_float_to_half(imm)); |