mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
target-i386: exception handling for div instructions
This patch fixes exception handling for div instructions and removes obsolete PC update from translate.c. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
6cad09d2f7
commit
cc33c5d66b
2 changed files with 16 additions and 24 deletions
|
@ -4841,21 +4841,17 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
|||
case 6: /* div */
|
||||
switch(ot) {
|
||||
case MO_8:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_divb_AL(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
case MO_16:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_divw_AX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
default:
|
||||
case MO_32:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_divl_EAX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
#ifdef TARGET_X86_64
|
||||
case MO_64:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_divq_EAX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
#endif
|
||||
|
@ -4864,21 +4860,17 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
|||
case 7: /* idiv */
|
||||
switch(ot) {
|
||||
case MO_8:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_idivb_AL(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
case MO_16:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_idivw_AX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
default:
|
||||
case MO_32:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_idivl_EAX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
#ifdef TARGET_X86_64
|
||||
case MO_64:
|
||||
gen_jmp_im(pc_start - s->cs_base);
|
||||
gen_helper_idivq_EAX(cpu_env, cpu_T[0]);
|
||||
break;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue