Received: from eggs.gnu.org ([2001:4830:134:3::10]:50228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwWz5-0003bs-2S for qemu-devel@nongnu.org; Tue, 18 Oct 2016 12:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwWyw-0002Wv-HD for qemu-devel@nongnu.org; Tue, 18 Oct 2016 12:11:18 -0400 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:33216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwWyw-0002WV-B9 for qemu-devel@nongnu.org; Tue, 18 Oct 2016 12:11:14 -0400 Received: by mail-io0-x229.google.com with SMTP id q192so2981170iod.0 for ; Tue, 18 Oct 2016 09:11:14 -0700 (PDT) Sender: Richard Henderson References: <1476803431-7208-1-git-send-email-rth@twiddle.net> <1476803431-7208-5-git-send-email-rth@twiddle.net> <580640CC.6010008@huawei.com> From: Richard Henderson Message-ID: <8bf4e3ef-ed3d-7a14-a4eb-610c61e0586b@twiddle.net> Date: Tue, 18 Oct 2016 09:11:10 -0700 MIME-Version: 1.0 In-Reply-To: <580640CC.6010008@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 04/18] tcg/aarch64: Implement field extraction opcodes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana , qemu-devel@nongnu.org On 10/18/2016 08:33 AM, Claudio Fontana wrote: >> > + case INDEX_op_extract_i64: >> > + case INDEX_op_extract_i32: >> > + tcg_out_ubfm(s, ext, a0, a1, a2, a2 + args[3] - 1); >> > + break; >> > + >> > + case INDEX_op_sextract_i64: >> > + case INDEX_op_sextract_i32: >> > + tcg_out_sbfm(s, ext, a0, a1, a2, a2 + args[3] - 1); >> > + break; >> > + > ah, probably missing something obvious.. not args[3]? No, the r and s fields encode lsb and msb of the field. I had the same wrong memory of the encoding; which is fair considering the aarch32 instruction *does* use lsb and size-1. The failure was quite obvious even in the disassembly once I actually got a machine checked out to test it. r~