From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 0/8] Simplify byte/word opcode pair decode Date: Mon, 23 Aug 2010 16:04:46 +0200 Message-ID: <4C727FFE.8060806@redhat.com> References: <1282561577-24491-1-git-send-email-avi@redhat.com> <4C7277AE.3040102@redhat.com> <4C727C1A.3080204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753424Ab0HWOEs (ORCPT ); Mon, 23 Aug 2010 10:04:48 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7NE4lIK004302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Aug 2010 10:04:48 -0400 In-Reply-To: <4C727C1A.3080204@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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)) e.g. - ALU block -> D4modrm(Lock) - 0x88-0x8b -> D4modrm(Mov) Paolo