@@ -347,6 +347,9 @@ extern "C" {
347
347
fn vsrah ( a : vector_signed_short , b : vector_unsigned_short ) -> vector_signed_short ;
348
348
#[ link_name = "llvm.ppc.altivec.sraw" ]
349
349
fn vsraw ( a : vector_signed_int , b : vector_unsigned_int ) -> vector_signed_int ;
350
+
351
+ #[ link_name = "llvm.ppc.altivec.srl" ]
352
+ fn vsr ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_int ;
350
353
}
351
354
352
355
macro_rules! s_t_l {
@@ -2855,7 +2858,7 @@ mod sealed {
2855
2858
impl_vec_sld ! { vector_bool_int, vector_signed_int, vector_unsigned_int }
2856
2859
impl_vec_sld ! { vector_float }
2857
2860
2858
- macro_rules! impl_vec_sll {
2861
+ macro_rules! impl_vec_shift_long {
2859
2862
( [ $Trait: ident $m: ident] ( $f: ident) ) => {
2860
2863
impl_vec_trait!{ [ $Trait $m] + $f ( vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_char }
2861
2864
impl_vec_trait!{ [ $Trait $m] + $f ( vector_signed_char, vector_unsigned_char) -> vector_signed_char }
@@ -2872,7 +2875,15 @@ mod sealed {
2872
2875
unsafe fn vec_sll ( self , b : Other ) -> Self :: Result ;
2873
2876
}
2874
2877
2875
- impl_vec_sll ! { [ VectorSll vec_sll] ( vsl) }
2878
+ impl_vec_shift_long ! { [ VectorSll vec_sll] ( vsl) }
2879
+
2880
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2881
+ pub trait VectorSrl < Other > {
2882
+ type Result ;
2883
+ unsafe fn vec_srl ( self , b : Other ) -> Self :: Result ;
2884
+ }
2885
+
2886
+ impl_vec_shift_long ! { [ VectorSrl vec_srl] ( vsr) }
2876
2887
2877
2888
macro_rules! impl_vec_slo {
2878
2889
( [ $Trait: ident $m: ident] ( $f: ident) ) => {
@@ -3069,6 +3080,21 @@ where
3069
3080
a. vec_sll ( b)
3070
3081
}
3071
3082
3083
+ /// Vector Shift Right Long
3084
+ ///
3085
+ /// ## Endian considerations
3086
+ /// This intrinsic is not endian-neutral, so uses of vec_srl in big-endian
3087
+ /// code must be rewritten for little-endian targets.
3088
+ #[ inline]
3089
+ #[ target_feature( enable = "altivec" ) ]
3090
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
3091
+ pub unsafe fn vec_srl < T , U > ( a : T , b : U ) -> <T as sealed:: VectorSrl < U > >:: Result
3092
+ where
3093
+ T : sealed:: VectorSrl < U > ,
3094
+ {
3095
+ a. vec_srl ( b)
3096
+ }
3097
+
3072
3098
/// Vector Shift Left by Octets
3073
3099
///
3074
3100
/// ## Endian considerations
0 commit comments