On Mon, 24 Aug 2026 at 06:54, <[email protected]> wrote:
>
> From: Richard Henderson <[email protected]>
>
> Generate separate objects for OP() instead of collecting in a table.
> Return pointers to objects directly.
>
> Reviewed-by: Alistair Francis <[email protected]>
> Signed-off-by: Richard Henderson <[email protected]>
> Message-ID: <[email protected]>
> Signed-off-by: Alistair Francis <[email protected]>
Hi; Coverity notes what looks like an error in this commit (CID 1685513):
> case 2:
> - op = rv_op_csrrs;
> + return &op_csrrs;
This change puts in an early return, so the whole following
switch on operand_rs1() is dead code.
> if (operand_rs1(inst) == 0) {
> switch (operand_csr12(inst)) {
> - case 0x001: op = rv_op_frflags; break;
> - case 0x002: op = rv_op_frrm; break;
> - case 0x003: op = rv_op_frcsr; break;
> - case 0xc00: op = rv_op_rdcycle; break;
> - case 0xc01: op = rv_op_rdtime; break;
> - case 0xc02: op = rv_op_rdinstret; break;
> - case 0xc80: op = rv_op_rdcycleh; break;
> - case 0xc81: op = rv_op_rdtimeh; break;
> - case 0xc82: op = rv_op_rdinstreth; break;
> + case 0x001: return &op_frflags;
> + case 0x002: return &op_frrm;
> + case 0x003: return &op_frcsr;
> + case 0xc00: return &op_rdcycle;
> + case 0xc01: return &op_rdtime;
> + case 0xc02: return &op_rdinstret;
> + case 0xc80: return &op_rdcycleh;
> + case 0xc81: return &op_rdtimeh;
> + case 0xc82: return &op_rdinstreth;
> }
> }
> break;
What was the intention here ?
thanks
-- PMM