@@ -230,6 +230,11 @@ unsafe extern "unadjusted" {
230230 #[ link_name = "llvm.umin.v4i32" ]
231231 fn vminuw ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
232232
233+ #[ link_name = "llvm.ppc.altivec.vmaxfp" ]
234+ fn vmaxfp ( a : vector_float , b : vector_float ) -> vector_float ;
235+ #[ link_name = "llvm.ppc.altivec.vminfp" ]
236+ fn vminfp ( a : vector_float , b : vector_float ) -> vector_float ;
237+
233238 #[ link_name = "llvm.ppc.altivec.vsubsbs" ]
234239 fn vsubsbs ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char ;
235240 #[ link_name = "llvm.ppc.altivec.vsubshs" ]
@@ -411,7 +416,7 @@ unsafe extern "unadjusted" {
411416}
412417
413418#[ macro_use]
414- mod sealed {
419+ pub ( crate ) mod sealed {
415420 use super :: * ;
416421
417422 #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
@@ -1657,13 +1662,16 @@ mod sealed {
16571662 test_impl ! { vec_vminuh ( a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vminuh, vminuh] }
16581663 test_impl ! { vec_vminuw ( a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vminuw, vminuw] }
16591664
1665+ test_impl ! { vec_vminfp ( a: vector_float, b: vector_float) -> vector_float [ vminfp, vminfp / xvminsp] }
1666+
16601667 #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
16611668 pub trait VectorMin < Other > {
16621669 type Result ;
16631670 unsafe fn vec_min ( self , b : Other ) -> Self :: Result ;
16641671 }
16651672
16661673 impl_vec_trait ! { [ VectorMin vec_min] ~( vminub, vminsb, vminuh, vminsh, vminuw, vminsw) }
1674+ impl_vec_trait ! { [ VectorMin vec_min] vec_vminfp( vector_float, vector_float) -> vector_float }
16671675
16681676 test_impl ! { vec_vmaxsb ( a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vmaxsb, vmaxsb] }
16691677 test_impl ! { vec_vmaxsh ( a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vmaxsh, vmaxsh] }
@@ -1673,13 +1681,16 @@ mod sealed {
16731681 test_impl ! { vec_vmaxuh ( a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vmaxuh, vmaxuh] }
16741682 test_impl ! { vec_vmaxuw ( a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vmaxuw, vmaxuw] }
16751683
1684+ test_impl ! { vec_vmaxfp ( a: vector_float, b: vector_float) -> vector_float [ vmaxfp, vmaxfp / xvmaxsp] }
1685+
16761686 #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
16771687 pub trait VectorMax < Other > {
16781688 type Result ;
16791689 unsafe fn vec_max ( self , b : Other ) -> Self :: Result ;
16801690 }
16811691
16821692 impl_vec_trait ! { [ VectorMax vec_max] ~( vmaxub, vmaxsb, vmaxuh, vmaxsh, vmaxuw, vmaxsw) }
1693+ impl_vec_trait ! { [ VectorMax vec_max] vec_vmaxfp( vector_float, vector_float) -> vector_float }
16831694
16841695 #[ inline]
16851696 #[ target_feature( enable = "altivec" ) ]
@@ -4685,7 +4696,7 @@ mod endian {
46854696pub use self :: endian:: * ;
46864697
46874698#[ cfg( test) ]
4688- mod tests {
4699+ pub ( crate ) mod tests {
46894700 use super :: * ;
46904701
46914702 use std:: mem:: transmute;
@@ -6118,20 +6129,6 @@ mod tests {
61186129 [ 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 ] ,
61196130 [ 0 , 0 , 1 , 2 , 0 , 0 , 1 , 2 , 0 , 0 , 1 , 2 , 0 , 0 , 1 , 2 ] }
61206131
6121- macro_rules! test_vec_min {
6122- { $name: ident, $ty: ident, [ $( $a: expr) ,+] , [ $( $b: expr) ,+] , [ $( $d: expr) ,+] } => {
6123- #[ simd_test( enable = "altivec" ) ]
6124- fn $name( ) {
6125- let a: s_t_l!( $ty) = $ty:: new( $( $a) ,+) . into( ) ;
6126- let b: s_t_l!( $ty) = $ty:: new( $( $b) ,+) . into( ) ;
6127-
6128- let d = $ty:: new( $( $d) ,+) ;
6129- let r = $ty:: from( unsafe { vec_min( a, b) } ) ;
6130- assert_eq!( d, r) ;
6131- }
6132- }
6133- }
6134-
61356132 test_vec_min ! { test_vec_min_i32x4, i32x4,
61366133 [ -1 , 0 , 1 , 2 ] ,
61376134 [ 2 , 1 , -1 , -2 ] ,
@@ -6162,19 +6159,10 @@ mod tests {
61626159 [ 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 ] ,
61636160 [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] }
61646161
6165- macro_rules! test_vec_max {
6166- { $name: ident, $ty: ident, [ $( $a: expr) ,+] , [ $( $b: expr) ,+] , [ $( $d: expr) ,+] } => {
6167- #[ simd_test( enable = "altivec" ) ]
6168- fn $name( ) {
6169- let a: s_t_l!( $ty) = $ty:: new( $( $a) ,+) . into( ) ;
6170- let b: s_t_l!( $ty) = $ty:: new( $( $b) ,+) . into( ) ;
6171-
6172- let d = $ty:: new( $( $d) ,+) ;
6173- let r = $ty:: from( unsafe { vec_max( a, b) } ) ;
6174- assert_eq!( d, r) ;
6175- }
6176- }
6177- }
6162+ test_vec_min ! { test_vec_min_f32x4, f32x4,
6163+ [ -1.0 , 0.0 , 1.0 , 2.0 ] ,
6164+ [ 2.0 , 1.0 , -1.0 , -2.0 ] ,
6165+ [ -1.0 , 0.0 , -1.0 , -2.0 ] }
61786166
61796167 test_vec_max ! { test_vec_max_i32x4, i32x4,
61806168 [ -1 , 0 , 1 , 2 ] ,
@@ -6206,6 +6194,11 @@ mod tests {
62066194 [ 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 , 2 , 1 , 0 , 0 ] ,
62076195 [ 2 , 1 , 1 , 2 , 2 , 1 , 1 , 2 , 2 , 1 , 1 , 2 , 2 , 1 , 1 , 2 ] }
62086196
6197+ test_vec_max ! { test_vec_max_f32x4, f32x4,
6198+ [ -1.0 , 0.0 , 1.0 , 2.0 ] ,
6199+ [ 2.0 , 1.0 , -1.0 , -2.0 ] ,
6200+ [ 2.0 , 1.0 , 1.0 , 2.0 ] }
6201+
62096202 macro_rules! test_vec_perm {
62106203 { $name: ident,
62116204 $shorttype: ident, $longtype: ident,
0 commit comments