File tree 1 file changed +25
-9
lines changed
1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -701,15 +701,18 @@ where
701
701
a. vec_add ( b)
702
702
}
703
703
704
- /// Vector permute.
705
- #[ inline]
706
- #[ target_feature( enable = "altivec" ) ]
707
- pub unsafe fn vec_perm < T > ( a : T , b : T , c : vector_unsigned_char ) -> T
708
- where
709
- T : sealed:: VectorPerm ,
710
- {
711
704
712
- if cfg ! ( target_endian = "little" ) {
705
+ /// Endian-biased intrinsics
706
+ #[ cfg( target_endian = "little" ) ]
707
+ mod endian {
708
+ use super :: * ;
709
+ /// Vector permute.
710
+ #[ inline]
711
+ #[ target_feature( enable = "altivec" ) ]
712
+ pub unsafe fn vec_perm < T > ( a : T , b : T , c : vector_unsigned_char ) -> T
713
+ where
714
+ T : sealed:: VectorPerm ,
715
+ {
713
716
// vperm has big-endian bias
714
717
//
715
718
// Xor the mask and flip the arguments
@@ -718,11 +721,24 @@ where
718
721
let c = simd_xor ( c, d) ;
719
722
720
723
b. vec_vperm ( a, c)
721
- } else {
724
+ }
725
+ }
726
+ #[ cfg( target_endian = "big" ) ]
727
+ mod endian {
728
+ use super :: * ;
729
+ /// Vector permute.
730
+ #[ inline]
731
+ #[ target_feature( enable = "altivec" ) ]
732
+ pub unsafe fn vec_perm < T > ( a : T , b : T , c : vector_unsigned_char ) -> T
733
+ where
734
+ T : sealed:: VectorPerm ,
735
+ {
722
736
a. vec_vperm ( b, c)
723
737
}
724
738
}
725
739
740
+ pub use self :: endian:: * ;
741
+
726
742
#[ cfg( test) ]
727
743
mod tests {
728
744
#[ cfg( target_arch = "powerpc" ) ]
You can’t perform that action at this time.
0 commit comments