From 2f1ce296d0a2a9eb8bd7d88bb80cc87c61b2492d Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Tue, 4 Mar 2025 10:12:43 +0100 Subject: [PATCH] pan/bi: Ensure we select b0 with halfswizzle in va_lower_constants In case of constant lowering with halfswizzle sources, we were selecting h01 causing an invalid instruction error to be yield later. This can only be hit by conversion instructions and shouldn't be seen in the wild (as this should be eliminated before entering the backend). Signed-off-by: Mary Guillemard Fixes: 7d07fb9a679e ("pan/va: Handle 8-bit lane when lowering constants") Reviewed-by: Benjamin Lee Part-of: --- src/panfrost/compiler/valhall/va_lower_constants.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/valhall/va_lower_constants.c b/src/panfrost/compiler/valhall/va_lower_constants.c index 81a5874ac12..209d7e62fcd 100644 --- a/src/panfrost/compiler/valhall/va_lower_constants.c +++ b/src/panfrost/compiler/valhall/va_lower_constants.c @@ -238,7 +238,8 @@ va_lower_constants(bi_context *ctx, bi_instr *I) * applying the lane select puts the desired constant (at least) in the * bottom byte, so we can always select the bottom byte. */ - if ((info.lane || info.lanes) && I->src[s].swizzle == BI_SWIZZLE_H01) { + if ((info.lane || info.lanes || info.halfswizzle) && + I->src[s].swizzle == BI_SWIZZLE_H01) { assert(info.size == VA_SIZE_8); I->src[s] = bi_byte(I->src[s], 0); }