isaspec: Rename isa_decode() to isa_disasm()

This actually disassembles the binary, and we will add a function that
actually decodes it to the same structure that the encoder uses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
This commit is contained in:
Connor Abbott 2023-06-26 17:12:22 +02:00 committed by Marge Bot
parent 26cce0a133
commit 2faf344f03
6 changed files with 9 additions and 9 deletions

View file

@ -121,7 +121,7 @@ struct isa_decode_options {
const struct isa_entrypoint *entrypoints;
};
void isa_decode(void *bin, int sz, FILE *out, const struct isa_decode_options *options);
void isa_disasm(void *bin, int sz, FILE *out, const struct isa_decode_options *options);
#ifdef __cplusplus
}

View file

@ -741,7 +741,7 @@ display(struct decode_scope *scope)
}
static void
decode(struct decode_state *state, void *bin, int sz)
disasm(struct decode_state *state, void *bin, int sz)
{
BITSET_WORD *instrs = bin;
unsigned errors = 0; /* number of consecutive unmatched instructions */
@ -848,7 +848,7 @@ cmp_entrypoints(const void *_a, const void *_b)
}
void
isa_decode(void *bin, int sz, FILE *out, const struct isa_decode_options *options)
isa_disasm(void *bin, int sz, FILE *out, const struct isa_decode_options *options)
{
const struct isa_decode_options default_options = {
.gpu_id = options ? options->gpu_id : 0,
@ -872,7 +872,7 @@ isa_decode(void *bin, int sz, FILE *out, const struct isa_decode_options *option
/* Do a pre-pass to find all the branch targets: */
state->print.out = fopen("/dev/null", "w");
state->options = &default_options; /* skip hooks for prepass */
decode(state, bin, sz);
disasm(state, bin, sz);
fclose(state->print.out);
if (options) {
state->options = options;
@ -896,7 +896,7 @@ isa_decode(void *bin, int sz, FILE *out, const struct isa_decode_options *option
state->print.out = out;
decode(state, bin, sz);
disasm(state, bin, sz);
ralloc_free(state);
}

View file

@ -595,7 +595,7 @@ disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
decode_options.cbdata = &ctx;
isa_decode(dwords, sizedwords * 4, out, &decode_options);
isa_disasm(dwords, sizedwords * 4, out, &decode_options);
disasm_handle_last(&ctx);

View file

@ -836,7 +836,7 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out)
const_state->immediates[i * 4 + 3]);
}
isa_decode(bin, so->info.sizedwords * 4, out,
isa_disasm(bin, so->info.sizedwords * 4, out,
&(struct isa_decode_options){
.gpu_id = ir->compiler->gen * 100,
.show_errors = true,

View file

@ -496,7 +496,7 @@ main(int argc, char **argv)
strtoll(&test->instr[9], NULL, 16),
strtoll(&test->instr[0], NULL, 16),
};
isa_decode(code, 8, fdisasm,
isa_disasm(code, 8, fdisasm,
&(struct isa_decode_options){
.gpu_id = test->gpu_id,
.show_errors = true,

View file

@ -47,7 +47,7 @@ main(int argc, char **argv)
size_t sz;
void *raw = os_read_file(argv[1], &sz);
isa_decode(raw, sz, stdout, &(struct isa_decode_options) {
isa_disasm(raw, sz, stdout, &(struct isa_decode_options) {
.show_errors = true,
.branch_labels = true,
.pre_instr_cb = disasm_instr_cb,