On 24/10/24 16:54, Philippe Mathieu-Daudé wrote:
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.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  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(-)


diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h
index 5d196e69ac4..b613726ea42 100644
--- a/target/mips/tcg/translate.h
+++ b/target/mips/tcg/translate.h
@@ -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.


Reply via email to