]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-arm: A64: Fix bug in add_sub_ext handling of rn
authorAlex Bennée <alex.bennee@linaro.org>
Mon, 17 Mar 2014 16:31:47 +0000 (16:31 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 17 Mar 2014 16:31:47 +0000 (16:31 +0000)
rn == 31 always means SP (not XZR) whether an add_sub_ext
instruction is setting the flags or not; only rd has behaviour
dependent on whether we are setting flags.

Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1394822294-14837-3-git-send-email-peter.maydell@linaro.org

target-arm/translate-a64.c

index 37252b7479078d0051885aaa2d7baffb55a601c9..444dd8504d11c36e25730489ef4661c08ac9b4ca 100644 (file)
@@ -3096,12 +3096,11 @@ static void disas_add_sub_ext_reg(DisasContext *s, uint32_t insn)
 
     /* non-flag setting ops may use SP */
     if (!setflags) {
-        tcg_rn = read_cpu_reg_sp(s, rn, sf);
         tcg_rd = cpu_reg_sp(s, rd);
     } else {
-        tcg_rn = read_cpu_reg(s, rn, sf);
         tcg_rd = cpu_reg(s, rd);
     }
+    tcg_rn = read_cpu_reg_sp(s, rn, sf);
 
     tcg_rm = read_cpu_reg(s, rm, sf);
     ext_and_shift_reg(tcg_rm, tcg_rm, option, imm3);