From 280dfa02fa288e7d141f36c6665f6134fd2d8cd9 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Sat, 20 Jul 2019 18:11:07 +0800 Subject: [PATCH] lima/ppir: fix disassembler temp read/write print temp read/write use negtive offset, and handle alignment==1 case. Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu --- src/gallium/drivers/lima/ir/pp/disasm.c | 32 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/lima/ir/pp/disasm.c b/src/gallium/drivers/lima/ir/pp/disasm.c index d2a3fb17d03..1f7dc0a5a80 100644 --- a/src/gallium/drivers/lima/ir/pp/disasm.c +++ b/src/gallium/drivers/lima/ir/pp/disasm.c @@ -304,10 +304,18 @@ print_uniform(void *code, unsigned offset) break; } - if (uniform->alignment) - printf(" %u", uniform->index); - else - printf(" %u.%c", uniform->index >> 2, "xyzw"[uniform->index & 3]); + int16_t index = uniform->index; + switch (uniform->alignment) { + case 2: + printf(" %d", index); + break; + case 1: + printf(" %d.%s", index / 2, (index & 1) ? "zw" : "xy"); + break; + default: + printf(" %d.%c", index / 4, "xyzw"[index & 3]); + break; + } if (uniform->offset_en) { printf(" "); @@ -649,11 +657,17 @@ print_temp_write(void *code, unsigned offset) printf("store.t"); - if (temp_write->temp_write.alignment) { - printf(" %u", temp_write->temp_write.index); - } else { - printf(" %u.%c", temp_write->temp_write.index >> 2, - "xyzw"[temp_write->temp_write.index & 3]); + int16_t index = temp_write->temp_write.index; + switch (temp_write->temp_write.alignment) { + case 2: + printf(" %d", index); + break; + case 1: + printf(" %d.%s", index / 2, (index & 1) ? "zw" : "xy"); + break; + default: + printf(" %d.%c", index / 4, "xyzw"[index & 3]); + break; } if (temp_write->temp_write.offset_en) { -- 2.30.2