Re: [PATCH 12/56] disas/riscv: Pass rv_opcode_data pointer to format_inst

Alistair <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
On Sun, 2026-08-09 at 15:35 -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <[email protected]>

Reviewed-by: Alistair Francis <[email protected]>

Alistair

> ---
>  disas/riscv.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/disas/riscv.c b/disas/riscv.c
> index 0be2f07612..70ea41f125 100644
> --- a/disas/riscv.c
> +++ b/disas/riscv.c
> @@ -5111,17 +5111,16 @@ static size_t inst_length(rv_inst inst)
>  
>  /* format instruction */
>  
> -static GString *format_inst(size_t tab, rv_decode *dec)
> +static GString *format_inst(size_t tab, rv_decode *dec,
> +                            const rv_opcode_data *op)
>  {
> -    const rv_opcode_data *opcode_data = dec->opcode_data;
>      GString *buf = g_string_sized_new(64);
> -    const char *fmt;
> +    const char *fmt = op->format;
>  
> -    fmt = opcode_data[dec->op].format;
>      while (*fmt) {
>          switch (*fmt) {
>          case 'O':
> -            g_string_append(buf, opcode_data[dec->op].name);
> +            g_string_append(buf, op->name);
>              break;
>          case '(':
>          case ',':
> @@ -5466,7 +5465,7 @@ static GString *disasm_inst(rv_isa isa,
> uint64_t pc, rv_inst inst,
>      decode_inst_operands(&dec, isa, op);
>      op = decode_inst_decompress(&dec, isa, op);
>      op = decode_inst_lift_pseudo(&dec, op);
> -    return format_inst(24, &dec);
> +    return format_inst(24, &dec, op);
>  }
>  
>  #define INST_FMT_2 "%04x              "
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.