Received: from eggs.gnu.org ([208.118.235.92]:57129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMh7n-0007nO-M8 for qemu-devel@nongnu.org; Mon, 01 Apr 2013 11:58:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMh7m-0001oA-IX for qemu-devel@nongnu.org; Mon, 01 Apr 2013 11:58:23 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:52854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMh7m-0001ns-3v for qemu-devel@nongnu.org; Mon, 01 Apr 2013 11:58:22 -0400 Date: Mon, 1 Apr 2013 17:58:19 +0200 From: Aurelien Jarno Message-ID: <20130401155819.GF6467@hall.aurel32.net> References: <1362443590-28191-1-git-send-email-rth@twiddle.net> <1362443590-28191-13-git-send-email-rth@twiddle.net> <20130401145539.GA15124@ohm.aurel32.net> <5159AB1C.1050006@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5159AB1C.1050006@twiddle.net> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH v2 12/27] tcg-ppc64: Improve and_i32 with constant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: av1474@comtv.ru, qemu-devel@nongnu.org On Mon, Apr 01, 2013 at 08:43:24AM -0700, Richard Henderson wrote: > On 2013-04-01 07:55, Aurelien Jarno wrote: > >>>+static void tcg_out_andi32(TCGContext *s, TCGReg dst, TCGReg src, uint32_t c) > >>>+{ > >>>+ int mb, me; > >>>+ > >>>+ if ((c & 0xffff) == c) { > >>>+ tcg_out32(s, ANDI | SAI(src, dst, c)); > >>>+ return; > >>>+ } else if ((c & 0xffff0000) == c) { > >>>+ tcg_out32(s, ANDIS | SAI(src, dst, c >> 16)); > >>>+ return; > >>>+ } else if (mask_operand(c, &mb, &me)) { > >>>+ tcg_out_rlw(s, RLWINM, dst, src, 0, mb, me); > >>>+ } else { > >>>+ tcg_out_movi(s, TCG_TYPE_I32, 0, c); > >>>+ tcg_out32(s, AND | SAB(src, dst, 0)); > >Give it's a 32-bit constant, wouldn't it be better to use ANDI + > >ANDIS here? > > > > x & 0xffff0000 & 0x0000ffff == 0. > > Unlike IOR and XOR... Looks like I read it too quickly. Therefore: Reviewed-by: Aurelien Jarno -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net