From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoKnJ-0002oI-VX for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoKnD-0003lN-0s for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:19:45 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:36000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoKnC-0003lE-SI for qemu-devel@nongnu.org; Wed, 04 Dec 2013 17:19:38 -0500 Received: by mail-pd0-f180.google.com with SMTP id q10so23302798pdj.11 for ; Wed, 04 Dec 2013 14:19:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <529FA5A5.80601@twiddle.net> References: <1386185609-25505-1-git-send-email-peter.maydell@linaro.org> <1386185609-25505-13-git-send-email-peter.maydell@linaro.org> <529FA5A5.80601@twiddle.net> From: Peter Maydell Date: Wed, 4 Dec 2013 22:19:18 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 12/12] target-arm: A64: add support for compare and branch imm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Patch Tracking , Michael Matz , Alexander Graf , QEMU Developers , C Fontana , Dirk Mueller , Laurent Desnogues , "kvmarm@lists.cs.columbia.edu" On 4 December 2013 21:59, Richard Henderson wrote: > On 12/05/2013 08:33 AM, Peter Maydell wrote: >> +static TCGv_i64 read_cpu_reg(DisasContext *s, int reg, int sf) >> +{ >> + TCGv_i64 v = new_tmp_a64_zero(s); >> + if (reg != 31) { > > This is going to issue a garbage "movi tmp, 0" opcode for every non-XZR read. > While the optimizer will remove that, it's only going to slow things down, and > easily avoidable. > > Better to allocate the temporary and only perform the movi for reg == 31. Yeah, I guess we should have a new_tmp_a64() that gives you an uninitialized auto-freeing tmp, and then have new_tmp_a64_zero() do { v = new_tmp_a64(); tcg_gen_movi_i64(v, 0); return v; } (or not have the _zero variant at all, depending on whether it's particularly useful.) thanks -- PMM