@@ -2663,14 +2663,8 @@ mod sealed {
2663
2663
} ;
2664
2664
}
2665
2665
2666
- #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2667
- pub trait VectorSl < Other > {
2668
- type Result ;
2669
- unsafe fn vec_sl ( self , b : Other ) -> Self :: Result ;
2670
- }
2671
-
2672
- macro_rules! impl_sl {
2673
- ( $fun: ident $ty: ident) => {
2666
+ macro_rules! impl_shift {
2667
+ ( $fun: ident $intr: ident $ty: ident) => {
2674
2668
#[ inline]
2675
2669
#[ target_feature( enable = "altivec" ) ]
2676
2670
#[ cfg_attr( test, assert_instr( $fun) ) ]
@@ -2681,17 +2675,35 @@ mod sealed {
2681
2675
<t_t_s!( $ty) >:: splat( mem:: size_of:: <$ty>( ) as $ty * $ty:: BITS as $ty) ,
2682
2676
) ;
2683
2677
2684
- transmute( simd_shl ( a, b) )
2678
+ transmute( $intr ( a, b) )
2685
2679
}
2686
2680
} ;
2687
2681
}
2688
2682
2689
- impl_sl ! { vslb u8 }
2690
- impl_sl ! { vslh u16 }
2691
- impl_sl ! { vslw u32 }
2683
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2684
+ pub trait VectorSl < Other > {
2685
+ type Result ;
2686
+ unsafe fn vec_sl ( self , b : Other ) -> Self :: Result ;
2687
+ }
2688
+
2689
+ impl_shift ! { vslb simd_shl u8 }
2690
+ impl_shift ! { vslh simd_shl u16 }
2691
+ impl_shift ! { vslw simd_shl u32 }
2692
2692
2693
2693
impl_vec_shift ! { [ VectorSl vec_sl] ( vslb, vslh, vslw) }
2694
2694
2695
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2696
+ pub trait VectorSr < Other > {
2697
+ type Result ;
2698
+ unsafe fn vec_sr ( self , b : Other ) -> Self :: Result ;
2699
+ }
2700
+
2701
+ impl_shift ! { vsrb simd_shr u8 }
2702
+ impl_shift ! { vsrh simd_shr u16 }
2703
+ impl_shift ! { vsrw simd_shr u32 }
2704
+
2705
+ impl_vec_shift ! { [ VectorSr vec_sr] ( vsrb, vsrh, vsrw) }
2706
+
2695
2707
#[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2696
2708
pub trait VectorSld {
2697
2709
unsafe fn vec_sld < const UIMM4 : i32 > ( self , b : Self ) -> Self ;
@@ -2963,6 +2975,17 @@ where
2963
2975
a. vec_sl ( b)
2964
2976
}
2965
2977
2978
+ /// Vector Shift Right
2979
+ #[ inline]
2980
+ #[ target_feature( enable = "altivec" ) ]
2981
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2982
+ pub unsafe fn vec_sr < T , U > ( a : T , b : U ) -> <T as sealed:: VectorSr < U > >:: Result
2983
+ where
2984
+ T : sealed:: VectorSr < U > ,
2985
+ {
2986
+ a. vec_sr ( b)
2987
+ }
2988
+
2966
2989
/// Vector Shift Left Double
2967
2990
///
2968
2991
/// ## Endian considerations
0 commit comments