Re: [PATCH 1/7] KVM: x86 emulator: framework for streamlining arithmetic opcodes

Avi Kivity
2012-12-22T21:55:04Z

On Sat, Dec 22, 2012 at 8:44 PM, Gleb Natapov <gleb@redhat.com> wrote:
> On Sat, Dec 22, 2012 at 08:18:14PM +0200, Avi Kivity wrote:
>> > No, I was just truing to make sure I am not missing something :)
>> > Wouldn't we have to have separate fastop() function to handle rax/rdx
>> > output instructions?
>>
>> No. As long as fastop() sets up and writes back rdx correctly (and
>> also #DE for DIV, IDIV), a single implementation works for everything.
>> I don't want to add even more layers of indirect dispatch.
>
> OK, so fastop() will always writeback RDX and handle exceptions, or you
> want to mark instructions that needs this special handling with yet
> another flag?

Hopefully completely unconditional, but we'll see.

The problem is that if we pass rdx and another output parameter for
exceptions, we run out of registers on i386. We can probably hack our
way though.