From ee5713a4186fd6853c5aafabaae578928ce232b2 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Thu, 30 Jan 2025 11:56:15 +0000 Subject: [PATCH] pan/bi: Remove shift lanes invalid encodings We were wrongly defining values that select more than one byte. The swizzle used for H01 was working fine for v9 and v10, but this generate an invalid encoding on Avalon. This fixes this by using B00 variant as we are only using 8-bit sources. Fixes: f45654af5953 ("pan/va: Add packing routines") Signed-off-by: Mary Guillemard Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Boris Brezillon Reviewed-by: Erik Faye-Lund Part-of: (cherry picked from commit 637cb0a99304bbdfd585814a55fd1b179353d1ab) --- .pick_status.json | 2 +- src/panfrost/compiler/valhall/ISA.xml | 6 +++--- src/panfrost/compiler/valhall/va_lower_constants.c | 2 +- src/panfrost/compiler/valhall/va_pack.c | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f366bce5cfb..404ac186aa6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -154,7 +154,7 @@ "description": "pan/bi: Remove shift lanes invalid encodings", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f45654af5953d86b4b82760b51a502fb25244073", "notes": null diff --git a/src/panfrost/compiler/valhall/ISA.xml b/src/panfrost/compiler/valhall/ISA.xml index 18e23d02493..7227b24c21b 100644 --- a/src/panfrost/compiler/valhall/ISA.xml +++ b/src/panfrost/compiler/valhall/ISA.xml @@ -200,7 +200,7 @@ Used to select the 2 bytes for shifts of 16-bit vectors - b02 + @@ -210,8 +210,8 @@ b33 - b01 - b23 + + diff --git a/src/panfrost/compiler/valhall/va_lower_constants.c b/src/panfrost/compiler/valhall/va_lower_constants.c index be5a40586c4..81a5874ac12 100644 --- a/src/panfrost/compiler/valhall/va_lower_constants.c +++ b/src/panfrost/compiler/valhall/va_lower_constants.c @@ -238,7 +238,7 @@ 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 && I->src[s].swizzle == BI_SWIZZLE_H01) { + if ((info.lane || info.lanes) && I->src[s].swizzle == BI_SWIZZLE_H01) { assert(info.size == VA_SIZE_8); I->src[s] = bi_byte(I->src[s], 0); } diff --git a/src/panfrost/compiler/valhall/va_pack.c b/src/panfrost/compiler/valhall/va_pack.c index 8fcacdab554..74ae571d14c 100644 --- a/src/panfrost/compiler/valhall/va_pack.c +++ b/src/panfrost/compiler/valhall/va_pack.c @@ -349,8 +349,6 @@ static enum va_lanes_8_bit va_pack_shift_lanes(const bi_instr *I, enum bi_swizzle swz) { switch (swz) { - case BI_SWIZZLE_H01: - return VA_LANES_8_BIT_B02; case BI_SWIZZLE_B0000: return VA_LANES_8_BIT_B00; case BI_SWIZZLE_B1111: