target-ppc: Altivec's mtvscr Decodes Wrong Register
authorTom Musta <tommusta@gmail.com>
Fri, 14 Nov 2014 20:01:41 +0000 (14:01 -0600)
committerAlexander Graf <agraf@suse.de>
Thu, 20 Nov 2014 13:52:01 +0000 (14:52 +0100)
The Move to Vector Status and Control Register (mtvscr) instruction
uses VRB as the source register.  Fix the code generator to correctly
decode the VRB field.  That is, use "rB(ctx->opcode)" instead of
"rD(ctx->opcode)".

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/translate.c

index 910ce56ec10309183bfaf6d5c49a0d74a05e7eff..d381632c86ada72e64eb1084a986e3f1f9bd691f 100644 (file)
@@ -6848,7 +6848,7 @@ static void gen_mtvscr(DisasContext *ctx)
         gen_exception(ctx, POWERPC_EXCP_VPU);
         return;
     }
-    p = gen_avr_ptr(rD(ctx->opcode));
+    p = gen_avr_ptr(rB(ctx->opcode));
     gen_helper_mtvscr(cpu_env, p);
     tcg_temp_free_ptr(p);
 }