Received: from eggs.gnu.org ([2001:4830:134:3::10]:54103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBMyN-0002Hy-17 for qemu-devel@nongnu.org; Mon, 28 Nov 2016 09:32:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBMyJ-00016c-UL for qemu-devel@nongnu.org; Mon, 28 Nov 2016 09:31:59 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:32826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBMyJ-00016J-OH for qemu-devel@nongnu.org; Mon, 28 Nov 2016 09:31:55 -0500 Received: by mail-qt0-x244.google.com with SMTP id n6so11710160qtd.0 for ; Mon, 28 Nov 2016 06:31:55 -0800 (PST) Sender: Richard Henderson References: <1479242669-25852-1-git-send-email-rth@twiddle.net> <3ed57b8d-4c59-22eb-4d45-a8b2454b0bf5@vivier.eu> From: Richard Henderson Message-ID: Date: Mon, 28 Nov 2016 06:31:49 -0800 MIME-Version: 1.0 In-Reply-To: <3ed57b8d-4c59-22eb-4d45-a8b2454b0bf5@vivier.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-m68k: Implement bfffo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org On 11/27/2016 11:53 AM, Laurent Vivier wrote: >> tcg_gen_andi_i32(tmp, tmp, 31); >> > mask = tcg_const_i32(0x7fffffffu); >> > tcg_gen_shr_i32(mask, mask, tmp); >> > + if (!TCGV_IS_UNUSED(tlen)) { >> > + tcg_gen_mov_i32(tlen, tmp); > We must add 1 here, otherwise the value stays between 0 and 31, not 1 > and 32: > > + tcg_gen_addi_i32(tlen, tmp, 1); > Yep, good catch. r~