From: Qiang Yu Date: Sat, 20 Jul 2019 10:11:07 +0000 (+0800) Subject: lima/ppir: fix disassembler temp read/write print X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=280dfa02fa288e7d141f36c6665f6134fd2d8cd9;p=mesa.git 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 --- 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) {