All of lore.kernel.org
 help / color / mirror / Atom feed
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 v3 6/7] KVM: x86 emulator: add macros for defining 2-operand fastop emulation
Date: Fri,  4 Jan 2013 16:18:53 +0200	[thread overview]
Message-ID: <1357309134-11944-7-git-send-email-avi.kivity@gmail.com> (raw)
In-Reply-To: <1357309134-11944-1-git-send-email-avi.kivity@gmail.com>

Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
---
 arch/x86/kvm/emulate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 09dbdc5..3b5d4dd 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -465,6 +465,17 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
 	ON64(FOP1E(op##q, rax))	\
 	FOP_END
 
+#define FOP2E(op,  dst, src)	   \
+	FOP_ALIGN #op " %" #src ", %" #dst " \n\t" FOP_RET
+
+#define FASTOP2(op) \
+	FOP_START(op) \
+	FOP2E(op##b, al, bl) \
+	FOP2E(op##w, ax, bx) \
+	FOP2E(op##l, eax, ebx) \
+	ON64(FOP2E(op##q, rax, rbx)) \
+	FOP_END
+
 #define __emulate_1op_rax_rdx(ctxt, _op, _suffix, _ex)			\
 	do {								\
 		unsigned long _tmp;					\
@@ -3696,6 +3707,7 @@ static int check_perm_out(struct x86_emulate_ctxt *ctxt)
 #define D2bv(_f)      D((_f) | ByteOp), D(_f)
 #define D2bvIP(_f, _i, _p) DIP((_f) | ByteOp, _i, _p), DIP(_f, _i, _p)
 #define I2bv(_f, _e)  I((_f) | ByteOp, _e), I(_f, _e)
+#define F2bv(_f, _e)  F((_f) | ByteOp, _e), F(_f, _e)
 #define I2bvIP(_f, _e, _i, _p) \
 	IIP((_f) | ByteOp, _e, _i, _p), IIP(_f, _e, _i, _p)
 
-- 
1.8.0.1


  parent reply	other threads:[~2013-01-04 14:19 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 ` Avi Kivity [this message]
2013-01-04 14:18 ` [PATCH v3 7/7] KVM: x86 emulator: convert basic ALU ops " Avi Kivity
2013-01-08 11:38 ` [PATCH v3 0/7] Streamline arithmetic instruction emulation Gleb Natapov
2013-01-10 17:33 ` 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=1357309134-11944-7-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 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.