From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 1/8] KVM: x86 emulator: Streamline SHLD, SHRD Date: Thu, 17 Jan 2013 10:45:18 +0200 Message-ID: <20130117084518.GF11529@redhat.com> References: <1358001177-8952-1-git-send-email-avi.kivity@gmail.com> <1358001177-8952-2-git-send-email-avi.kivity@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46206 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759193Ab3AQIpY (ORCPT ); Thu, 17 Jan 2013 03:45:24 -0500 Content-Disposition: inline In-Reply-To: <1358001177-8952-2-git-send-email-avi.kivity@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Jan 12, 2013 at 04:32:50PM +0200, Avi Kivity wrote: > Signed-off-by: Avi Kivity > --- > arch/x86/kvm/emulate.c | 33 +++++++++++++++++++++------------ > 1 file changed, 21 insertions(+), 12 deletions(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 619a33d..2189c6a 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -454,6 +454,8 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) > #define FOP_END \ > ".popsection") > > +#define FOPNOP() FOP_ALIGN FOP_RET > + > #define FOP1E(op, dst) \ > FOP_ALIGN #op " %" #dst " \n\t" FOP_RET > > @@ -476,6 +478,18 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) > ON64(FOP2E(op##q, rax, rbx)) \ > FOP_END > > +#define FOP3E(op, dst, src, src2) \ > + FOP_ALIGN #op " %" #src2 ", %" #src ", %" #dst " \n\t" FOP_RET > + > +/* 3-operand, word-only, src2=cl */ > +#define FASTOP3WCL(op) \ > + FOP_START(op) \ > + FOPNOP() \ > + FOP3E(op, ax, bx, cl) \ > + FOP3E(op, eax, ebx, cl) \ > + ON64(FOP3E(op, rax, rbx, cl)) \ All other FASTOPs have explicit operand size. It is not strictly required since assembler can figure it out from register name, but for consistency why not put it there too? -- Gleb.