Patchwork [PULL,4/4] tcg-ppc64: rotr_i32 rotates wrong amount

login
register
mail settings
Submitter Richard Henderson
Date June 17, 2013, 5:45 p.m.
Message ID <1371491129-30246-5-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/252022/
State New
Headers show

Comments

Richard Henderson - June 17, 2013, 5:45 p.m.
From: Anton Blanchard <anton@samba.org>

rotr_i32 calculates the amount to left shift and puts it into a
temporary, but then doesn't use it when doing the shift.

Cc: qemu-stable@nongnu.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/ppc64/tcg-target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index 5cdff36..606b73d 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -1662,7 +1662,7 @@  static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args,
             tcg_out_rlw(s, RLWINM, args[0], args[1], 32 - args[2], 0, 31);
         } else {
             tcg_out32(s, SUBFIC | TAI(0, args[2], 32));
-            tcg_out32(s, RLWNM | SAB(args[1], args[0], args[2])
+            tcg_out32(s, RLWNM | SAB(args[1], args[0], 0)
                          | MB(0) | ME(31));
         }
         break;