mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 18:25:28 +00:00
target-arm: Handle always condition codes within arm_test_cc
Handling this with TCG_COND_ALWAYS will allow these unlikely cases to be handled without special cases in the rest of the translator. The TCG optimizer ought to be able to reduce these ALWAYS conditions completely. Backports commit 9305eac09e61d857c9cc11e20db754dfc25a82db from qemu
This commit is contained in:
parent
94f1227f7a
commit
70dd48b855
|
@ -802,6 +802,14 @@ void arm_test_cc(TCGContext *tcg_ctx, DisasCompare *cmp, int cc)
|
|||
tcg_gen_andc_i32(tcg_ctx, value, tcg_ctx->cpu_ZF, value);
|
||||
break;
|
||||
|
||||
case 14: /* always */
|
||||
case 15: /* always */
|
||||
/* Use the ALWAYS condition, which will fold early.
|
||||
* It doesn't matter what we use for the value. */
|
||||
cond = TCG_COND_ALWAYS;
|
||||
value = tcg_ctx->cpu_ZF;
|
||||
goto no_invert;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Bad condition code 0x%x\n", cc);
|
||||
abort();
|
||||
|
@ -811,6 +819,7 @@ void arm_test_cc(TCGContext *tcg_ctx, DisasCompare *cmp, int cc)
|
|||
cond = tcg_invert_cond(cond);
|
||||
}
|
||||
|
||||
no_invert:
|
||||
cmp->cond = cond;
|
||||
cmp->value = value;
|
||||
cmp->value_global = global;
|
||||
|
|
Loading…
Reference in a new issue