@@ -350,6 +350,8 @@ extern "C" {
350
350
351
351
#[ link_name = "llvm.ppc.altivec.srl" ]
352
352
fn vsr ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_int ;
353
+ #[ link_name = "llvm.ppc.altivec.sro" ]
354
+ fn vsro ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_int ;
353
355
}
354
356
355
357
macro_rules! s_t_l {
@@ -2885,7 +2887,7 @@ mod sealed {
2885
2887
2886
2888
impl_vec_shift_long ! { [ VectorSrl vec_srl] ( vsr) }
2887
2889
2888
- macro_rules! impl_vec_slo {
2890
+ macro_rules! impl_vec_shift_octect {
2889
2891
( [ $Trait: ident $m: ident] ( $f: ident) ) => {
2890
2892
impl_vec_trait!{ [ $Trait $m] + $f ( vector_unsigned_char, vector_signed_char) -> vector_unsigned_char }
2891
2893
impl_vec_trait!{ [ $Trait $m] + $f ( vector_signed_char, vector_signed_char) -> vector_signed_char }
@@ -2910,7 +2912,15 @@ mod sealed {
2910
2912
unsafe fn vec_slo ( self , b : Other ) -> Self :: Result ;
2911
2913
}
2912
2914
2913
- impl_vec_slo ! { [ VectorSlo vec_slo] ( vslo) }
2915
+ impl_vec_shift_octect ! { [ VectorSlo vec_slo] ( vslo) }
2916
+
2917
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2918
+ pub trait VectorSro < Other > {
2919
+ type Result ;
2920
+ unsafe fn vec_sro ( self , b : Other ) -> Self :: Result ;
2921
+ }
2922
+
2923
+ impl_vec_shift_octect ! { [ VectorSro vec_sro] ( vsro) }
2914
2924
}
2915
2925
2916
2926
/// Vector Merge Low
@@ -3111,6 +3121,22 @@ where
3111
3121
a. vec_slo ( b)
3112
3122
}
3113
3123
3124
+ /// Vector Shift Right by Octets
3125
+ ///
3126
+ /// ## Endian considerations
3127
+ /// This intrinsic is not endian-neutral, so uses of vec_sro in big-endian code must be rewritten
3128
+ /// for little-endian targets. The shift count is in element 15 of b for big-endian, but in element
3129
+ /// 0 of b for little-endian.
3130
+ #[ inline]
3131
+ #[ target_feature( enable = "altivec" ) ]
3132
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
3133
+ pub unsafe fn vec_sro < T , U > ( a : T , b : U ) -> <T as sealed:: VectorSro < U > >:: Result
3134
+ where
3135
+ T : sealed:: VectorSro < U > ,
3136
+ {
3137
+ a. vec_sro ( b)
3138
+ }
3139
+
3114
3140
/// Vector Load Indexed.
3115
3141
#[ inline]
3116
3142
#[ target_feature( enable = "altivec" ) ]
0 commit comments