mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 14:51:04 +00:00
target/mips: Clean up handling of CP0 register 28
Clean up handling of CP0 register 28. Backports commit a30e2f218034f6215757734c8107fd47f5385dfa from qemu
This commit is contained in:
parent
9ed9ff06ab
commit
7dc128c3ad
|
@ -232,12 +232,12 @@ typedef struct mips_def_t mips_def_t;
|
||||||
*
|
*
|
||||||
* 0 DataLo DataHi ErrorEPC DESAVE
|
* 0 DataLo DataHi ErrorEPC DESAVE
|
||||||
* 1 TagLo TagHi
|
* 1 TagLo TagHi
|
||||||
* 2 DataLo DataHi KScratch<n>
|
* 2 DataLo1 DataHi KScratch<n>
|
||||||
* 3 TagLo TagHi KScratch<n>
|
* 3 TagLo1 TagHi KScratch<n>
|
||||||
* 4 DataLo DataHi KScratch<n>
|
* 4 DataLo2 DataHi KScratch<n>
|
||||||
* 5 TagLo TagHi KScratch<n>
|
* 5 TagLo2 TagHi KScratch<n>
|
||||||
* 6 DataLo DataHi KScratch<n>
|
* 6 DataLo3 DataHi KScratch<n>
|
||||||
* 7 TagLo TagHi KScratch<n>
|
* 7 TagLo3 TagHi KScratch<n>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define CP0_REGISTER_00 0
|
#define CP0_REGISTER_00 0
|
||||||
|
@ -426,10 +426,14 @@ typedef struct mips_def_t mips_def_t;
|
||||||
/* CP0 Register 27 */
|
/* CP0 Register 27 */
|
||||||
#define CP0_REG27__CACHERR 0
|
#define CP0_REG27__CACHERR 0
|
||||||
/* CP0 Register 28 */
|
/* CP0 Register 28 */
|
||||||
#define CP0_REG28__ITAGLO 0
|
#define CP0_REG28__TAGLO 0
|
||||||
#define CP0_REG28__IDATALO 1
|
#define CP0_REG28__DATALO 1
|
||||||
#define CP0_REG28__DTAGLO 2
|
#define CP0_REG28__TAGLO1 2
|
||||||
#define CP0_REG28__DDATALO 3
|
#define CP0_REG28__DATALO1 3
|
||||||
|
#define CP0_REG28__TAGLO2 4
|
||||||
|
#define CP0_REG28__DATALO2 5
|
||||||
|
#define CP0_REG28__TAGLO3 6
|
||||||
|
#define CP0_REG28__DATALO3 7
|
||||||
/* CP0 Register 29 */
|
/* CP0 Register 29 */
|
||||||
#define CP0_REG29__IDATAHI 1
|
#define CP0_REG29__IDATAHI 1
|
||||||
#define CP0_REG29__DDATAHI 3
|
#define CP0_REG29__DDATAHI 3
|
||||||
|
|
|
@ -6765,10 +6765,10 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
gen_mfhc0_load64(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo), 0);
|
gen_mfhc0_load64(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo), 0);
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
break;
|
break;
|
||||||
|
@ -6853,10 +6853,10 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
tcg_gen_andi_tl(s, arg, arg, mask);
|
tcg_gen_andi_tl(s, arg, arg, mask);
|
||||||
gen_mthc0_store64(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo));
|
gen_mthc0_store64(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo));
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
|
@ -7555,10 +7555,10 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
{
|
{
|
||||||
TCGv_i64 tmp = tcg_temp_new_i64(tcg_ctx);
|
TCGv_i64 tmp = tcg_temp_new_i64(tcg_ctx);
|
||||||
tcg_gen_ld_i64(tcg_ctx, tmp, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_TagLo));
|
tcg_gen_ld_i64(tcg_ctx, tmp, tcg_ctx->cpu_env, offsetof(CPUMIPSState, CP0_TagLo));
|
||||||
|
@ -7567,10 +7567,10 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
}
|
}
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case CP0_REG28__DATALO:
|
||||||
case 3:
|
case CP0_REG28__DATALO1:
|
||||||
case 5:
|
case CP0_REG28__DATALO2:
|
||||||
case 7:
|
case CP0_REG28__DATALO3:
|
||||||
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_DataLo));
|
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_DataLo));
|
||||||
register_name = "DataLo";
|
register_name = "DataLo";
|
||||||
break;
|
break;
|
||||||
|
@ -8311,17 +8311,17 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
gen_helper_mtc0_taglo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
gen_helper_mtc0_taglo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case CP0_REG28__DATALO:
|
||||||
case 3:
|
case CP0_REG28__DATALO1:
|
||||||
case 5:
|
case CP0_REG28__DATALO2:
|
||||||
case 7:
|
case CP0_REG28__DATALO3:
|
||||||
gen_helper_mtc0_datalo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
gen_helper_mtc0_datalo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
||||||
register_name = "DataLo";
|
register_name = "DataLo";
|
||||||
break;
|
break;
|
||||||
|
@ -9035,17 +9035,17 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo));
|
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_TagLo));
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case CP0_REG28__DATALO:
|
||||||
case 3:
|
case CP0_REG28__DATALO1:
|
||||||
case 5:
|
case CP0_REG28__DATALO2:
|
||||||
case 7:
|
case CP0_REG28__DATALO3:
|
||||||
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_DataLo));
|
gen_mfc0_load32(ctx, arg, offsetof(CPUMIPSState, CP0_DataLo));
|
||||||
register_name = "DataLo";
|
register_name = "DataLo";
|
||||||
break;
|
break;
|
||||||
|
@ -9768,17 +9768,17 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
|
||||||
break;
|
break;
|
||||||
case CP0_REGISTER_28:
|
case CP0_REGISTER_28:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case CP0_REG28__TAGLO:
|
||||||
case 2:
|
case CP0_REG28__TAGLO1:
|
||||||
case 4:
|
case CP0_REG28__TAGLO2:
|
||||||
case 6:
|
case CP0_REG28__TAGLO3:
|
||||||
gen_helper_mtc0_taglo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
gen_helper_mtc0_taglo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
||||||
register_name = "TagLo";
|
register_name = "TagLo";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case CP0_REG28__DATALO:
|
||||||
case 3:
|
case CP0_REG28__DATALO1:
|
||||||
case 5:
|
case CP0_REG28__DATALO2:
|
||||||
case 7:
|
case CP0_REG28__DATALO3:
|
||||||
gen_helper_mtc0_datalo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
gen_helper_mtc0_datalo(tcg_ctx, tcg_ctx->cpu_env, arg);
|
||||||
register_name = "DataLo";
|
register_name = "DataLo";
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue