From f9bc168bd3fb92b60988b0b35dc356018c8a3eb9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 31 Dec 2020 16:16:07 -0500 Subject: [PATCH] pan/bi: Add bi_swz_16 helper Signed-off-by: Alyssa Rosenzweig Part-of: --- 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) {