target/mips: Clean up handling of CP0 register 14

Clean up handling of CP0 register 14.

Backports commit 35e4b54d90b07736d24d736c50f236231cde929f from qemu
This commit is contained in:
Aleksandar Markovic 2019-11-18 23:10:17 -05:00 committed by Lioncash
parent dc1e7c4467
commit 41133450de
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 5 additions and 4 deletions

View file

@ -360,6 +360,7 @@ typedef struct mips_def_t mips_def_t;
#define CP0_REG13__NESTEDEXC 5
/* CP0 Register 14 */
#define CP0_REG14__EPC 0
#define CP0_REG14__NESTEDEPC 2
/* CP0 Register 15 */
#define CP0_REG15__PRID 0
#define CP0_REG15__EBASE 1

View file

@ -7291,7 +7291,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_14:
switch (sel) {
case 0:
case CP0_REG14__EPC:
tcg_gen_ld_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EPC));
tcg_gen_ext32s_tl(tcg_ctx, arg, arg);
register_name = "EPC";
@ -8026,7 +8026,7 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_14:
switch (sel) {
case 0:
case CP0_REG14__EPC:
tcg_gen_st_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EPC));
register_name = "EPC";
break;
@ -8763,7 +8763,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_14:
switch (sel) {
case 0:
case CP0_REG14__EPC:
tcg_gen_ld_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EPC));
register_name = "EPC";
break;
@ -9482,7 +9482,7 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_14:
switch (sel) {
case 0:
case CP0_REG14__EPC:
tcg_gen_st_tl(tcg_ctx, arg, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_EPC));
register_name = "EPC";
break;