From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFWAb-00058i-3B for qemu-devel@nongnu.org; Fri, 30 Aug 2013 17:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFWAa-0004GR-2A for qemu-devel@nongnu.org; Fri, 30 Aug 2013 17:23:53 -0400 Received: from hall.aurel32.net ([2001:470:1f0b:4a8::1]:46275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFWAZ-0004GH-Qj for qemu-devel@nongnu.org; Fri, 30 Aug 2013 17:23:51 -0400 Date: Fri, 30 Aug 2013 23:23:47 +0200 From: Aurelien Jarno Message-ID: <20130830212347.GL23739@ohm.aurel32.net> References: <1377813961-12208-1-git-send-email-rth@twiddle.net> <1377813961-12208-8-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1377813961-12208-8-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v2 7/7] tcg-i386: Make use of zero-extended memory helper routines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On Thu, Aug 29, 2013 at 03:06:01PM -0700, Richard Henderson wrote: > For 8 and 16-bit unsigned loads, rely on the zero-extension > from the helper and use a smaller 32-bit move insn. > > Signed-off-by: Richard Henderson > --- > tcg/i386/tcg-target.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c > index 5aee0fa..e9d6c49 100644 > --- a/tcg/i386/tcg-target.c > +++ b/tcg/i386/tcg-target.c > @@ -1520,20 +1520,17 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) > case 1 | 4: > tcg_out_ext16s(s, data_reg, TCG_REG_EAX, P_REXW); > break; > - case 0: > - tcg_out_ext8u(s, data_reg, TCG_REG_EAX); > - break; > - case 1: > - tcg_out_ext16u(s, data_reg, TCG_REG_EAX); > - break; > - case 2: > - tcg_out_mov(s, TCG_TYPE_I32, data_reg, TCG_REG_EAX); > - break; > #if TCG_TARGET_REG_BITS == 64 > case 2 | 4: > tcg_out_ext32s(s, data_reg, TCG_REG_EAX); > break; > #endif > + case 0: > + case 1: > + /* Note that the helpers have zero-extended to tcg_target_long. */ > + case 2: > + tcg_out_mov(s, TCG_TYPE_I32, data_reg, TCG_REG_EAX); > + break; > case 3: > if (TCG_TARGET_REG_BITS == 64) { > tcg_out_mov(s, TCG_TYPE_I64, data_reg, TCG_REG_RAX); Reviewed-by: Aurelien Jarno -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net