mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
target/i386: Split out gen_cmpxchg8b, gen_cmpxchg16b
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
b5deff74d1
commit
6218c177af
1 changed files with 31 additions and 17 deletions
|
@ -2993,6 +2993,34 @@ static void gen_sty_env_A0(DisasContext *s, int offset, bool align)
|
||||||
#include "emit.c.inc"
|
#include "emit.c.inc"
|
||||||
#include "decode-new.c.inc"
|
#include "decode-new.c.inc"
|
||||||
|
|
||||||
|
static void gen_cmpxchg8b(DisasContext *s, CPUX86State *env, int modrm)
|
||||||
|
{
|
||||||
|
gen_lea_modrm(env, s, modrm);
|
||||||
|
|
||||||
|
if ((s->prefix & PREFIX_LOCK) &&
|
||||||
|
(tb_cflags(s->base.tb) & CF_PARALLEL)) {
|
||||||
|
gen_helper_cmpxchg8b(cpu_env, s->A0);
|
||||||
|
} else {
|
||||||
|
gen_helper_cmpxchg8b_unlocked(cpu_env, s->A0);
|
||||||
|
}
|
||||||
|
set_cc_op(s, CC_OP_EFLAGS);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef TARGET_X86_64
|
||||||
|
static void gen_cmpxchg16b(DisasContext *s, CPUX86State *env, int modrm)
|
||||||
|
{
|
||||||
|
gen_lea_modrm(env, s, modrm);
|
||||||
|
|
||||||
|
if ((s->prefix & PREFIX_LOCK) &&
|
||||||
|
(tb_cflags(s->base.tb) & CF_PARALLEL)) {
|
||||||
|
gen_helper_cmpxchg16b(cpu_env, s->A0);
|
||||||
|
} else {
|
||||||
|
gen_helper_cmpxchg16b_unlocked(cpu_env, s->A0);
|
||||||
|
}
|
||||||
|
set_cc_op(s, CC_OP_EFLAGS);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* convert one instruction. s->base.is_jmp is set if the translation must
|
/* convert one instruction. s->base.is_jmp is set if the translation must
|
||||||
be stopped. Return the next pc value */
|
be stopped. Return the next pc value */
|
||||||
static bool disas_insn(DisasContext *s, CPUState *cpu)
|
static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||||
|
@ -3844,28 +3872,14 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||||
if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) {
|
if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) {
|
||||||
goto illegal_op;
|
goto illegal_op;
|
||||||
}
|
}
|
||||||
gen_lea_modrm(env, s, modrm);
|
gen_cmpxchg16b(s, env, modrm);
|
||||||
if ((s->prefix & PREFIX_LOCK) &&
|
|
||||||
(tb_cflags(s->base.tb) & CF_PARALLEL)) {
|
|
||||||
gen_helper_cmpxchg16b(cpu_env, s->A0);
|
|
||||||
} else {
|
|
||||||
gen_helper_cmpxchg16b_unlocked(cpu_env, s->A0);
|
|
||||||
}
|
|
||||||
set_cc_op(s, CC_OP_EFLAGS);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!(s->cpuid_features & CPUID_CX8)) {
|
if (!(s->cpuid_features & CPUID_CX8)) {
|
||||||
goto illegal_op;
|
goto illegal_op;
|
||||||
}
|
}
|
||||||
gen_lea_modrm(env, s, modrm);
|
gen_cmpxchg8b(s, env, modrm);
|
||||||
if ((s->prefix & PREFIX_LOCK) &&
|
|
||||||
(tb_cflags(s->base.tb) & CF_PARALLEL)) {
|
|
||||||
gen_helper_cmpxchg8b(cpu_env, s->A0);
|
|
||||||
} else {
|
|
||||||
gen_helper_cmpxchg8b_unlocked(cpu_env, s->A0);
|
|
||||||
}
|
|
||||||
set_cc_op(s, CC_OP_EFLAGS);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7: /* RDSEED */
|
case 7: /* RDSEED */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue