Patchwork [2/4] tcg-ppc64: bswap64 rotates output 32 bits

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

Comments

Anton Blanchard - June 2, 2013, 12:28 p.m.
If our input and output is in the same register, bswap64 tries to
undo a rotate of the input. This just ends up rotating the output.

Cc: qemu-stable@nongnu.org
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Richard Henderson - June 3, 2013, 2:31 p.m.
On 06/02/2013 05:28 AM, Anton Blanchard wrote:
> If our input and output is in the same register, bswap64 tries to
> undo a rotate of the input. This just ends up rotating the output.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Anton Blanchard <anton@samba.org>

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


r~

Patch

diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index 0fcf2b5..64fb0af 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -1922,8 +1922,6 @@  static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args,
 
         if (a0 == 0) {
             tcg_out_mov(s, TCG_TYPE_I64, args[0], a0);
-            /* Revert the source rotate that we performed above.  */
-            tcg_out_rld(s, RLDICL, a1, a1, 32, 0);
         }
         break;