Commit da80682b authored by aurel32's avatar aurel32

target-mips: avoid tcg internal error in mfc0/dmfc0

Set t0 to 0 for unimplemented mfc0/dmfc0 instructions. This fixes a tcg
internal error while booting mips linux.

Noticed by Julia Longtin.
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5723 c046a42c-6fe2-441c-8c8c-71466251a162
parent 64b4d28c
......@@ -3186,7 +3186,7 @@ static void gen_mfc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int se
}
break;
case 22:
/* ignored */
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "'Diagnostic"; /* implementation dependent */
break;
case 23:
......@@ -3266,12 +3266,13 @@ static void gen_mfc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int se
}
break;
case 26:
rn = "ECC";
break;
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "ECC";
break;
case 27:
switch (sel) {
/* ignored */
case 0 ... 3:
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "CacheErr";
break;
default:
......@@ -4372,7 +4373,7 @@ static void gen_dmfc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int s
}
break;
case 22:
/* ignored */
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "'Diagnostic"; /* implementation dependent */
break;
case 23:
......@@ -4451,12 +4452,14 @@ static void gen_dmfc0 (CPUState *env, DisasContext *ctx, TCGv t0, int reg, int s
}
break;
case 26:
rn = "ECC";
break;
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "ECC";
break;
case 27:
switch (sel) {
/* ignored */
case 0 ... 3:
tcg_gen_movi_tl(t0, 0); /* unimplemented */
rn = "CacheErr";
break;
default:
......@@ -8013,7 +8016,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
case OPC_EMT:
check_insn(env, ctx, ASE_MT);
tcg_gen_helper_1_1(do_emt, t0, t0);
break;
break;
case OPC_DVPE:
check_insn(env, ctx, ASE_MT);
tcg_gen_helper_1_1(do_dvpe, t0, t0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment