target/mips: Clean up handling of CP0 register 13

Clean up handling of CP0 register 13.

Backports commit e3c7559d8902fbb9857fb94fc5391f258cc3c4d1 from qemu
This commit is contained in:
Aleksandar Markovic 2019-11-18 23:08:19 -05:00 committed by Lioncash
parent 3f76658fd8
commit dc1e7c4467
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 6 additions and 4 deletions

View File

@ -356,6 +356,8 @@ typedef struct mips_def_t mips_def_t;
#define CP0_REG12__GTOFFSET 7
/* CP0 Register 13 */
#define CP0_REG13__CAUSE 0
#define CP0_REG13__VIEW_RIPL 4
#define CP0_REG13__NESTEDEXC 5
/* CP0 Register 14 */
#define CP0_REG14__EPC 0
/* CP0 Register 15 */

View File

@ -7281,7 +7281,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_13:
switch (sel) {
case 0:
case CP0_REG13__CAUSE:
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_Cause));
register_name = "Cause";
break;
@ -8008,7 +8008,7 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_13:
switch (sel) {
case 0:
case CP0_REG13__CAUSE:
save_cpu_state(ctx, 1);
gen_helper_mtc0_cause(tcg_ctx, tcg_ctx->cpu_env, arg);
/*
@ -8753,7 +8753,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_13:
switch (sel) {
case 0:
case CP0_REG13__CAUSE:
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_Cause));
register_name = "Cause";
break;
@ -9464,7 +9464,7 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
break;
case CP0_REGISTER_13:
switch (sel) {
case 0:
case CP0_REG13__CAUSE:
save_cpu_state(ctx, 1);
gen_helper_mtc0_cause(tcg_ctx, tcg_ctx->cpu_env, arg);
/*