@@ -1481,17 +1481,27 @@ mod sealed {
1481
1481
impl_vec_splat ! { vector_bool_int, vspltw }
1482
1482
1483
1483
macro_rules! splat {
1484
- ( $name: ident, $v: ident, $r: ident [ $instr : ident, $doc: literal] ) => {
1484
+ ( $name: ident, $v: ident, $r: ident [ $instr_altivec : ident / $instr_pwr9 : ident, $doc: literal] ) => {
1485
1485
#[ doc = $doc]
1486
1486
#[ inline]
1487
1487
#[ target_feature( enable = "altivec" ) ]
1488
- #[ cfg_attr( test, assert_instr( $instr, IMM5 = 1 ) ) ]
1488
+ #[ cfg_attr(
1489
+ all( test, not( target_feature = "vsx" ) ) ,
1490
+ assert_instr( $instr_altivec, IMM5 = 1 )
1491
+ ) ]
1492
+ #[ cfg_attr(
1493
+ all( test, target_feature = "power9-vector" ) ,
1494
+ assert_instr( $instr_pwr9, IMM5 = 1 )
1495
+ ) ]
1489
1496
#[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
1490
1497
pub unsafe fn $name<const IMM5 : i8 >( ) -> s_t_l!( $r) {
1491
1498
static_assert_simm_bits!( IMM5 , 5 ) ;
1492
1499
transmute( $r:: splat( IMM5 as $v) )
1493
1500
}
1494
1501
} ;
1502
+ ( $name: ident, $v: ident, $r: ident [ $instr: ident, $doc: literal] ) => {
1503
+ splat! { $name, $v, $r [ $instr / $instr, $doc] }
1504
+ } ;
1495
1505
}
1496
1506
1497
1507
macro_rules! splats {
@@ -1514,11 +1524,11 @@ mod sealed {
1514
1524
1515
1525
test_impl ! { vec_splats_u8 ( v: u8 ) -> vector_unsigned_char [ splats_u8, vspltb] }
1516
1526
test_impl ! { vec_splats_u16 ( v: u16 ) -> vector_unsigned_short [ splats_u16, vsplth] }
1517
- test_impl ! { vec_splats_u32 ( v: u32 ) -> vector_unsigned_int [ splats_u32, vspltw / xxspltw] }
1527
+ test_impl ! { vec_splats_u32 ( v: u32 ) -> vector_unsigned_int [ splats_u32, vspltw / xxspltw / mtvsrws ] }
1518
1528
test_impl ! { vec_splats_i8 ( v: i8 ) -> vector_signed_char [ splats_i8, vspltb] }
1519
1529
test_impl ! { vec_splats_i16 ( v: i16 ) -> vector_signed_short [ splats_i16, vsplth] }
1520
- test_impl ! { vec_splats_i32 ( v: i32 ) -> vector_signed_int [ splats_i32, vspltw / xxspltw] }
1521
- test_impl ! { vec_splats_f32 ( v: f32 ) -> vector_float [ splats_f32, vspltw / xxspltw] }
1530
+ test_impl ! { vec_splats_i32 ( v: i32 ) -> vector_signed_int [ splats_i32, vspltw / xxspltw / mtvsrws ] }
1531
+ test_impl ! { vec_splats_f32 ( v: f32 ) -> vector_float [ splats_f32, vspltw / xxspltw / mtvsrws ] }
1522
1532
1523
1533
#[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
1524
1534
pub trait VectorSplats {
@@ -3823,8 +3833,8 @@ where
3823
3833
a. vec_splat :: < IMM > ( )
3824
3834
}
3825
3835
3826
- splat ! { vec_splat_u8, u8 , u8x16 [ vspltisb, "Vector Splat to Unsigned Byte" ] }
3827
- splat ! { vec_splat_s8, i8 , i8x16 [ vspltisb, "Vector Splat to Signed Byte" ] }
3836
+ splat ! { vec_splat_u8, u8 , u8x16 [ vspltisb / xxspltib , "Vector Splat to Unsigned Byte" ] }
3837
+ splat ! { vec_splat_s8, i8 , i8x16 [ vspltisb / xxspltib , "Vector Splat to Signed Byte" ] }
3828
3838
splat ! { vec_splat_u16, u16 , u16x8 [ vspltish, "Vector Splat to Unsigned Halfword" ] }
3829
3839
splat ! { vec_splat_s16, i16 , i16x8 [ vspltish, "Vector Splat to Signed Halfword" ] }
3830
3840
splat ! { vec_splat_u32, u32 , u32x4 [ vspltisw, "Vector Splat to Unsigned Word" ] }
0 commit comments