mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
converted more helpers to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4447 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
+1
-81
@@ -95,10 +95,6 @@ extern int loglevel;
|
||||
#define ST(n) (env->fpregs[(env->fpstt + (n)) & 7].d)
|
||||
#define ST1 ST(1)
|
||||
|
||||
#ifdef USE_FP_CONVERT
|
||||
#define FP_CONVERT (env->fp_convert)
|
||||
#endif
|
||||
|
||||
#include "cpu.h"
|
||||
#include "exec-all.h"
|
||||
|
||||
@@ -109,15 +105,13 @@ typedef struct CCTable {
|
||||
|
||||
extern CCTable cc_table[];
|
||||
|
||||
void load_seg(int seg_reg, int selector);
|
||||
void helper_load_seg(int seg_reg, int selector);
|
||||
void helper_ljmp_protected_T0_T1(int next_eip);
|
||||
void helper_lcall_real_T0_T1(int shift, int next_eip);
|
||||
void helper_lcall_protected_T0_T1(int shift, int next_eip);
|
||||
void helper_iret_real(int shift);
|
||||
void helper_iret_protected(int shift, int next_eip);
|
||||
void helper_lret_protected(int shift, int addend);
|
||||
void helper_lldt_T0(void);
|
||||
void helper_ltr_T0(void);
|
||||
void helper_movl_crN_T0(int reg);
|
||||
void helper_movl_drN_T0(int reg);
|
||||
void helper_invlpg(target_ulong addr);
|
||||
@@ -150,27 +144,7 @@ void OPPROTO op_movl_T0_eflags(void);
|
||||
void helper_mulq_EAX_T0(void);
|
||||
void helper_imulq_EAX_T0(void);
|
||||
void helper_imulq_T0_T1(void);
|
||||
void helper_divq_EAX_T0(void);
|
||||
void helper_idivq_EAX_T0(void);
|
||||
void helper_bswapq_T0(void);
|
||||
void helper_cmpxchg8b(void);
|
||||
void helper_single_step(void);
|
||||
void helper_cpuid(void);
|
||||
void helper_enter_level(int level, int data32);
|
||||
void helper_enter64_level(int level, int data64);
|
||||
void helper_sysenter(void);
|
||||
void helper_sysexit(void);
|
||||
void helper_syscall(int next_eip_addend);
|
||||
void helper_sysret(int dflag);
|
||||
void helper_rdtsc(void);
|
||||
void helper_rdpmc(void);
|
||||
void helper_rdmsr(void);
|
||||
void helper_wrmsr(void);
|
||||
void helper_lsl(void);
|
||||
void helper_lar(void);
|
||||
void helper_verr(void);
|
||||
void helper_verw(void);
|
||||
void helper_rsm(void);
|
||||
|
||||
void check_iob_T0(void);
|
||||
void check_iow_T0(void);
|
||||
@@ -183,46 +157,6 @@ void check_iol_DX(void);
|
||||
|
||||
#include "softmmu_exec.h"
|
||||
|
||||
static inline double ldfq(target_ulong ptr)
|
||||
{
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
u.i = ldq(ptr);
|
||||
return u.d;
|
||||
}
|
||||
|
||||
static inline void stfq(target_ulong ptr, double v)
|
||||
{
|
||||
union {
|
||||
double d;
|
||||
uint64_t i;
|
||||
} u;
|
||||
u.d = v;
|
||||
stq(ptr, u.i);
|
||||
}
|
||||
|
||||
static inline float ldfl(target_ulong ptr)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} u;
|
||||
u.i = ldl(ptr);
|
||||
return u.f;
|
||||
}
|
||||
|
||||
static inline void stfl(target_ulong ptr, float v)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} u;
|
||||
u.f = v;
|
||||
stl(ptr, u.i);
|
||||
}
|
||||
|
||||
#endif /* !defined(CONFIG_USER_ONLY) */
|
||||
|
||||
#ifdef USE_X86LDOUBLE
|
||||
@@ -429,20 +363,6 @@ extern const CPU86_LDouble f15rk[7];
|
||||
void fpu_raise_exception(void);
|
||||
void restore_native_fp_state(CPUState *env);
|
||||
void save_native_fp_state(CPUState *env);
|
||||
float approx_rsqrt(float a);
|
||||
float approx_rcp(float a);
|
||||
void update_fp_status(void);
|
||||
void helper_hlt(void);
|
||||
void helper_monitor(void);
|
||||
void helper_mwait(void);
|
||||
void helper_vmrun(target_ulong addr);
|
||||
void helper_vmmcall(void);
|
||||
void helper_vmload(target_ulong addr);
|
||||
void helper_vmsave(target_ulong addr);
|
||||
void helper_stgi(void);
|
||||
void helper_clgi(void);
|
||||
void helper_skinit(void);
|
||||
void helper_invlpga(void);
|
||||
void vmexit(uint64_t exit_code, uint64_t exit_info_1);
|
||||
|
||||
extern const uint8_t parity_table[256];
|
||||
|
||||
+355
-79
File diff suppressed because it is too large
Load Diff
+73
-2
@@ -1,7 +1,78 @@
|
||||
#define TCG_HELPER_PROTO
|
||||
|
||||
void TCG_HELPER_PROTO helper_divl_EAX_T0(target_ulong t0);
|
||||
void TCG_HELPER_PROTO helper_idivl_EAX_T0(target_ulong t0);
|
||||
void helper_divb_AL(target_ulong t0);
|
||||
void helper_idivb_AL(target_ulong t0);
|
||||
void helper_divw_AX(target_ulong t0);
|
||||
void helper_idivw_AX(target_ulong t0);
|
||||
void helper_divl_EAX(target_ulong t0);
|
||||
void helper_idivl_EAX(target_ulong t0);
|
||||
#ifdef TARGET_X86_64
|
||||
void helper_divq_EAX(target_ulong t0);
|
||||
void helper_idivq_EAX(target_ulong t0);
|
||||
#endif
|
||||
|
||||
void helper_aam(int base);
|
||||
void helper_aad(int base);
|
||||
void helper_aaa(void);
|
||||
void helper_aas(void);
|
||||
void helper_daa(void);
|
||||
void helper_das(void);
|
||||
|
||||
void helper_lsl(uint32_t selector);
|
||||
void helper_lar(uint32_t selector);
|
||||
void helper_verr(uint32_t selector);
|
||||
void helper_verw(uint32_t selector);
|
||||
void helper_lldt(int selector);
|
||||
void helper_ltr(int selector);
|
||||
void helper_load_seg(int seg_reg, int selector);
|
||||
void helper_ljmp_protected_T0_T1(int next_eip);
|
||||
void helper_lcall_real_T0_T1(int shift, int next_eip);
|
||||
void helper_lcall_protected_T0_T1(int shift, int next_eip);
|
||||
void helper_iret_real(int shift);
|
||||
void helper_iret_protected(int shift, int next_eip);
|
||||
void helper_lret_protected(int shift, int addend);
|
||||
void helper_movl_crN_T0(int reg);
|
||||
void helper_movl_drN_T0(int reg);
|
||||
void helper_invlpg(target_ulong addr);
|
||||
|
||||
void helper_enter_level(int level, int data32);
|
||||
#ifdef TARGET_X86_64
|
||||
void helper_enter64_level(int level, int data64);
|
||||
#endif
|
||||
void helper_sysenter(void);
|
||||
void helper_sysexit(void);
|
||||
#ifdef TARGET_X86_64
|
||||
void helper_syscall(int next_eip_addend);
|
||||
void helper_sysret(int dflag);
|
||||
#endif
|
||||
void helper_hlt(void);
|
||||
void helper_monitor(target_ulong ptr);
|
||||
void helper_mwait(void);
|
||||
void helper_debug(void);
|
||||
void helper_raise_interrupt(int intno, int next_eip_addend);
|
||||
void helper_raise_exception(int exception_index);
|
||||
void helper_cli(void);
|
||||
void helper_sti(void);
|
||||
void helper_set_inhibit_irq(void);
|
||||
void helper_reset_inhibit_irq(void);
|
||||
void helper_boundw(void);
|
||||
void helper_boundl(void);
|
||||
void helper_rsm(void);
|
||||
void helper_single_step(void);
|
||||
void helper_cpuid(void);
|
||||
void helper_rdtsc(void);
|
||||
void helper_rdpmc(void);
|
||||
void helper_rdmsr(void);
|
||||
void helper_wrmsr(void);
|
||||
|
||||
void helper_vmrun(void);
|
||||
void helper_vmmcall(void);
|
||||
void helper_vmload(void);
|
||||
void helper_vmsave(void);
|
||||
void helper_stgi(void);
|
||||
void helper_clgi(void);
|
||||
void helper_skinit(void);
|
||||
void helper_invlpga(void);
|
||||
|
||||
/* x86 FPU */
|
||||
|
||||
|
||||
+11
-431
File diff suppressed because it is too large
Load Diff
+62
-58
@@ -2275,7 +2275,10 @@ static void gen_enter(DisasContext *s, int esp_addend, int level)
|
||||
gen_op_mov_TN_reg(OT_LONG, 0, R_EBP);
|
||||
gen_op_st_T0_A0(ot + s->mem_index);
|
||||
if (level) {
|
||||
gen_op_enter64_level(level, (ot == OT_QUAD));
|
||||
/* XXX: must save state */
|
||||
tcg_gen_helper_0_2(helper_enter64_level,
|
||||
tcg_const_i32(level),
|
||||
tcg_const_i32((ot == OT_QUAD)));
|
||||
}
|
||||
gen_op_mov_reg_T1(ot, R_EBP);
|
||||
gen_op_addl_T1_im( -esp_addend + (-opsize * level) );
|
||||
@@ -2297,7 +2300,10 @@ static void gen_enter(DisasContext *s, int esp_addend, int level)
|
||||
gen_op_mov_TN_reg(OT_LONG, 0, R_EBP);
|
||||
gen_op_st_T0_A0(ot + s->mem_index);
|
||||
if (level) {
|
||||
gen_op_enter_level(level, s->dflag);
|
||||
/* XXX: must save state */
|
||||
tcg_gen_helper_0_2(helper_enter_level,
|
||||
tcg_const_i32(level),
|
||||
tcg_const_i32(s->dflag));
|
||||
}
|
||||
gen_op_mov_reg_T1(ot, R_EBP);
|
||||
gen_op_addl_T1_im( -esp_addend + (-opsize * level) );
|
||||
@@ -2310,7 +2316,7 @@ static void gen_exception(DisasContext *s, int trapno, target_ulong cur_eip)
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
gen_jmp_im(cur_eip);
|
||||
gen_op_raise_exception(trapno);
|
||||
tcg_gen_helper_0_1(helper_raise_exception, tcg_const_i32(trapno));
|
||||
s->is_jmp = 3;
|
||||
}
|
||||
|
||||
@@ -2322,7 +2328,9 @@ static void gen_interrupt(DisasContext *s, int intno,
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
gen_jmp_im(cur_eip);
|
||||
gen_op_raise_interrupt(intno, (int)(next_eip - cur_eip));
|
||||
tcg_gen_helper_0_2(helper_raise_interrupt,
|
||||
tcg_const_i32(intno),
|
||||
tcg_const_i32(next_eip - cur_eip));
|
||||
s->is_jmp = 3;
|
||||
}
|
||||
|
||||
@@ -2331,7 +2339,7 @@ static void gen_debug(DisasContext *s, target_ulong cur_eip)
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
gen_jmp_im(cur_eip);
|
||||
gen_op_debug();
|
||||
tcg_gen_helper_0_0(helper_debug);
|
||||
s->is_jmp = 3;
|
||||
}
|
||||
|
||||
@@ -2342,12 +2350,12 @@ static void gen_eob(DisasContext *s)
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
if (s->tb->flags & HF_INHIBIT_IRQ_MASK) {
|
||||
gen_op_reset_inhibit_irq();
|
||||
tcg_gen_helper_0_0(helper_reset_inhibit_irq);
|
||||
}
|
||||
if (s->singlestep_enabled) {
|
||||
gen_op_debug();
|
||||
tcg_gen_helper_0_0(helper_debug);
|
||||
} else if (s->tf) {
|
||||
gen_op_single_step();
|
||||
tcg_gen_helper_0_0(helper_single_step);
|
||||
} else {
|
||||
tcg_gen_exit_tb(0);
|
||||
}
|
||||
@@ -3659,26 +3667,21 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
switch(ot) {
|
||||
case OT_BYTE:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_divb_AL_T0();
|
||||
tcg_gen_helper_0_1(helper_divb_AL, cpu_T[0]);
|
||||
break;
|
||||
case OT_WORD:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_divw_AX_T0();
|
||||
tcg_gen_helper_0_1(helper_divw_AX, cpu_T[0]);
|
||||
break;
|
||||
default:
|
||||
case OT_LONG:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
#ifdef MACRO_TEST
|
||||
/* XXX: this is just a test */
|
||||
tcg_gen_macro_2(cpu_T[0], cpu_T[0], MACRO_TEST);
|
||||
#else
|
||||
tcg_gen_helper_0_1(helper_divl_EAX_T0, cpu_T[0]);
|
||||
#endif
|
||||
tcg_gen_helper_0_1(helper_divl_EAX, cpu_T[0]);
|
||||
break;
|
||||
#ifdef TARGET_X86_64
|
||||
case OT_QUAD:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_divq_EAX_T0();
|
||||
tcg_gen_helper_0_1(helper_divq_EAX, cpu_T[0]);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -3687,21 +3690,21 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
switch(ot) {
|
||||
case OT_BYTE:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_idivb_AL_T0();
|
||||
tcg_gen_helper_0_1(helper_idivb_AL, cpu_T[0]);
|
||||
break;
|
||||
case OT_WORD:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_idivw_AX_T0();
|
||||
tcg_gen_helper_0_1(helper_idivw_AX, cpu_T[0]);
|
||||
break;
|
||||
default:
|
||||
case OT_LONG:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
tcg_gen_helper_0_1(helper_idivl_EAX_T0, cpu_T[0]);
|
||||
tcg_gen_helper_0_1(helper_idivl_EAX, cpu_T[0]);
|
||||
break;
|
||||
#ifdef TARGET_X86_64
|
||||
case OT_QUAD:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_idivq_EAX_T0();
|
||||
tcg_gen_helper_0_1(helper_idivq_EAX, cpu_T[0]);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -4088,7 +4091,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
/* If several instructions disable interrupts, only the
|
||||
_first_ does it */
|
||||
if (!(s->tb->flags & HF_INHIBIT_IRQ_MASK))
|
||||
gen_op_set_inhibit_irq();
|
||||
tcg_gen_helper_0_0(helper_set_inhibit_irq);
|
||||
s->tf = 0;
|
||||
}
|
||||
if (s->is_jmp) {
|
||||
@@ -4164,7 +4167,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
/* If several instructions disable interrupts, only the
|
||||
_first_ does it */
|
||||
if (!(s->tb->flags & HF_INHIBIT_IRQ_MASK))
|
||||
gen_op_set_inhibit_irq();
|
||||
tcg_gen_helper_0_0(helper_set_inhibit_irq);
|
||||
s->tf = 0;
|
||||
}
|
||||
if (s->is_jmp) {
|
||||
@@ -5471,10 +5474,12 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_EFLAGS;
|
||||
break;
|
||||
case 0xfc: /* cld */
|
||||
gen_op_cld();
|
||||
tcg_gen_movi_i32(cpu_tmp2, 1);
|
||||
tcg_gen_st_i32(cpu_tmp2, cpu_env, offsetof(CPUState, df));
|
||||
break;
|
||||
case 0xfd: /* std */
|
||||
gen_op_std();
|
||||
tcg_gen_movi_i32(cpu_tmp2, -1);
|
||||
tcg_gen_st_i32(cpu_tmp2, cpu_env, offsetof(CPUState, df));
|
||||
break;
|
||||
|
||||
/************************/
|
||||
@@ -5670,13 +5675,13 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
case 0xfa: /* cli */
|
||||
if (!s->vm86) {
|
||||
if (s->cpl <= s->iopl) {
|
||||
gen_op_cli();
|
||||
tcg_gen_helper_0_0(helper_cli);
|
||||
} else {
|
||||
gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base);
|
||||
}
|
||||
} else {
|
||||
if (s->iopl == 3) {
|
||||
gen_op_cli();
|
||||
tcg_gen_helper_0_0(helper_cli);
|
||||
} else {
|
||||
gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base);
|
||||
}
|
||||
@@ -5686,12 +5691,12 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (!s->vm86) {
|
||||
if (s->cpl <= s->iopl) {
|
||||
gen_sti:
|
||||
gen_op_sti();
|
||||
tcg_gen_helper_0_0(helper_sti);
|
||||
/* interruptions are enabled only the first insn after sti */
|
||||
/* If several instructions disable interrupts, only the
|
||||
_first_ does it */
|
||||
if (!(s->tb->flags & HF_INHIBIT_IRQ_MASK))
|
||||
gen_op_set_inhibit_irq();
|
||||
tcg_gen_helper_0_0(helper_set_inhibit_irq);
|
||||
/* give a chance to handle pending irqs */
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_eob(s);
|
||||
@@ -5719,9 +5724,9 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
gen_lea_modrm(s, modrm, ®_addr, &offset_addr);
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
if (ot == OT_WORD)
|
||||
gen_op_boundw();
|
||||
tcg_gen_helper_0_0(helper_boundw);
|
||||
else
|
||||
gen_op_boundl();
|
||||
tcg_gen_helper_0_0(helper_boundl);
|
||||
break;
|
||||
case 0x1c8 ... 0x1cf: /* bswap reg */
|
||||
reg = (b & 7) | REX_B(s);
|
||||
@@ -5800,10 +5805,10 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
int retval = 0;
|
||||
if (b & 2) {
|
||||
retval = gen_svm_check_intercept_param(s, pc_start, SVM_EXIT_MSR, 0);
|
||||
gen_op_rdmsr();
|
||||
tcg_gen_helper_0_0(helper_rdmsr);
|
||||
} else {
|
||||
retval = gen_svm_check_intercept_param(s, pc_start, SVM_EXIT_MSR, 1);
|
||||
gen_op_wrmsr();
|
||||
tcg_gen_helper_0_0(helper_wrmsr);
|
||||
}
|
||||
if(retval)
|
||||
gen_eob(s);
|
||||
@@ -5813,11 +5818,11 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_RDTSC))
|
||||
break;
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_rdtsc();
|
||||
tcg_gen_helper_0_0(helper_rdtsc);
|
||||
break;
|
||||
case 0x133: /* rdpmc */
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_rdpmc();
|
||||
tcg_gen_helper_0_0(helper_rdpmc);
|
||||
break;
|
||||
case 0x134: /* sysenter */
|
||||
if (CODE64(s))
|
||||
@@ -5830,7 +5835,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_DYNAMIC;
|
||||
}
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_sysenter();
|
||||
tcg_gen_helper_0_0(helper_sysenter);
|
||||
gen_eob(s);
|
||||
}
|
||||
break;
|
||||
@@ -5845,7 +5850,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_DYNAMIC;
|
||||
}
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_sysexit();
|
||||
tcg_gen_helper_0_0(helper_sysexit);
|
||||
gen_eob(s);
|
||||
}
|
||||
break;
|
||||
@@ -5857,7 +5862,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_DYNAMIC;
|
||||
}
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_syscall(s->pc - pc_start);
|
||||
tcg_gen_helper_0_1(helper_syscall, tcg_const_i32(s->pc - pc_start));
|
||||
gen_eob(s);
|
||||
break;
|
||||
case 0x107: /* sysret */
|
||||
@@ -5869,7 +5874,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_DYNAMIC;
|
||||
}
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_sysret(s->dflag);
|
||||
tcg_gen_helper_0_1(helper_sysret, tcg_const_i32(s->dflag));
|
||||
/* condition codes are modified only in long mode */
|
||||
if (s->lma)
|
||||
s->cc_op = CC_OP_EFLAGS;
|
||||
@@ -5880,7 +5885,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
case 0x1a2: /* cpuid */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_CPUID))
|
||||
break;
|
||||
gen_op_cpuid();
|
||||
tcg_gen_helper_0_0(helper_cpuid);
|
||||
break;
|
||||
case 0xf4: /* hlt */
|
||||
if (s->cpl != 0) {
|
||||
@@ -5891,7 +5896,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_op_hlt();
|
||||
tcg_gen_helper_0_0(helper_hlt);
|
||||
s->is_jmp = 3;
|
||||
}
|
||||
break;
|
||||
@@ -5921,7 +5926,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
break;
|
||||
gen_ldst_modrm(s, modrm, OT_WORD, OR_TMP0, 0);
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_lldt_T0();
|
||||
tcg_gen_trunc_tl_i32(cpu_tmp2, cpu_T[0]);
|
||||
tcg_gen_helper_0_1(helper_lldt, cpu_tmp2);
|
||||
}
|
||||
break;
|
||||
case 1: /* str */
|
||||
@@ -5945,7 +5951,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
break;
|
||||
gen_ldst_modrm(s, modrm, OT_WORD, OR_TMP0, 0);
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_op_ltr_T0();
|
||||
tcg_gen_trunc_tl_i32(cpu_tmp2, cpu_T[0]);
|
||||
tcg_gen_helper_0_1(helper_ltr, cpu_tmp2);
|
||||
}
|
||||
break;
|
||||
case 4: /* verr */
|
||||
@@ -6008,7 +6015,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
gen_op_andl_A0_ffff();
|
||||
}
|
||||
gen_add_A0_ds_seg(s);
|
||||
gen_op_monitor();
|
||||
tcg_gen_helper_0_1(helper_monitor, cpu_A0);
|
||||
break;
|
||||
case 1: /* mwait */
|
||||
if (!(s->cpuid_ext_features & CPUID_EXT_MONITOR) ||
|
||||
@@ -6021,7 +6028,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_MWAIT))
|
||||
break;
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_op_mwait();
|
||||
tcg_gen_helper_0_0(helper_mwait);
|
||||
gen_eob(s);
|
||||
break;
|
||||
default:
|
||||
@@ -6050,7 +6057,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (s->cc_op != CC_OP_DYNAMIC)
|
||||
gen_op_set_cc_op(s->cc_op);
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_op_vmrun();
|
||||
tcg_gen_helper_0_0(helper_vmrun);
|
||||
s->cc_op = CC_OP_EFLAGS;
|
||||
gen_eob(s);
|
||||
break;
|
||||
@@ -6058,37 +6065,37 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_VMMCALL))
|
||||
break;
|
||||
/* FIXME: cause #UD if hflags & SVM */
|
||||
gen_op_vmmcall();
|
||||
tcg_gen_helper_0_0(helper_vmmcall);
|
||||
break;
|
||||
case 2: /* VMLOAD */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_VMLOAD))
|
||||
break;
|
||||
gen_op_vmload();
|
||||
tcg_gen_helper_0_0(helper_vmload);
|
||||
break;
|
||||
case 3: /* VMSAVE */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_VMSAVE))
|
||||
break;
|
||||
gen_op_vmsave();
|
||||
tcg_gen_helper_0_0(helper_vmsave);
|
||||
break;
|
||||
case 4: /* STGI */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_STGI))
|
||||
break;
|
||||
gen_op_stgi();
|
||||
tcg_gen_helper_0_0(helper_stgi);
|
||||
break;
|
||||
case 5: /* CLGI */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_CLGI))
|
||||
break;
|
||||
gen_op_clgi();
|
||||
tcg_gen_helper_0_0(helper_clgi);
|
||||
break;
|
||||
case 6: /* SKINIT */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_SKINIT))
|
||||
break;
|
||||
gen_op_skinit();
|
||||
tcg_gen_helper_0_0(helper_skinit);
|
||||
break;
|
||||
case 7: /* INVLPGA */
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_INVLPGA))
|
||||
break;
|
||||
gen_op_invlpga();
|
||||
tcg_gen_helper_0_0(helper_invlpga);
|
||||
break;
|
||||
default:
|
||||
goto illegal_op;
|
||||
@@ -6153,7 +6160,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_INVLPG))
|
||||
break;
|
||||
gen_lea_modrm(s, modrm, ®_addr, &offset_addr);
|
||||
gen_op_invlpg_A0();
|
||||
tcg_gen_helper_0_1(helper_invlpg, cpu_A0);
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_eob(s);
|
||||
}
|
||||
@@ -6458,7 +6465,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||
s->cc_op = CC_OP_DYNAMIC;
|
||||
}
|
||||
gen_jmp_im(s->pc - s->cs_base);
|
||||
gen_op_rsm();
|
||||
tcg_gen_helper_0_0(helper_rsm);
|
||||
gen_eob(s);
|
||||
break;
|
||||
case 0x10e ... 0x10f:
|
||||
@@ -6855,9 +6862,6 @@ void optimize_flags_init(void)
|
||||
cpu_A0 = tcg_global_reg_new(TCG_TYPE_TL, TCG_AREG3, "A0");
|
||||
cpu_tmp1 = tcg_global_reg2_new_hack(TCG_TYPE_I64, TCG_AREG1, TCG_AREG2, "tmp1");
|
||||
#endif
|
||||
/* the helpers are only registered to print debug info */
|
||||
TCG_HELPER(helper_divl_EAX_T0);
|
||||
TCG_HELPER(helper_idivl_EAX_T0);
|
||||
}
|
||||
|
||||
/* CPU flags computation optimization: we move backward thru the
|
||||
|
||||
Reference in New Issue
Block a user