pan/bi: Handle LD_VAR_BUF_IMM encoding changes on v11+

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33608>
This commit is contained in:
Mary Guillemard
2025-01-30 11:56:24 +00:00
committed by Marge Bot
parent be64a5ae27
commit 20d7c93368
3 changed files with 10 additions and 7 deletions
@@ -29,7 +29,7 @@
#define CASE(instr, expected) \
do { \
uint64_t _value = va_pack_instr(instr); \
uint64_t _value = va_pack_instr(instr, 10); \
if (_value != expected) { \
fprintf(stderr, "Got %" PRIx64 ", expected %" PRIx64 "\n", _value, \
(uint64_t)expected); \
+1 -1
View File
@@ -44,7 +44,7 @@ void va_assign_slots(bi_context *ctx);
void va_insert_flow_control_nops(bi_context *ctx);
void va_merge_flow(bi_context *ctx);
void va_mark_last(bi_context *ctx);
uint64_t va_pack_instr(const bi_instr *I);
uint64_t va_pack_instr(const bi_instr *I, unsigned arch);
static inline unsigned
va_fau_page(enum bir_fau value)
+8 -5
View File
@@ -408,7 +408,7 @@ va_pack_rhadd(const bi_instr *I)
}
static uint64_t
va_pack_alu(const bi_instr *I)
va_pack_alu(const bi_instr *I, unsigned arch)
{
struct va_opcode_info info = valhall_opcodes[I->op];
uint64_t hex = 0;
@@ -506,7 +506,10 @@ va_pack_alu(const bi_instr *I)
hex |= ((uint64_t)I->varying_name) << 12; /* instead of index */
else if (I->op == BI_OPCODE_LD_VAR_BUF_IMM_F16 ||
I->op == BI_OPCODE_LD_VAR_BUF_IMM_F32) {
hex |= ((uint64_t)I->index) << 16;
if (arch >= 11)
hex |= ((uint64_t)I->index) << 8;
else
hex |= ((uint64_t)I->index) << 16;
} else if (I->op == BI_OPCODE_LD_VAR_IMM ||
I->op == BI_OPCODE_LD_VAR_FLAT_IMM) {
hex |= ((uint64_t)I->table) << 8;
@@ -791,7 +794,7 @@ va_pack_register_format(const bi_instr *I)
}
uint64_t
va_pack_instr(const bi_instr *I)
va_pack_instr(const bi_instr *I, unsigned arch)
{
struct va_opcode_info info = valhall_opcodes[I->op];
@@ -969,7 +972,7 @@ va_pack_instr(const bi_instr *I)
if (!info.exact && I->op != BI_OPCODE_NOP)
invalid_instruction(I, "opcode");
hex |= va_pack_alu(I);
hex |= va_pack_alu(I, arch);
break;
}
@@ -1105,7 +1108,7 @@ bi_pack_valhall(bi_context *ctx, struct util_dynarray *emission)
if (I->op == BI_OPCODE_BRANCHZ_I16)
va_lower_branch_target(ctx, block, I);
uint64_t hex = va_pack_instr(I);
uint64_t hex = va_pack_instr(I, ctx->arch);
util_dynarray_append(emission, uint64_t, hex);
}
}