Module: Mesa Branch: master Commit: f9bc168bd3fb92b60988b0b35dc356018c8a3eb9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9bc168bd3fb92b60988b0b35dc356018c8a3eb9
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Dec 31 16:16:07 2020 -0500 pan/bi: Add bi_swz_16 helper Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065> --- src/panfrost/bifrost/compiler.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index d2b1d414ccd..7d01e3db015 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -168,13 +168,19 @@ bi_word(bi_index idx, unsigned component) /* Helps construct swizzles */ static inline bi_index -bi_half(bi_index idx, bool upper) +bi_swz_16(bi_index idx, bool x, bool y) { assert(idx.swizzle == BI_SWIZZLE_H01); - idx.swizzle = upper ? BI_SWIZZLE_H11 : BI_SWIZZLE_H00; + idx.swizzle = BI_SWIZZLE_H00 | (x << 1) | y; return idx; } +static inline bi_index +bi_half(bi_index idx, bool upper) +{ + return bi_swz_16(idx, upper, upper); +} + static inline bi_index bi_byte(bi_index idx, unsigned lane) { _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
