mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 02:35:29 +00:00
target-i386: Avoid repeated calls to the bnd_jmp helper
Two flags were tested the wrong way. Backports commit 8b33e82b863d1c6fce7e69a41f6c96a8e15b73fb from qemu
This commit is contained in:
parent
f7bff04b7b
commit
bdf1189046
|
@ -2750,12 +2750,12 @@ static void gen_bnd_jmp(DisasContext *s)
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
TCGv_ptr cpu_env = tcg_ctx->cpu_env;
|
TCGv_ptr cpu_env = tcg_ctx->cpu_env;
|
||||||
|
|
||||||
/* Do nothing if BND prefix present, MPX is disabled, or if the
|
/* Clear the registers only if BND prefix is missing, MPX is enabled,
|
||||||
BNDREGs are known to be in INIT state already. The helper
|
and if the BNDREGs are known to be in use (non-zero) already.
|
||||||
itself will check BNDPRESERVE at runtime. */
|
The helper itself will check BNDPRESERVE at runtime. */
|
||||||
if ((s->prefix & PREFIX_REPNZ) == 0
|
if ((s->prefix & PREFIX_REPNZ) == 0
|
||||||
&& (s->flags & HF_MPX_EN_MASK) == 0
|
&& (s->flags & HF_MPX_EN_MASK) != 0
|
||||||
&& (s->flags & HF_MPX_IU_MASK) == 0) {
|
&& (s->flags & HF_MPX_IU_MASK) != 0) {
|
||||||
gen_helper_bnd_jmp(tcg_ctx, cpu_env);
|
gen_helper_bnd_jmp(tcg_ctx, cpu_env);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue