From: Avi Kivity <avi.kivity@gmail.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH v2 5/7] KVM: x86 emulator: convert NOT, NEG to fastop
Date: Fri, 4 Jan 2013 12:47:37 +0200 [thread overview]
Message-ID: <1357296459-8951-6-git-send-email-avi.kivity@gmail.com> (raw)
In-Reply-To: <1357296459-8951-1-git-send-email-avi.kivity@gmail.com>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
---
arch/x86/kvm/emulate.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 2af0c44..09dbdc5 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2050,17 +2050,8 @@ static int em_grp2(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE;
}
-static int em_not(struct x86_emulate_ctxt *ctxt)
-{
- ctxt->dst.val = ~ctxt->dst.val;
- return X86EMUL_CONTINUE;
-}
-
-static int em_neg(struct x86_emulate_ctxt *ctxt)
-{
- emulate_1op(ctxt, "neg");
- return X86EMUL_CONTINUE;
-}
+FASTOP1(not);
+FASTOP1(neg);
static int em_mul_ex(struct x86_emulate_ctxt *ctxt)
{
@@ -3753,8 +3744,8 @@ static const struct opcode group1A[] = {
static const struct opcode group3[] = {
I(DstMem | SrcImm | NoWrite, em_test),
I(DstMem | SrcImm | NoWrite, em_test),
- I(DstMem | SrcNone | Lock, em_not),
- I(DstMem | SrcNone | Lock, em_neg),
+ F(DstMem | SrcNone | Lock, em_not),
+ F(DstMem | SrcNone | Lock, em_neg),
I(SrcMem, em_mul_ex),
I(SrcMem, em_imul_ex),
I(SrcMem, em_div_ex),
--
1.8.0.1
next prev parent reply other threads:[~2013-01-04 10:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 10:47 [PATCH v2 0/7] Streamline arithmetic instruction emulation Avi Kivity
2013-01-04 10:47 ` [PATCH v2 1/7] KVM: x86 emulator: framework for streamlining arithmetic opcodes Avi Kivity
2013-01-04 10:47 ` [PATCH v2 2/7] KVM: x86 emulator: Support for declaring single operand fastops Avi Kivity
2013-01-04 10:47 ` [PATCH v2 3/7] KVM: x86 emulator: introduce NoWrite flag Avi Kivity
2013-01-04 10:47 ` [PATCH v2 4/7] KVM: x86 emulator: mark CMP, CMPS, SCAS, TEST as NoWrite Avi Kivity
2013-01-04 10:47 ` Avi Kivity [this message]
2013-01-04 10:47 ` [PATCH v2 6/7] KVM: x86 emulator: add macros for defining 2-operand fastop emulation Avi Kivity
2013-01-04 12:57 ` Avi Kivity
2013-01-04 10:47 ` [PATCH v2 7/7] KVM: x86 emulator: convert basic ALU ops to fastop Avi Kivity
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=1357296459-8951-6-git-send-email-avi.kivity@gmail.com \
--to=avi.kivity@gmail.com \
--cc=gleb@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox