Message ID | 20210420193453.1913810-2-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | target/mips: Make check_cp0_enabled() return a boolean | expand |
On 4/20/21 12:34 PM, Philippe Mathieu-Daudé wrote: > We already check for CP0 enabled at the beginning of gen_cp0(), > no need to check it again after. > > Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org> > --- > target/mips/translate.c | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On 4/20/21 12:34 PM, Philippe Mathieu-Daudé wrote: > We already check for CP0 enabled at the beginning of gen_cp0(), > no need to check it again after. > > Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org> > --- > target/mips/translate.c | 2 -- > 1 file changed, 2 deletions(-) Having noticed the default case for the nanomips decode, I do wonder if having the cp0 check happen before the switch in gen_cp0 is actually correct. r~
diff --git a/target/mips/translate.c b/target/mips/translate.c index 5dad75cdf37..9acca6ef045 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -9477,7 +9477,6 @@ static void gen_cp0(CPUMIPSState *env, DisasContext *ctx, uint32_t opc, opn = "mthc0"; break; case OPC_MFTR: - check_cp0_enabled(ctx); if (rd == 0) { /* Treat as NOP. */ return; @@ -9487,7 +9486,6 @@ static void gen_cp0(CPUMIPSState *env, DisasContext *ctx, uint32_t opc, opn = "mftr"; break; case OPC_MTTR: - check_cp0_enabled(ctx); gen_mttr(env, ctx, rd, rt, (ctx->opcode >> 5) & 1, ctx->opcode & 0x7, (ctx->opcode >> 4) & 1); opn = "mttr";
We already check for CP0 enabled at the beginning of gen_cp0(), no need to check it again after. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- target/mips/translate.c | 2 -- 1 file changed, 2 deletions(-)