qemu/target/mips/tcg
Philippe Mathieu-Daudé c8b69a2a92 target/mips: Remove JR opcode unused arguments
JR opcode (Jump Register) only takes 1 argument, $rs.
JALR (Jump And Link Register) takes 3: $rs, $rd and $hint.

Commit 6af0bf9c7c added their processing into decode_opc() as:

    case 0x08 ... 0x09: /* Jumps */
        gen_compute_branch(ctx, op1 | EXT_SPECIAL, rs, rd, sa);

having both opcodes handled in the same function: gen_compute_branch.

Per JR encoding, both $rd and $hint ('sa') are decoded as zero.

Later this code got extracted to decode_opc_special(),
commit 7a387fffce used definitions instead of magic values:

    case OPC_JR ... OPC_JALR:
        gen_compute_branch(ctx, op1, rs, rd, sa);

Finally commit 0aefa33318 moved OPC_JR out of decode_opc_special,
to a new 'decode_opc_special_legacy' function:

  @@ -15851,6 +15851,9 @@ static void decode_opc_special_legacy(CPUMIPSState *env, DisasContext *ctx)
  +    case OPC_JR:
  +        gen_compute_branch(ctx, op1, 4, rs, rd, sa);
  +        break;

  @@ -15933,7 +15936,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
  -    case OPC_JR ... OPC_JALR:
  +    case OPC_JALR:
           gen_compute_branch(ctx, op1, 4, rs, rd, sa);
           break;

Since JR is now handled individually, it is pointless to decode
and pass it unused arguments. Replace them by simple zero value
to avoid confusion with this opcode.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210730225507.2642827-1-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2021-08-25 12:49:09 +02:00
..
sysemu target/mips: Rewrite UHI errno_mips() using switch statement 2021-07-11 22:29:54 +02:00
user
dsp_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
exception.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
fpu_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
ldst_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
lmmi_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
meson.build target/mips: Merge msa32/msa64 decodetree definitions 2021-06-24 16:48:08 +02:00
micromips_translate.c.inc target/mips: Extract the microMIPS ISA translation routines 2021-07-02 10:41:15 +02:00
mips16e_translate.c.inc target/mips: Extract Code Compaction ASE translation routines 2021-07-02 10:41:15 +02:00
mips32r6.decode target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
mips64r6.decode target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
msa_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
msa_helper.h.inc target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
msa_translate.c target/mips: Merge msa32/msa64 decodetree definitions 2021-06-24 16:48:08 +02:00
msa.decode target/mips: Merge msa32/msa64 decodetree definitions 2021-06-24 16:48:08 +02:00
mxu_translate.c target/mips: Fix gen_mxu_s32ldd_s32lddr 2021-06-29 10:04:57 -07:00
nanomips_translate.c.inc target/mips: Extract nanoMIPS ISA translation routines 2021-07-02 10:41:16 +02:00
op_helper.c target/mips: Fold jazz behaviour into mips_cpu_do_transaction_failed 2021-05-26 15:33:59 -07:00
rel6_translate.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
sysemu_helper.h.inc target/mips: Move TLB management helpers to tcg/sysemu/tlb_helper.c 2021-05-02 16:49:35 +02:00
tcg-internal.h target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
trace-events target/mips: Move TCG trace events to tcg/ sub directory 2021-06-24 16:48:07 +02:00
trace.h target/mips: Move TCG trace events to tcg/ sub directory 2021-06-24 16:48:07 +02:00
translate_addr_const.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
translate.c target/mips: Remove JR opcode unused arguments 2021-08-25 12:49:09 +02:00
translate.h target/mips: Add declarations for generic TCG helpers 2021-07-02 10:41:15 +02:00
tx79_translate.c target/mips/tx79: Introduce SQ opcode (Store Quadword) 2021-07-11 22:29:54 +02:00
tx79.decode target/mips/tx79: Introduce SQ opcode (Store Quadword) 2021-07-11 22:29:54 +02:00
txx9_translate.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00