target/mips: Clean up handling of CP0 register 10

Clean up handling of CP0 register 10.

Backports commit 860ffef0477a92f1944f10528887fa5e74e6535d from qemu
This commit is contained in:
Aleksandar Markovic 2019-11-18 23:03:23 -05:00 committed by Lioncash
parent 11d02fc0b7
commit 16e817b003
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 5 additions and 4 deletions

View File

@ -341,6 +341,7 @@ typedef struct mips_def_t mips_def_t;
#define CP0_REG10__ENTRYHI 0
#define CP0_REG10__GUESTCTL1 4
#define CP0_REG10__GUESTCTL2 5
#define CP0_REG10__GUESTCTL3 6
/* CP0 Register 11 */
#define CP0_REG11__COMPARE 0
#define CP0_REG11__GUESTCTL0EXT 4

View File

@ -7234,7 +7234,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_10:
switch (sel) {
case 0:
case CP0_REG10__ENTRYHI:
tcg_gen_ld_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EntryHi));
tcg_gen_ext32s_tl(tcg_ctx, arg, arg);
register_name = "EntryHi";
@ -7952,7 +7952,7 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_10:
switch (sel) {
case 0:
case CP0_REG10__ENTRYHI:
gen_helper_mtc0_entryhi(tcg_ctx, tcg_ctx->cpu_env, arg);
register_name = "EntryHi";
break;
@ -8707,7 +8707,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_10:
switch (sel) {
case 0:
case CP0_REG10__ENTRYHI:
tcg_gen_ld_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EntryHi));
register_name = "EntryHi";
break;
@ -9406,7 +9406,7 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_10:
switch (sel) {
case 0:
case CP0_REG10__ENTRYHI:
gen_helper_mtc0_entryhi(tcg_ctx, tcg_ctx->cpu_env, arg);
register_name = "EntryHi";
break;