From 1481b14fcb54af9b2263caddc2788dc11e7dca08 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Thu, 13 Feb 2025 16:13:51 +0100 Subject: [PATCH] pan/bi: Lower SWZ.v4i8 to multiple MKVEC.v2i8 on v11+ IADD.v4u8 was removed on v11, as a result we now need to lower SWZ.v4i8 to multiple MKVEC.v2i8 to reproduce this behaviour. Signed-off-by: Mary Guillemard Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/compiler/valhall/va_lower_isel.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/valhall/va_lower_isel.c b/src/panfrost/compiler/valhall/va_lower_isel.c index 284289573f6..9f74a9a8cfe 100644 --- a/src/panfrost/compiler/valhall/va_lower_isel.c +++ b/src/panfrost/compiler/valhall/va_lower_isel.c @@ -34,8 +34,17 @@ lower(bi_builder *b, bi_instr *I) case BI_OPCODE_SWZ_V2I16: return bi_iadd_v2u16_to(b, I->dest[0], I->src[0], bi_zero(), false); - case BI_OPCODE_SWZ_V4I8: + case BI_OPCODE_SWZ_V4I8: { + /* IADD.v4u8 is gone on v11 */ + if (b->shader->arch >= 11) { + assert(I->src[0].swizzle >= BI_SWIZZLE_B0000 && + I->src[0].swizzle <= BI_SWIZZLE_B3333); + bi_index tmp = bi_mkvec_v2i8(b, I->src[0], I->src[0], bi_zero()); + return bi_mkvec_v2i8_to(b, I->dest[0], I->src[0], I->src[0], tmp); + } + return bi_iadd_v4u8_to(b, I->dest[0], I->src[0], bi_zero(), false); + } case BI_OPCODE_ICMP_I32: return bi_icmp_or_u32_to(b, I->dest[0], I->src[0], I->src[1], bi_zero(),