From 3f25a73f17cb9e127b22a9172bba4195b2b31bc2 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sun, 22 Oct 2023 09:47:41 +0000 Subject: [PATCH] ir3: fix shift amount for 8-bit shifts Follow the 16-bit approach and convert shift amount to 8b for 8b shift instructions. Signed-off-by: Dmitry Baryshkov Part-of: --- src/freedreno/ir3/ir3_compiler_nir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index d1f36c7f493..0da15340814 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -294,10 +294,12 @@ static struct ir3_instruction * resize_shift_amount(struct ir3_context *ctx, struct ir3_instruction *src, unsigned bs) { - if (bs != 16) + if (bs == 16) + return ir3_COV(ctx->block, src, TYPE_U32, TYPE_U16); + else if (bs == 8) + return ir3_COV(ctx->block, src, TYPE_U32, TYPE_U8); + else return src; - - return ir3_COV(ctx->block, src, TYPE_U32, TYPE_U16); } static void