From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi.kivity@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v3 0/7] Streamline arithmetic instruction emulation
Date: Tue, 8 Jan 2013 13:38:37 +0200 [thread overview]
Message-ID: <20130108113837.GM21250@redhat.com> (raw)
In-Reply-To: <1357309134-11944-1-git-send-email-avi.kivity@gmail.com>
On Fri, Jan 04, 2013 at 04:18:47PM +0200, Avi Kivity wrote:
> The current arithmetic instruction emulation is fairly clumsy: after
> decode, each instruction gets a switch (size), and for every size
> we fetch the operands, prepare flags, emulate the instruction, then store
> back the flags and operands.
>
> This patchset simplifies things by moving everything into common code
> except the instruction itself. All the pre- and post- processing is
> coded just once. The per-instrution code looks like:
>
> add %bl, %al
> ret
>
> add %bx, %ax
> ret
>
> add %ebx, %eax
> ret
>
> add %rbx, %rax
> ret
>
> The savings in size, for the ten instructions converted in this patchset,
> are fairly large:
>
> text data bss dec hex filename
> 63724 0 0 63724 f8ec arch/x86/kvm/emulate.o.before
> 61268 0 0 61268 ef54 arch/x86/kvm/emulate.o.after
>
> - around 2500 bytes.
>
> v3: fix reversed operand order in 2-operand macro
>
> v2: rebased
>
Acked-by: Gleb Natapov <gleb@redhat.com>
--
Gleb.
next prev parent reply other threads:[~2013-01-08 11:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 14:18 [PATCH v3 0/7] Streamline arithmetic instruction emulation Avi Kivity
2013-01-04 14:18 ` [PATCH v3 1/7] KVM: x86 emulator: framework for streamlining arithmetic opcodes Avi Kivity
2013-01-04 14:18 ` [PATCH v3 2/7] KVM: x86 emulator: Support for declaring single operand fastops Avi Kivity
2013-01-04 14:18 ` [PATCH v3 3/7] KVM: x86 emulator: introduce NoWrite flag Avi Kivity
2013-01-04 14:18 ` [PATCH v3 4/7] KVM: x86 emulator: mark CMP, CMPS, SCAS, TEST as NoWrite Avi Kivity
2013-01-04 14:18 ` [PATCH v3 5/7] KVM: x86 emulator: convert NOT, NEG to fastop Avi Kivity
2013-01-04 14:18 ` [PATCH v3 6/7] KVM: x86 emulator: add macros for defining 2-operand fastop emulation Avi Kivity
2013-01-04 14:18 ` [PATCH v3 7/7] KVM: x86 emulator: convert basic ALU ops to fastop Avi Kivity
2013-01-08 11:38 ` Gleb Natapov [this message]
2013-01-10 17:33 ` [PATCH v3 0/7] Streamline arithmetic instruction emulation Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130108113837.GM21250@redhat.com \
--to=gleb@redhat.com \
--cc=avi.kivity@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.