Received: from eggs.gnu.org ([2001:4830:134:3::10]:58943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDHRP-0005Jj-VP for qemu-devel@nongnu.org; Sat, 03 Dec 2016 16:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDHRO-0005ZX-Sz for qemu-devel@nongnu.org; Sat, 03 Dec 2016 16:01:52 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:33361) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cDHRO-0005Yt-KW for qemu-devel@nongnu.org; Sat, 03 Dec 2016 16:01:50 -0500 Received: by mail-pg0-x241.google.com with SMTP id 3so11652724pgd.0 for ; Sat, 03 Dec 2016 13:01:49 -0800 (PST) Sender: Richard Henderson References: <1479906121-12211-1-git-send-email-rth@twiddle.net> <1479906121-12211-15-git-send-email-rth@twiddle.net> <87y3zzsh1z.fsf@linaro.org> From: Richard Henderson Message-ID: Date: Sat, 3 Dec 2016 13:01:44 -0800 MIME-Version: 1.0 In-Reply-To: <87y3zzsh1z.fsf@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 14/64] target-arm: Use new deposit and extract ops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: qemu-devel@nongnu.org On 12/01/2016 09:19 AM, Alex Bennée wrote: > In fact we seem to have subtly reversed the test here but ri <= si is > not exactly equivalent to si >= ri. > > My version is as follows: > > /* Recognize simple(r) extractions. */ > if (si >= ri) { > /* Wd = Wn */ > len = (si - ri) + 1; > if (opc == 0) { /* SBFM: ASR, SBFX, SXTB, SXTH, SXTW */ > tcg_gen_sextract_i64(tcg_rd, tcg_tmp, ri, len); > goto done; > } else if (opc == 2) { /* UBFM: UBFX, LSR, UXTB, UXTH */ > tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); > return; > } > /* opc == 1, BXFIL fall through to deposit */ > tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); > pos = 0; > } else { > /* Handle the ri > si case with a deposit > * Wd<32+s-r,32-r> = Wn > */ > len = si + 1; > pos = (bitsize - ri) & (bitsize - 1); > } > > I've tested that with risu and all the bitfield tests seem ok. Thanks. Merged. r~