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

login
register
mail settings
Submitter Anton Blanchard
Date June 2, 2013, 12:30 p.m.
Message ID <20130602223018.440457e3@kryten>
Download mbox | patch
Permalink /patch/248111/
State New
Headers show

Comments

Anton Blanchard - June 2, 2013, 12:30 p.m.
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>
---
Richard Henderson - June 3, 2013, 2:33 p.m.
On 06/02/2013 05:30 AM, Anton Blanchard wrote:
> 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>
> ---

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

Patch

Index: b/tcg/ppc64/tcg-target.c
===================================================================
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -1661,7 +1661,7 @@  static void tcg_out_op (TCGContext *s, T
             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;