From ce026909028b090dae82961ec17ed0fb30d2d713 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 13 Oct 2024 22:31:01 -0400 Subject: [PATCH] agx: special case mov_imm so we can rm a worse special case Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_opcodes.py | 1 - src/asahi/compiler/agx_pack.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_opcodes.py b/src/asahi/compiler/agx_opcodes.py index ac22ce62b03..8e4ef117668 100644 --- a/src/asahi/compiler/agx_opcodes.py +++ b/src/asahi/compiler/agx_opcodes.py @@ -247,7 +247,6 @@ op("hmul", op("mov_imm", encoding_32 = (0x62, 0xFF, 6, 8), - encoding_16 = (0x62, 0xFF, 4, 6), imms = [IMM]) op("iadd", diff --git a/src/asahi/compiler/agx_pack.c b/src/asahi/compiler/agx_pack.c index dd31554bbd4..b5ed490f587 100644 --- a/src/asahi/compiler/agx_pack.c +++ b/src/asahi/compiler/agx_pack.c @@ -513,6 +513,9 @@ agx_pack_alu(struct util_dynarray *emission, agx_instr *I) /* Determine length bit */ unsigned length = encoding.length_short; + if (I->op == AGX_OPCODE_MOV_IMM && I->dest[0].size == AGX_SIZE_16) + length -= 2; + uint64_t short_mask = BITFIELD64_MASK(8 * length); bool length_bit = (extend || (raw & ~short_mask));