Received: from eggs.gnu.org ([2001:4830:134:3::10]:48881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwhvH-0007of-Gr for qemu-devel@nongnu.org; Fri, 27 Dec 2013 19:38:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwhvB-0006od-HQ for qemu-devel@nongnu.org; Fri, 27 Dec 2013 19:38:35 -0500 Received: from mail-bn1lp0155.outbound.protection.outlook.com ([207.46.163.155]:58615 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwhvB-0006oZ-B9 for qemu-devel@nongnu.org; Fri, 27 Dec 2013 19:38:29 -0500 Message-ID: <1388190214.21454.30.camel@snotra.buserror.net> From: Scott Wood Date: Fri, 27 Dec 2013 18:23:34 -0600 In-Reply-To: <52B9A596.5060706@twiddle.net> References: <1387399747-4994-1-git-send-email-tommusta@gmail.com> <1387399747-4994-3-git-send-email-tommusta@gmail.com> <52B9A596.5060706@twiddle.net> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [V3 PATCH 02/14] target-ppc: Add ISA2.06 bpermd Instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Tom Musta , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Tue, 2013-12-24 at 07:17 -0800, Richard Henderson wrote: > On 12/18/2013 12:48 PM, Tom Musta wrote: > > +DEF_HELPER_3(bpermd, i64, env, i64, i64) > > Should be DEF_HELPER_FLAGS_2(bpermd, TCG_CALL_NO_RWG_SE, i64, i64, i64) > > > +uint64_t helper_bpermd(CPUPPCState *env, uint64_t rs, uint64_t rb) > > +{ > > + int i; > > + uint64_t ra = 0; > > + > > + for (i = 0; i < 8; i++) { > > + int index = (rs >> (i*8)) & 0xFF; > > + if (index < 64) { > > + if (rb & (1ul << (63-index))) { > > + ra |= 1 << i; > > + } > > + } > > + } > > + return ra; > > +} > > + > > You don't need env as an argument; it's unused. > > Why is all of this specific to ppc64? Can't you run an ISA2.06B machine in > 32-bit mode? bpermd is a 64-bit instruction. 32-bit implementations do not have it. -Scott