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 <robdclark@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ typedef struct PACKED {
|
||||
uint32_t dummy1 : 12;
|
||||
} a4xx;
|
||||
struct PACKED {
|
||||
uint32_t immed : 32;
|
||||
int32_t immed : 32;
|
||||
} a5xx;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user