From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfmrf-0005zA-Up for qemu-devel@nongnu.org; Thu, 01 May 2014 05:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfmrZ-0007rd-O1 for qemu-devel@nongnu.org; Thu, 01 May 2014 05:01:10 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:40124 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfmrZ-0007rC-HZ for qemu-devel@nongnu.org; Thu, 01 May 2014 05:01:05 -0400 References: <1398926097-28097-1-git-send-email-edgar.iglesias@gmail.com> <1398926097-28097-3-git-send-email-edgar.iglesias@gmail.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1398926097-28097-3-git-send-email-edgar.iglesias@gmail.com> Date: Thu, 01 May 2014 10:02:15 +0100 Message-ID: <87r44drhwo.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v1 2/4] target-arm: A64: Handle blr lr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org Edgar E. Iglesias writes: > From: "Edgar E. Iglesias" > > For linked branches, updates to the link register happen > conceptually after the read of the branch target register. > > Signed-off-by: Edgar E. Iglesias I'm trying to think of a case where this could actually cause a problem but I can't. However from a clarity/correctness point of view it's better. Reviewed-by: Alex Bennée > --- > target-arm/translate-a64.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c > index d86b8ff..0862e54 100644 > --- a/target-arm/translate-a64.c > +++ b/target-arm/translate-a64.c > @@ -1507,8 +1507,10 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) > switch (opc) { > case 0: /* BR */ > case 2: /* RET */ > + tcg_gen_mov_i64(cpu_pc, cpu_reg(s, rn)); > break; > case 1: /* BLR */ > + tcg_gen_mov_i64(cpu_pc, cpu_reg(s, rn)); > tcg_gen_movi_i64(cpu_reg(s, 30), s->pc); > break; > case 4: /* ERET */ > @@ -1527,7 +1529,6 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) > return; > } > > - tcg_gen_mov_i64(cpu_pc, cpu_reg(s, rn)); > s->is_jmp = DISAS_JUMP; > } -- Alex Bennée