translate: check cflags instead of use_icount global

Backports applicable parts of commit bd79255d2571a3c68820117caf94ea9afe1d527e
This commit is contained in:
Paolo Bonzini 2018-02-16 09:01:53 -05:00 committed by Lioncash
parent cab4c979f0
commit 268275f04b
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -5252,10 +5252,11 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
/* Mark as an IO operation because we read the time. */ /* Mark as an IO operation because we read the time. */
//if (use_icount) //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_start(); // gen_io_start();
//}
gen_helper_mfc0_count(tcg_ctx, arg, tcg_ctx->cpu_env); gen_helper_mfc0_count(tcg_ctx, arg, tcg_ctx->cpu_env);
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_end(); // gen_io_end();
//} //}
/* Break the TB to be able to take timer interrupts immediately /* Break the TB to be able to take timer interrupts immediately
@ -5634,8 +5635,9 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
if (sel != 0) if (sel != 0)
check_insn(ctx, ISA_MIPS32); check_insn(ctx, ISA_MIPS32);
//if (use_icount) //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_start(); // gen_io_start();
//}
switch (reg) { switch (reg) {
case 0: case 0:
@ -6255,7 +6257,7 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
(void)rn; /* avoid a compiler warning */ (void)rn; /* avoid a compiler warning */
LOG_DISAS("mtc0 %s (reg %d sel %d)\n", rn, reg, sel); LOG_DISAS("mtc0 %s (reg %d sel %d)\n", rn, reg, sel);
/* For simplicity assume that all writes can cause interrupts. */ /* For simplicity assume that all writes can cause interrupts. */
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_end(); // gen_io_end();
// ctx->bstate = BS_STOP; // ctx->bstate = BS_STOP;
//} //}
@ -6507,10 +6509,11 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
switch (sel) { switch (sel) {
case 0: case 0:
/* Mark as an IO operation because we read the time. */ /* Mark as an IO operation because we read the time. */
//if (use_icount) //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_start(); // gen_io_start();
//}
gen_helper_mfc0_count(tcg_ctx, arg, tcg_ctx->cpu_env); gen_helper_mfc0_count(tcg_ctx, arg, tcg_ctx->cpu_env);
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_end(); // gen_io_end();
//} //}
/* Break the TB to be able to take timer interrupts immediately /* Break the TB to be able to take timer interrupts immediately
@ -6877,8 +6880,9 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
if (sel != 0) if (sel != 0)
check_insn(ctx, ISA_MIPS64); check_insn(ctx, ISA_MIPS64);
//if (use_icount) //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_start(); // gen_io_start();
//}
switch (reg) { switch (reg) {
case 0: case 0:
@ -7184,11 +7188,11 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
save_cpu_state(ctx, 1); save_cpu_state(ctx, 1);
/* Mark as an IO operation because we may trigger a software /* Mark as an IO operation because we may trigger a software
interrupt. */ interrupt. */
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_start(); // gen_io_start();
//} //}
gen_helper_mtc0_cause(tcg_ctx, tcg_ctx->cpu_env, arg); gen_helper_mtc0_cause(tcg_ctx, tcg_ctx->cpu_env, arg);
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_end(); // gen_io_end();
//} //}
/* Stop translation as we may have triggered an intetrupt */ /* Stop translation as we may have triggered an intetrupt */
@ -7497,7 +7501,7 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
(void)rn; /* avoid a compiler warning */ (void)rn; /* avoid a compiler warning */
LOG_DISAS("dmtc0 %s (reg %d sel %d)\n", rn, reg, sel); LOG_DISAS("dmtc0 %s (reg %d sel %d)\n", rn, reg, sel);
/* For simplicity assume that all writes can cause interrupts. */ /* For simplicity assume that all writes can cause interrupts. */
//if (use_icount) { //if (ctx->tb->cflags & CF_USE_ICOUNT) {
// gen_io_end(); // gen_io_end();
// ctx->bstate = BS_STOP; // ctx->bstate = BS_STOP;
//} //}