Received: from eggs.gnu.org ([2001:4830:134:3::10]:41322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzqxL-0004Ap-Ih for qemu-devel@nongnu.org; Thu, 27 Oct 2016 16:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzqxI-0000M4-Fy for qemu-devel@nongnu.org; Thu, 27 Oct 2016 16:07:19 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:34006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bzqxI-0000Lg-BL for qemu-devel@nongnu.org; Thu, 27 Oct 2016 16:07:16 -0400 Received: by mail-qt0-x241.google.com with SMTP id p53so122646qtp.1 for ; Thu, 27 Oct 2016 13:07:16 -0700 (PDT) Sender: Richard Henderson References: <1477595394-23807-1-git-send-email-laurent@vivier.eu> <1477595394-23807-4-git-send-email-laurent@vivier.eu> From: Richard Henderson Message-ID: <74833105-be76-13b5-45d3-8ffdd2dd86d4@twiddle.net> Date: Thu, 27 Oct 2016 13:07:11 -0700 MIME-Version: 1.0 In-Reply-To: <1477595394-23807-4-git-send-email-laurent@vivier.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] target-m68k: shift ops manage word and byte operands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: schwab@linux-m68k.org, agraf@suse.de, gerg@uclinux.org On 10/27/2016 12:09 PM, Laurent Vivier wrote: > @@ -562,7 +562,7 @@ static void gen_flush_flags(DisasContext *s) > s->cc_op_synced = 1; > } > > -static TCGv gen_extend(TCGv val, int opsize, int sign) > +static inline TCGv gen_extend(TCGv val, int opsize, int sign) > { > TCGv tmp; Fold this hunk back into patch 2, to eliminate both extraneous changes. Alternately, drop this hunk to let the compiler decide on inlining. > + /* mask of sign bit */ > + tcg_gen_sari_i32(t0, reg, 31); > + tcg_gen_shri_i32(t0, t0, bits - count); > + tcg_gen_shri_i32(t1, reg, bits - count); > + tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, t0, t1); If you use sari for that third shift, doesn't that make the second shift unnecessary? > + tcg_gen_mov_i32(QREG_CC_V, zero); Better to just use movi with 0. r~