From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu0mz-00014Y-Oh for qemu-devel@nongnu.org; Fri, 20 Dec 2013 09:10:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vu0mr-0003VF-Pf for qemu-devel@nongnu.org; Fri, 20 Dec 2013 09:10:53 -0500 Received: from mail-qe0-x232.google.com ([2607:f8b0:400d:c02::232]:39217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu0mr-0003V8-El for qemu-devel@nongnu.org; Fri, 20 Dec 2013 09:10:45 -0500 Received: by mail-qe0-f50.google.com with SMTP id 1so2335864qec.37 for ; Fri, 20 Dec 2013 06:10:45 -0800 (PST) Sender: Richard Henderson Message-ID: <52B44FE0.8060907@twiddle.net> Date: Fri, 20 Dec 2013 06:10:40 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1387293144-11554-1-git-send-email-peter.maydell@linaro.org> <1387293144-11554-8-git-send-email-peter.maydell@linaro.org> <52B34907.1040109@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/21] target-arm: A64: add support for 3 src data proc insns List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Patch Tracking , Michael Matz , QEMU Developers , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "kvmarm@lists.cs.columbia.edu" , Christoffer Dall On 12/20/2013 05:18 AM, Peter Maydell wrote: > On 19 December 2013 19:29, Richard Henderson wrote: >> On 12/17/2013 07:12 AM, Peter Maydell wrote: >>> + tcg_gen_mul_i64(tcg_tmp, tcg_op1, tcg_op2); >>> + if (is_sub) { >>> + tcg_gen_sub_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); >>> + } else { >>> + tcg_gen_add_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); >>> + } >> >> Perhaps worth noticing the RA=XZR special case for the MUL alias? > > Yeah, makes sense: have adjusted to: > + if (ra == 31) { > + /* We special-case rA == XZR as it is the standard MUL alias */ > + tcg_gen_mul_i64(cpu_reg(s, rd), tcg_op1, tcg_op2); > + } else { You need to handle (or dismiss) is_sub. Either (ra == 31 && !is_sub) or if (is_sub) { tcg_gen_neg_i64(tcg_rd, tcg_rd); } with tcg_rd pre-loaded along with tcg_op1 and tcg_op2. That said, unlike MUL I don't expect MNEG to be common at all. > + tcg_gen_mul_i64(tcg_tmp, tcg_op1, tcg_op2); > + if (is_sub) { > + tcg_gen_sub_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); > + } else { > + tcg_gen_add_i64(cpu_reg(s, rd), cpu_reg(s, ra), tcg_tmp); > + } > + } r~