public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 0/8] Simplify byte/word opcode pair decode
Date: Mon, 23 Aug 2010 17:13:26 +0300	[thread overview]
Message-ID: <4C728206.9020007@redhat.com> (raw)
In-Reply-To: <4C727FFE.8060806@redhat.com>

  On 08/23/2010 05:04 PM, Paolo Bonzini wrote:
> On 08/23/2010 03:48 PM, Avi Kivity wrote:
>> On 08/23/2010 04:29 PM, Paolo Bonzini wrote:
>>> On 08/23/2010 01:06 PM, Avi Kivity wrote:
>>>> Many x86 instructions come in pairs - byte and word variants where 
>>>> bit 0
>>>> of the opcode determines operand size. Use this to simplify the decode
>>>> tables.
>>>
>>> Many actually come in quadruples, bit 0 is the size and bit 1 says
>>> which of ModRM and REG is the destination.
>>>
>>> example:
>>>
>>> D2bv(DstMem | SrcReg | ModRM | Lock), D2bv(DstReg | SrcMem | ModRM),
>>>
>>
>> Right. We can't exploit those yet.
>
> What about this?  It wouldn't work for things such as SrcAcc, but it 
> would still reap most of the benefit:
>
> #define D4modrm(x) \
>   D2bv(DstMem | SrcReg | ModRM | (x)), \
>   D2bv(DstReg | SrcMem | ModRM | ((x) & ~Lock))
>

It's fine except for the name. "bv" stands for the single letter flags 
Intel gave to byte and word operations so it's somewhat descriptive.  
Maybe we could call it ALU4() and pretend that mov is an ALU 
instruction.  We could also do an ALU6() for the ALU block.

A really clever macro could probably compress the entire table into a 
single line.

> e.g.
> - ALU block -> D4modrm(Lock)
> - 0x88-0x8b -> D4modrm(Mov)


-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2010-08-23 14:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 11:06 [PATCH 0/8] Simplify byte/word opcode pair decode Avi Kivity
2010-08-23 11:06 ` [PATCH 1/8] KVM: x86 emulator: support byte/word opcode pairs Avi Kivity
2010-08-23 11:06 ` [PATCH 2/8] KVM: x86 emulator: simplify ALU block (opcodes 00-3F) decode flags Avi Kivity
2010-08-25 19:39   ` Marcelo Tosatti
2010-08-26  8:26     ` Avi Kivity
2010-08-23 11:06 ` [PATCH 3/8] KVM: x86 emulator: simplify string instruction " Avi Kivity
2010-08-23 11:06 ` [PATCH 4/8] KVM: x86 emulator: simplify instruction decode flags for opcodes 80-8F Avi Kivity
2010-08-23 11:06 ` [PATCH 5/8] KVM: x86 emulator: simplify instruction decode flags for opcodes A0-AF Avi Kivity
2010-08-23 11:06 ` [PATCH 6/8] KVM: x86 emulator: simplify instruction decode flags for opcodes C0-DF Avi Kivity
2010-08-23 11:06 ` [PATCH 7/8] KVM: x86 emulator: simplify instruction decode flags for opcodes E0-FF Avi Kivity
2010-08-23 13:33   ` Gleb Natapov
2010-08-23 13:46     ` Avi Kivity
2010-08-23 13:56       ` Gleb Natapov
2010-08-23 11:06 ` [PATCH 8/8] KVM: x86 emulator: simplify instruction decode flags for opcodes 0F 00-FF Avi Kivity
2010-08-23 13:29 ` [PATCH 0/8] Simplify byte/word opcode pair decode Paolo Bonzini
2010-08-23 13:48   ` Avi Kivity
2010-08-23 14:04     ` Paolo Bonzini
2010-08-23 14:13       ` Avi Kivity [this message]

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=4C728206.9020007@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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