Skip to content

Commit

Permalink
target-ppc: Implement mtvsrdd instruction
Browse files Browse the repository at this point in the history
mtvsrdd: Move To VSR Double Doubleword

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
Ravi Bangoria authored and dgibson committed Oct 5, 2016
1 parent 6358320 commit b973107
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions target-ppc/translate/vsx-impl.inc.c
Expand Up @@ -234,6 +234,29 @@ static void gen_mfvsrld(DisasContext *ctx)
tcg_gen_mov_i64(cpu_gpr[rA(ctx->opcode)], cpu_vsrl(xS(ctx->opcode)));
}

static void gen_mtvsrdd(DisasContext *ctx)
{
if (xT(ctx->opcode) < 32) {
if (unlikely(!ctx->vsx_enabled)) {
gen_exception(ctx, POWERPC_EXCP_VSXU);
return;
}
} else {
if (unlikely(!ctx->altivec_enabled)) {
gen_exception(ctx, POWERPC_EXCP_VPU);
return;
}
}

if (!rA(ctx->opcode)) {
tcg_gen_movi_i64(cpu_vsrh(xT(ctx->opcode)), 0);
} else {
tcg_gen_mov_i64(cpu_vsrh(xT(ctx->opcode)), cpu_gpr[rA(ctx->opcode)]);
}

tcg_gen_mov_i64(cpu_vsrl(xT(ctx->opcode)), cpu_gpr[rB(ctx->opcode)]);
}

#endif

static void gen_xxpermdi(DisasContext *ctx)
Expand Down
1 change: 1 addition & 0 deletions target-ppc/translate/vsx-ops.inc.c
Expand Up @@ -23,6 +23,7 @@ GEN_HANDLER_E(mtvsrwz, 0x1F, 0x13, 0x07, 0x0000F800, PPC_NONE, PPC2_VSX207),
GEN_HANDLER_E(mfvsrd, 0x1F, 0x13, 0x01, 0x0000F800, PPC_NONE, PPC2_VSX207),
GEN_HANDLER_E(mtvsrd, 0x1F, 0x13, 0x05, 0x0000F800, PPC_NONE, PPC2_VSX207),
GEN_HANDLER_E(mfvsrld, 0X1F, 0x13, 0x09, 0x0000F800, PPC_NONE, PPC2_ISA300),
GEN_HANDLER_E(mtvsrdd, 0X1F, 0x13, 0x0D, 0x0, PPC_NONE, PPC2_ISA300),
#endif

#define GEN_XX1FORM(name, opc2, opc3, fl2) \
Expand Down

0 comments on commit b973107

Please sign in to comment.