x86emul: use DstEax also for {,I}{MUL,DIV}

Just like said in commit c0bc0adf24 ("x86emul: use DstEax where
possible"): While it avoids just a few instructions, we should
nevertheless make use of generic code as much as possible.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2016-08-17 15:32:51 +02:00
1 parent d9c91ccdcd
commit a3db233ede
1 file changed
+8 -15
+8 -15
View File
@@ -1735,7 +1735,11 @@ x86_emulate(
case 5: /* imul */
case 6: /* div */
case 7: /* idiv */
d = (d & (ByteOp | ModRM)) | DstImplicit | SrcMem;
/*
* DstEax isn't really precise for all cases; updates to
* rDX get handled in an open coded manner.
*/
d = (d & (ByteOp | ModRM)) | DstEax | SrcMem;
break;
}
break;
@@ -3544,11 +3548,8 @@ x86_emulate(
emulate_1op("neg", dst, _regs.eflags);
break;
case 4: /* mul */
dst.type = OP_REG;
dst.reg = (unsigned long *)&_regs.eax;
dst.val = *dst.reg;
_regs.eflags &= ~(EFLG_OF|EFLG_CF);
switch ( dst.bytes = src.bytes )
switch ( dst.bytes )
{
case 1:
dst.val = (uint8_t)dst.val;
@@ -3584,10 +3585,6 @@ x86_emulate(
}
break;
case 5: /* imul */
dst.type = OP_REG;
dst.reg = (unsigned long *)&_regs.eax;
dst.val = *dst.reg;
dst.bytes = src.bytes;
imul:
_regs.eflags &= ~(EFLG_OF|EFLG_CF);
switch ( dst.bytes )
@@ -3629,9 +3626,7 @@ x86_emulate(
}
break;
case 6: /* div */
dst.type = OP_REG;
dst.reg = (unsigned long *)&_regs.eax;
switch ( dst.bytes = src.bytes )
switch ( src.bytes )
{
case 1:
u[0] = (uint16_t)_regs.eax;
@@ -3676,9 +3671,7 @@ x86_emulate(
}
break;
case 7: /* idiv */
dst.type = OP_REG;
dst.reg = (unsigned long *)&_regs.eax;
switch ( dst.bytes = src.bytes )
switch ( src.bytes )
{
case 1:
u[0] = (int16_t)_regs.eax;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.