Commit
75066cd4ea ("x86emul: fix {,i}mul and {,i}div") can be had with
less code: Simply do the destination register override depending on
DstEax being in effect (the four other ModRM.reg encoded operations of
these two opcodes all use DstMem).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
break;
case 0xf6 ... 0xf7: /* Grp3 */
+ if ( (d & DstMask) == DstEax )
+ dst.reg = (unsigned long *)&_regs.eax;
switch ( modrm_reg & 7 )
{
unsigned long u[2], v;
emulate_1op("neg", dst, _regs.eflags);
break;
case 4: /* mul */
- dst.reg = (unsigned long *)&_regs.eax;
_regs.eflags &= ~(EFLG_OF|EFLG_CF);
switch ( dst.bytes )
{
}
break;
case 5: /* imul */
- dst.reg = (unsigned long *)&_regs.eax;
imul:
_regs.eflags &= ~(EFLG_OF|EFLG_CF);
switch ( dst.bytes )
}
break;
case 6: /* div */
- dst.reg = (unsigned long *)&_regs.eax;
switch ( src.bytes )
{
case 1:
}
break;
case 7: /* idiv */
- dst.reg = (unsigned long *)&_regs.eax;
switch ( src.bytes )
{
case 1: