From a84e32484778fb535d3ad8a266b884e14ad194da Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 29 Jan 2018 15:24:17 -0500 Subject: [PATCH] freedreno/ir3: fix printing of relative branch offsets The number of bits depends on generation. But printing negative values with a5xx encoding (largest size) but compiling for a3xx or a4xx, would result in negative values printed as large positive values. I guess in practice huge negative branch offsets aren't likely (and if that is the case, the shader is probably too big to grok by reading the assembly). So just print using smallest bitfield size. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/disasm-a3xx.c | 4 ++-- src/gallium/drivers/freedreno/ir3/instr-a3xx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/disasm-a3xx.c b/src/gallium/drivers/freedreno/ir3/disasm-a3xx.c index 4cb174cb2a4..1c81c387127 100644 --- a/src/gallium/drivers/freedreno/ir3/disasm-a3xx.c +++ b/src/gallium/drivers/freedreno/ir3/disasm-a3xx.c @@ -159,11 +159,11 @@ static void print_instr_cat0(instr_t *instr) break; case OPC_BR: printf(" %sp0.%c, #%d", cat0->inv ? "!" : "", - component[cat0->comp], cat0->a5xx.immed); + component[cat0->comp], cat0->a3xx.immed); break; case OPC_JUMP: case OPC_CALL: - printf(" #%d", cat0->a5xx.immed); + printf(" #%d", cat0->a3xx.immed); break; } diff --git a/src/gallium/drivers/freedreno/ir3/instr-a3xx.h b/src/gallium/drivers/freedreno/ir3/instr-a3xx.h index 55198cc053e..65fc212c1c2 100644 --- a/src/gallium/drivers/freedreno/ir3/instr-a3xx.h +++ b/src/gallium/drivers/freedreno/ir3/instr-a3xx.h @@ -301,7 +301,7 @@ typedef struct PACKED { uint32_t dummy1 : 12; } a4xx; struct PACKED { - uint32_t immed : 32; + int32_t immed : 32; } a5xx; }; -- 2.30.2