From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHzoh-0004E7-95 for qemu-devel@nongnu.org; Mon, 24 Feb 2014 12:59:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHzoY-0000Mp-Oi for qemu-devel@nongnu.org; Mon, 24 Feb 2014 12:59:47 -0500 Sender: Richard Henderson Message-ID: <530B8883.5050908@twiddle.net> Date: Mon, 24 Feb 2014 09:59:31 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1392240199-2454-1-git-send-email-tommusta@gmail.com> <1392240199-2454-27-git-send-email-tommusta@gmail.com> In-Reply-To: <1392240199-2454-27-git-send-email-tommusta@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 26/28] target-ppc: Altivec 2.07: AES Instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tom Musta , qemu-devel@nongnu.org Cc: Peter Maydell , qemu-ppc@nongnu.org On 02/12/2014 01:23 PM, Tom Musta wrote: > +static uint8_t SBOX[256] = { I'm not keen on yet another copy of AES data. Please reuse "qemu/aes.h" as much as possible. Please see how we use those in target-i386; from a quick reading, these insns should match up: aesenc vcipher aesenclast vcipherlast aesdec vncipher aesdeclast vncipherlast It does look like the aes_shifts/aes_ishifts arrays should be moved from i386 specific code. Which would also be good since ops_sse.h is included multiple times and thus we have unnecessary multiple copies of this data. There's more data that should be moved out to common code in target-arm/crypto_helper.c. The most pertinent of which is a copy of your SBOX and InvSBOX arrays, which you'll still need for the vsbox insn. I'll also note that arm contains a second copy of the aes_{i,}shifts arrays. So after those are moved to common code, we avoid that duplication too. r~