@samitouri / QOSamiQemu / commits / 2d64d3a6a1

disas/riscv: Pass rv_opcode_data pointer to decode_inst_operands

Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260812223142.349142-5-richard.henderson@linaro.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Richard Henderson committed Aug 12, 2026 at 15:30 UTC 2d64d3a6a1404f2f09c0d43ce715cd4b001f8f26
1 file changed +8 -4
disas/riscv.c
+8 -4
@@ -4595,11 +4595,12 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa)
4595
4596 /* decode operands */
4597
4598 -static void decode_inst_operands(rv_decode *dec, rv_isa isa)
4598 +static void decode_inst_operands(rv_decode *dec, rv_isa isa,
4599 + const rv_opcode_data *op)
4600 {
4600 - const rv_opcode_data *opcode_data = dec->opcode_data;
4601 rv_inst inst = dec->inst;
4602 - dec->codec = opcode_data[dec->op].codec;
4602 +
4603 + dec->codec = op->codec;
4604 switch (dec->codec) {
4605 case rv_codec_none:
4606 dec->rd = dec->rs1 = dec->rs2 = rv_ireg_zero;
@@ -5468,6 +5469,8 @@ static GString *disasm_inst(rv_isa isa, uint64_t pc, rv_inst inst,
5469 { has_xlrbr_p, rv_xlrbr_opcode_data, decode_xlrbr },
5470 };
5471
5472 + const rv_opcode_data *op;
5473 +
5474 for (size_t i = 0; i < ARRAY_SIZE(decoders); i++) {
5475 bool (*guard_func)(const RISCVCPUConfig *) = decoders[i].guard_func;
5476 const rv_opcode_data *opcode_data = decoders[i].opcode_data;
@@ -5486,7 +5489,8 @@ static GString *disasm_inst(rv_isa isa, uint64_t pc, rv_inst inst,
5489 dec.opcode_data = rvi_opcode_data;
5490 }
5491
5489 - decode_inst_operands(&dec, isa);
5492 + op = &dec.opcode_data[dec.op];
5493 + decode_inst_operands(&dec, isa, op);
5494 decode_inst_decompress(&dec, isa);
5495 decode_inst_lift_pseudo(&dec);
5496 return format_inst(24, &dec);