diff --git a/qemu/target/mips/cpu.h b/qemu/target/mips/cpu.h index f09769bb..810fd76e 100644 --- a/qemu/target/mips/cpu.h +++ b/qemu/target/mips/cpu.h @@ -429,6 +429,9 @@ struct TCState { float_status msa_fp_status; + /* Upper 64-bit MMRs (multimedia registers); the lower 64-bit are GPRs */ + uint64_t mmr[32]; + #define NUMBER_OF_MXU_REGISTERS 16 target_ulong mxu_gpr[NUMBER_OF_MXU_REGISTERS - 1]; target_ulong mxu_cr; diff --git a/qemu/target/mips/translate.c b/qemu/target/mips/translate.c index 37ea3c68..8b45a949 100644 --- a/qemu/target/mips/translate.c +++ b/qemu/target/mips/translate.c @@ -30034,6 +30034,16 @@ void mips_tcg_init(struct uc_struct *uc) offsetof(CPUMIPSState, active_fpu.fcr31), "fcr31"); +#if defined(TARGET_MIPS64) + tcg_ctx->cpu_mmr[0] = NULL; + for (i = 1; i < 32; i++) { + tcg_ctx->cpu_mmr[i] = tcg_global_mem_new_i64(tcg_ctx, tcg_ctx->cpu_env, + offsetof(CPUMIPSState, + active_tc.mmr[i]), + regnames[i]); + } +#endif + #if !defined(TARGET_MIPS64) for (i = 0; i < NUMBER_OF_MXU_REGISTERS - 1; i++) { tcg_ctx->mxu_gpr[i] = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index 46eedd37..57f67c9a 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -904,6 +904,9 @@ struct TCGContext { TCGv mxu_gpr[16 - 1]; // NUMBER_OF_MXU_REGISTERS - 1 TCGv mxu_CR; + /* Upper halves of R5900's 128-bit registers: MMRs (multimedia registers) */ + TCGv_i64 cpu_mmr[32]; + /* qemu/target-sparc/translate.c */ /* global register indexes */ TCGv_ptr cpu_regwptr;