radeonsi: add comments for unpack_2x16* utility functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25972>
This commit is contained in:
Ganesh Belgur Ramachandra 2023-10-31 06:37:33 -05:00 committed by Marge Bot
parent d5ef8a0ac0
commit 740a4c3448

View file

@ -27,12 +27,14 @@ static nir_def *get_global_ids(nir_builder *b, unsigned num_components)
return nir_iadd(b, nir_imul(b, block_ids, block_size), local_ids);
}
/* unpack_2x16(src, x, y): x = src & 0xffff; y = src >> 16; */
static void unpack_2x16(nir_builder *b, nir_def *src, nir_def **x, nir_def **y)
{
*x = nir_iand_imm(b, src, 0xffff);
*y = nir_ushr_imm(b, src, 16);
}
/* unpack_2x16_signed(src, x, y): x = (int32_t)((uint16_t)src); y = src >> 16; */
static void unpack_2x16_signed(nir_builder *b, nir_def *src, nir_def **x, nir_def **y)
{
*x = nir_i2i32(b, nir_u2u16(b, src));