From e13f9caa255882b49b4835dfaac18d4f6fa491b7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 25 Apr 2023 13:51:46 -0400 Subject: [PATCH] agx: Fix packing for iadd with shift Wrong bit pattern was packed, oops. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_pack.c b/src/asahi/compiler/agx_pack.c index f7da2b0..30d15ca 100644 --- a/src/asahi/compiler/agx_pack.c +++ b/src/asahi/compiler/agx_pack.c @@ -415,8 +415,9 @@ agx_pack_alu(struct util_dynarray *emission, agx_instr *I) raw |= (I->truth_table & 0x3) << 26; raw |= (uint64_t)(I->truth_table >> 2) << 38; } else if (info.immediates & AGX_IMMEDIATE_SHIFT) { + assert(I->shift <= 4); raw |= (uint64_t)(I->shift & 1) << 39; - raw |= (uint64_t)(I->shift >> 2) << 52; + raw |= (uint64_t)(I->shift >> 1) << 52; } else if (info.immediates & AGX_IMMEDIATE_BFI_MASK) { raw |= (uint64_t)(I->bfi_mask & 0x3) << 38; raw |= (uint64_t)((I->bfi_mask >> 2) & 0x3) << 50; -- 2.7.4