@@ -1569,47 +1569,94 @@ static void gen_xxsel(DisasContext *ctx)
15691569 vsr_full_offset (rb), vsr_full_offset (ra), 16 , 16 );
15701570}
15711571
1572- static void gen_xxspltw (DisasContext *ctx)
1572+ static bool trans_XXSPLTW (DisasContext *ctx, arg_XX2 *a )
15731573{
1574- int rt = xT (ctx->opcode );
1575- int rb = xB (ctx->opcode );
1576- int uim = UIM (ctx->opcode );
15771574 int tofs, bofs;
15781575
1579- if (unlikely (!ctx->vsx_enabled )) {
1580- gen_exception (ctx, POWERPC_EXCP_VSXU );
1581- return ;
1582- }
1576+ REQUIRE_VSX (ctx);
15831577
1584- tofs = vsr_full_offset (rt );
1585- bofs = vsr_full_offset (rb );
1586- bofs += uim << MO_32 ;
1578+ tofs = vsr_full_offset (a-> xt );
1579+ bofs = vsr_full_offset (a-> xb );
1580+ bofs += a-> uim << MO_32 ;
15871581#ifndef HOST_WORDS_BIG_ENDIAN
15881582 bofs ^= 8 | 4 ;
15891583#endif
15901584
15911585 tcg_gen_gvec_dup_mem (MO_32 , tofs, bofs, 16 , 16 );
1586+ return true ;
15921587}
15931588
15941589#define pattern (x ) (((x) & 0xff ) * (~(uint64_t )0 / 0xff ))
15951590
1596- static void gen_xxspltib (DisasContext *ctx)
1591+ static bool trans_XXSPLTIB (DisasContext *ctx, arg_XXSPLTIB *a )
15971592{
1598- uint8_t uim8 = IMM8 (ctx->opcode );
1599- int rt = xT (ctx->opcode );
1593+ if (a->xt < 32 ) {
1594+ REQUIRE_VSX (ctx);
1595+ } else {
1596+ REQUIRE_VECTOR (ctx);
1597+ }
1598+ tcg_gen_gvec_dup_imm (MO_8 , vsr_full_offset (a->xt ), 16 , 16 , a->imm );
1599+ return true ;
1600+ }
16001601
1601- if (rt < 32 ) {
1602- if (unlikely (!ctx->vsx_enabled )) {
1603- gen_exception (ctx, POWERPC_EXCP_VSXU );
1604- return ;
1605- }
1602+ static bool trans_XXSPLTIW (DisasContext* ctx, arg_8RR_D *a)
1603+ {
1604+ REQUIRE_VSX (ctx);
1605+ REQUIRE_INSNS_FLAGS2 (ctx, ISA310 );
1606+
1607+ tcg_gen_gvec_dup_imm (MO_32 , vsr_full_offset (a->xt ), 16 , 16 , a->si );
1608+
1609+ return true ;
1610+ }
1611+
1612+ static bool trans_XXSPLTIDP (DisasContext* ctx, arg_8RR_D *a)
1613+ {
1614+ REQUIRE_INSNS_FLAGS2 (ctx, ISA310 );
1615+ REQUIRE_VSX (ctx);
1616+
1617+ tcg_gen_gvec_dup_imm (MO_64 , vsr_full_offset (a->xt ), 16 , 16 , helper_todouble (a->si ));
1618+ return true ;
1619+ }
1620+
1621+ static bool trans_XXSPLTI32DX (DisasContext* ctx, arg_8RR_D_IX *a)
1622+ {
1623+ REQUIRE_INSNS_FLAGS2 (ctx, ISA310 );
1624+ REQUIRE_VSX (ctx);
1625+
1626+ TCGv_i64 new_val;
1627+ TCGv_i64 mask;
1628+ TCGv_i64 t0;
1629+ TCGv_i64 t1;
1630+ new_val = tcg_temp_new_i64 ();
1631+ mask = tcg_temp_new_i64 ();
1632+ t0 = tcg_temp_new_i64 ();
1633+ t1 = tcg_temp_new_i64 ();
1634+
1635+ get_cpu_vsrh (t0, a->xt );
1636+ get_cpu_vsrl (t1, a->xt );
1637+
1638+ tcg_gen_movi_i64 (new_val, a->si );
1639+ if (a->ix ) {
1640+ tcg_gen_movi_i64 (mask, 0x00000000ffffffff );
1641+ tcg_gen_shli_i64 (new_val, new_val, 32 );
16061642 } else {
1607- if (unlikely (!ctx->altivec_enabled )) {
1608- gen_exception (ctx, POWERPC_EXCP_VPU );
1609- return ;
1610- }
1643+ tcg_gen_movi_i64 (mask, 0xffffffff00000000 );
16111644 }
1612- tcg_gen_gvec_dup_imm (MO_8 , vsr_full_offset (rt), 16 , 16 , uim8);
1645+ tcg_gen_and_i64 (t0, t0, mask);
1646+ tcg_gen_or_i64 (t0, t0, new_val);
1647+ tcg_gen_and_i64 (t1, t1, mask);
1648+ tcg_gen_or_i64 (t1, t1, new_val);
1649+
1650+ set_cpu_vsrh (a->xt , t0);
1651+ set_cpu_vsrl (a->xt , t1);
1652+
1653+
1654+ tcg_temp_free_i64 (mask);
1655+ tcg_temp_free_i64 (new_val);
1656+ tcg_temp_free_i64 (t1);
1657+ tcg_temp_free_i64 (t0);
1658+
1659+ return true ;
16131660}
16141661
16151662static void gen_xxsldwi (DisasContext *ctx)
0 commit comments