diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-10-21 11:33:19 -0300 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-11-03 05:52:49 -0300 |
commit | 09968fc96cee3d32e03b26b916bd6195f959c3d7 (patch) | |
tree | e0c5d459319c6a9528795307e3d6c2c0dc8109fb /target/mips/tcg | |
parent | 74665884a594a12c744eb7405015b2d2e8df4621 (diff) | |
download | qemu-09968fc96cee3d32e03b26b916bd6195f959c3d7.zip qemu-09968fc96cee3d32e03b26b916bd6195f959c3d7.tar.gz qemu-09968fc96cee3d32e03b26b916bd6195f959c3d7.tar.bz2 |
target/mips: Introduce ase_3d_available() helper
Determine if the MIPS-3D ASE is implemented by checking
the state of the 3D bit in the FIR CP1 control register.
Remove the then unused ASE_MIPS3D definition.
Note, this allows using MIPS-3D on the mips64dspr2 model.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241021145832.34920-1-philmd@linaro.org>
Diffstat (limited to 'target/mips/tcg')
-rw-r--r-- | target/mips/tcg/micromips_translate.c.inc | 5 | ||||
-rw-r--r-- | target/mips/tcg/translate.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/micromips_translate.c.inc index 3cbf53b..c479bec 100644 --- a/target/mips/tcg/micromips_translate.c.inc +++ b/target/mips/tcg/micromips_translate.c.inc @@ -2484,7 +2484,10 @@ static void decode_micromips32_opc(CPUMIPSState *env, DisasContext *ctx) mips32_op = OPC_BC1TANY4; do_cp1mips3d: check_cop1x(ctx); - check_insn(ctx, ASE_MIPS3D); + if (!ase_3d_available(env)) { + gen_reserved_instruction(ctx); + break; + } /* Fall through */ do_cp1branch: if (env->CP0_Config1 & (1 << CP0C1_FP)) { diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 2d01f5c..9a3ae10 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -14710,7 +14710,9 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx) } else { /* OPC_BC1ANY2 */ check_cop1x(ctx); - check_insn(ctx, ASE_MIPS3D); + if (!ase_3d_available(env)) { + return false; + } gen_compute_branch1(ctx, MASK_BC1(ctx->opcode), (rt >> 2) & 0x7, imm << 2); } @@ -14725,7 +14727,9 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx) check_cp1_enabled(ctx); check_insn_opc_removed(ctx, ISA_MIPS_R6); check_cop1x(ctx); - check_insn(ctx, ASE_MIPS3D); + if (!ase_3d_available(env)) { + return false; + } /* fall through */ case OPC_BC1: check_cp1_enabled(ctx); |