From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo04B-0001Mh-Dc for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:11:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vo043-0000Ni-Nq for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:11:47 -0500 Received: from mail-yh0-f42.google.com ([209.85.213.42]:52080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo043-0000Ne-ID for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:11:39 -0500 Received: by mail-yh0-f42.google.com with SMTP id z6so10861174yhz.1 for ; Tue, 03 Dec 2013 16:11:04 -0800 (PST) Sender: Richard Henderson Message-ID: <529E7310.6070303@twiddle.net> Date: Wed, 04 Dec 2013 13:10:56 +1300 From: Richard Henderson MIME-Version: 1.0 References: <1386107477-24165-1-git-send-email-peter.maydell@linaro.org> <1386107477-24165-13-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1386107477-24165-13-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 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: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, Michael Matz , Alexander Graf , C Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu On 12/04/2013 10:51 AM, Peter Maydell wrote: > @@ -184,6 +184,18 @@ static TCGv_i64 cpu_reg(DisasContext *s, int reg) > } > } > > +/* read a cpu register in 32bit/64bit mode to dst */ > +static void read_cpu_reg(DisasContext *s, TCGv_i64 dst, int reg, int sf) > +{ > + if (reg == 31) { > + tcg_gen_movi_i64(dst, 0); > + } else if (sf) { > + tcg_gen_mov_i64(dst, cpu_X[reg]); > + } else { /* (!sf) */ > + tcg_gen_ext32u_i64(dst, cpu_X[reg]); > + } > +} I think this should be more like cpu_reg and return a TCGv instead of force a copy into a newly generated temporary. You've got a pool of auto-freeing temporaries, after all. > + if (op) { /* CBNZ */ > + tcg_gen_brcondi_i64(TCG_COND_EQ, tcg_cmp, 0, label_nomatch); > + } else { /* CBZ */ > + tcg_gen_brcondi_i64(TCG_COND_NE, tcg_cmp, 0, label_nomatch); > + } Similar comments to TBNZ/TBZ apply here. r~