Received: from eggs.gnu.org ([2001:4830:134:3::10]:43586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtPLE-0003ji-Fk for qemu-devel@nongnu.org; Wed, 18 Dec 2013 17:11:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtPL9-0002sL-K7 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 17:11:44 -0500 Message-ID: <1387404681.3140.70.camel@snotra.buserror.net> From: Scott Wood Date: Wed, 18 Dec 2013 16:11:21 -0600 In-Reply-To: <7C13E820-F604-4C25-BE2D-F8C76AC9B6B7@suse.de> References: <1386604035-2507-1-git-send-email-tommusta@gmail.com> <1386604035-2507-2-git-send-email-tommusta@gmail.com> <1387404157.3140.68.camel@snotra.buserror.net> <7C13E820-F604-4C25-BE2D-F8C76AC9B6B7@suse.de> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/18] target-ppc: Add Flag for Power ISA V2.06 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Tom Musta , qemu-ppc , QEMU Developers On Wed, 2013-12-18 at 23:09 +0100, Alexander Graf wrote: > On 18.12.2013, at 23:02, Scott Wood wrote: > > > On Mon, 2013-12-09 at 09:46 -0600, Tom Musta wrote: > >> This patch adds a flag for base instruction additions to Power ISA > >> 2.06B. The flag will be used to identify/select basic Book I and > >> Book II instructions that were newly added in that revision of the > >> architecture. The flag will not be used for VSX or Altivec. > >> > >> Signed-off-by: Tom Musta > >> --- > >> target-ppc/cpu.h | 4 +++- > >> target-ppc/translate_init.c | 6 ++++-- > >> 2 files changed, 7 insertions(+), 3 deletions(-) > >> > >> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h > >> index 0abc848..fe3aace 100644 > >> --- a/target-ppc/cpu.h > >> +++ b/target-ppc/cpu.h > >> @@ -1877,9 +1877,11 @@ enum { > >> PPC2_ISA205 = 0x0000000000000020ULL, > >> /* VSX additions in ISA 2.07 */ > >> PPC2_VSX207 = 0x0000000000000040ULL, > >> + /* Book I 2.06B PowerPC specification (base instructions) */ > >> + PPC2_ISA206 = 0x0000000000000080ULL, > >> > >> #define PPC_TCG_INSNS2 (PPC2_BOOKE206 | PPC2_VSX | PPC2_PRCNTL | PPC2_DBRX | \ > >> - PPC2_ISA205 | PPC2_VSX207) > >> + PPC2_ISA205 | PPC2_VSX207 | PPC2_ISA206) > >> }; > >> > >> /*****************************************************************************/ > >> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > >> index e14ab63..491e56c 100644 > >> --- a/target-ppc/translate_init.c > >> +++ b/target-ppc/translate_init.c > >> @@ -7234,7 +7234,8 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) > >> PPC_64B | PPC_ALTIVEC | > >> PPC_SEGMENT_64B | PPC_SLBI | > >> PPC_POPCNTB | PPC_POPCNTWD; > >> - pcc->insns_flags2 = PPC2_VSX | PPC2_DFP | PPC2_DBRX | PPC2_ISA205; > >> + pcc->insns_flags2 = PPC2_VSX | PPC2_DFP | PPC2_DBRX | PPC2_ISA205 | > >> + PPC2_ISA206; > >> pcc->msr_mask = 0x800000000284FF37ULL; > >> pcc->mmu_model = POWERPC_MMU_2_06; > >> #if defined(CONFIG_SOFTMMU) > >> @@ -7270,7 +7271,8 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) > >> PPC_64B | PPC_ALTIVEC | > >> PPC_SEGMENT_64B | PPC_SLBI | > >> PPC_POPCNTB | PPC_POPCNTWD; > >> - pcc->insns_flags2 = PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX; > >> + pcc->insns_flags2 = PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX | > >> + PPC2_ISA206; > >> pcc->msr_mask = 0x800000000284FF36ULL; > >> pcc->mmu_model = POWERPC_MMU_2_06; > >> #if defined(CONFIG_SOFTMMU) > > > > e500mc/e5500 are also ISA 2.06 (minus some of these new instructions, > > but not all of them -- better to emulate instructions that don't exist > > than to not emulate instructions that do exist). > > Well, that's what the nice categories in the ISA are there for, no? > They should tell us quite explicitly which instructions are available > in embedded and which are not. They should, but they don't. In the core reference manual for e500mc and derivatives, it lists the ISA categories supported... and then has a table that says "oh, except for these instructions". -Scott