target/mips: Introduce disas_mt_available()
PATCH 1/1 target/mips: Introduce disas_mt_available()
Similarly to commit 17c2c320f3c ("Introduce ase_mt_available helper"), introduce the disas_mt_available() one which takes a DisasContext argument to determine whether Multi-Threading is available by checking the MT bit of the CP0_Config3 register.
Remove the then unused ASE_MT definition.
--- target/mips/mips-defs.h | 1 - target/mips/tcg/translate.h | 5 ++ target/mips/tcg/translate.c | 136 ++++++++++++++++++------------------ target/mips/cpu-defs.c.inc | 4 +- 4 files changed, 75 insertions(+), 71 deletions(-)
target/mips/mips-defs.h +0 -1
@@ -30,7 +30,6 @@#define ASE_DSP 0x0000000008000000ULL#define ASE_DSP_R2 0x0000000010000000ULL#define ASE_DSP_R3 0x0000000020000000ULL -#define ASE_MT 0x0000000040000000ULL#define ASE_SMARTMIPS 0x0000000080000000ULL#define ASE_MICROMIPS 0x0000000100000000ULL/*
target/mips/tcg/translate.h +5 -0
@@ -228,6 +228,11 @@ bool decode_ext_octeon(DisasContext *ctx, uint32_t insn);#endif bool decode_ext_vr54xx (DisasContext *ctx,uint32_t insn); +static inline bool disas_mt_available (DisasContext *ctx) +{ +return ctx->CP0_Config3 & (1 <<CP0C3_MT ); +} +/* * Helpers for implementing sets of trans_* functions. * Defer the implementation of NAME to FUNC, with optional extra arguments.
target/mips/tcg/translate.c +68 -68
439 lines not on this page · raw message
target/mips/cpu-defs.c.inc +2 -2
@@ -314,7 +314,7 @@ const mips_def_t mips_defs[] = (0x3fe << CP0SRSC4_SRS14) | (0x3fe << CP0SRSC4_SRS13), .SEGBITS = 32, .PABITS = 32, - .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_MT, + .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP, .mmu_type = MMU_TYPE_R4000, }, {
@@ -543,7 +543,7 @@ const mips_def_t mips_defs[] = .SEGBITS = 32, .PABITS = 32, .insn_flags = CPU_MIPS32R6 | ISA_NANOMIPS32 | - ASE_DSP | ASE_DSP_R2 | ASE_DSP_R3 | ASE_MT, + ASE_DSP | ASE_DSP_R2 | ASE_DSP_R3, .mmu_type = MMU_TYPE_R4000, }, #if defined(TARGET_MIPS64)
Signature · 1 line
2.45.2
Quoted 21 lines · Philippe Mathieu-Daudé
Similarly to commit
17c2c320f3c("Introducease_mt_availablehelper"), introduce thedisas_mt_available()one which takes a DisasContext argument to determine whether Multi-Threading is available by checking the MT bit of theCP0_Config3register.Remove the then unused
ASE_MTdefinition.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/mips/mips-defs.h | 1 - target/mips/tcg/translate.h | 5 ++ target/mips/tcg/translate.c | 136 ++++++++++++++++++------------------ target/mips/cpu-defs.c.inc | 4 +- 4 files changed, 75 insertions(+), 71 deletions(-)target/mips/tcg/translate.h +0
-0
target/mips/tcg/translate.h bool decode_ext_octeon(DisasContext *ctx, uint32_t insn); · line 234
Quoted 7 lines
target/mips/tcg/translate.h +4
-0@@ -228,6 +228,11 @@ bool decode_ext_octeon(DisasContext *ctx, uint32_t insn);#endif bool decode_ext_vr54xx (DisasContext *ctx,uint32_t insn); +static inline bool disas_mt_available (DisasContext *ctx) +{ +return ctx->CP0_Config3 & (1 <<CP0C3_MT ); +}
BTW I considered inlining it in translate.c but the MT code will eventually be converted to decodetree so better keep this helper in the translate.h header.
Quoted 7 lines · Philippe Mathieu-Daudé
Similarly to commit
17c2c320f3c("Introducease_mt_availablehelper"), introduce thedisas_mt_available()one which takes a DisasContext argument to determine whether Multi-Threading is available by checking the MT bit of theCP0_Config3register.Remove the then unused
ASE_MTdefinition.
Quoted 7 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/mips/mips-defs.h | 1 - target/mips/tcg/translate.h | 5 ++ target/mips/tcg/translate.c | 136 ++++++++++++++++++------------------ target/mips/cpu-defs.c.inc | 4 +- 4 files changed, 75
r~