From d29a6e2db55cf020cc2d0647a741111decaa4821 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 25 May 2021 09:19:17 +0200 Subject: [PATCH] freedreno/isa: add defines for fprintf(..) usage In the long run they will be replaces with some generated defines. If we do this early it keeps the diffs of the next changes small. Signed-off-by: Christian Gmeiner Reviewed-by: Rob Clark Part-of: --- src/freedreno/isa/decode.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/freedreno/isa/decode.c b/src/freedreno/isa/decode.c index 4719301f10f..38db35757c6 100644 --- a/src/freedreno/isa/decode.c +++ b/src/freedreno/isa/decode.c @@ -40,6 +40,9 @@ #include "decode.h" #include "isa.h" +#define BITSET_FORMAT "016"PRIx64 +#define BITSET_VALUE(v) v + /** * The set of leaf node bitsets in the bitset hiearchy which defines all * the possible instructions. @@ -300,8 +303,8 @@ find_bitset(struct decode_state *state, const struct isa_bitset **bitsets, } if (match && (match->dontcare & val)) { - decode_error(state, "dontcare bits in %s: %016"PRIx64, - match->name, (match->dontcare & val)); + decode_error(state, "dontcare bits in %s: %"BITSET_FORMAT, + match->name, BITSET_VALUE(match->dontcare & val)); } return match; @@ -374,9 +377,9 @@ find_display(struct decode_scope *scope, const struct isa_bitset *bitset) uint64_t val = extract_field(scope, f); if (val != f->val) { decode_error(scope->state, "WARNING: unexpected " - "bits[%u:%u] in %s: %016"PRIx64" vs %016"PRIx64, + "bits[%u:%u] in %s: %"BITSET_FORMAT" vs %"BITSET_FORMAT, f->low, f->high, bitset->name, - val, f->val); + BITSET_VALUE(val), BITSET_VALUE(f->val)); } } } @@ -403,8 +406,8 @@ display_bitset_field(struct decode_scope *scope, const struct isa_field *field, { const struct isa_bitset *b = find_bitset(scope->state, field->bitsets, val); if (!b) { - decode_error(scope->state, "no match: FIELD: '%s.%s': %016"PRIx64, - scope->bitset->name, field->name, val); + decode_error(scope->state, "no match: FIELD: '%s.%s': %"BITSET_FORMAT, + scope->bitset->name, field->name, BITSET_VALUE(val)); return; } @@ -649,7 +652,7 @@ decode(struct decode_state *state, void *bin, int sz) const struct isa_bitset *b = find_bitset(state, __instruction, instr); if (!b) { - fprintf(state->out, "no match: %016"PRIx64"\n", instr); + fprintf(state->out, "no match: %"BITSET_FORMAT"\n", BITSET_VALUE(instr)); errors++; continue; }