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) {