@@ -272,6 +272,8 @@ extern "C" {
272
272
fn vcmpgefp_p ( cr : i32 , a : vector_float , b : vector_float ) -> i32 ;
273
273
#[ link_name = "llvm.ppc.altivec.vcmpgtfp.p" ]
274
274
fn vcmpgtfp_p ( cr : i32 , a : vector_float , b : vector_float ) -> i32 ;
275
+ #[ link_name = "llvm.ppc.altivec.vcmpbfp.p" ]
276
+ fn vcmpbfp_p ( cr : i32 , a : vector_float , b : vector_float ) -> i32 ;
275
277
}
276
278
277
279
macro_rules! s_t_l {
@@ -2182,6 +2184,14 @@ where
2182
2184
a. vec_any_gt ( b)
2183
2185
}
2184
2186
2187
+ /// Vector All In
2188
+ #[ inline]
2189
+ #[ target_feature( enable = "altivec" ) ]
2190
+ #[ cfg_attr( test, assert_instr( "vcmpbfp." ) ) ]
2191
+ pub unsafe fn vec_all_in ( a : vector_float , b : vector_float ) -> bool {
2192
+ vcmpbfp_p ( 0 , a, b) != 0
2193
+ }
2194
+
2185
2195
#[ cfg( target_endian = "big" ) ]
2186
2196
mod endian {
2187
2197
use super :: * ;
@@ -2836,6 +2846,18 @@ mod tests {
2836
2846
true
2837
2847
}
2838
2848
2849
+ test_vec_2 ! { test_vec_all_in_true, vec_all_in, f32x4 -> bool ,
2850
+ [ 0.0 , -0.1 , 0.0 , 0.0 ] ,
2851
+ [ 0.1 , 0.2 , 0.0 , 0.0 ] ,
2852
+ true
2853
+ }
2854
+
2855
+ test_vec_2 ! { test_vec_all_in_false, vec_all_in, f32x4 -> bool ,
2856
+ [ 0.5 , 0.4 , -0.5 , 0.8 ] ,
2857
+ [ 0.1 , 0.4 , -0.5 , 0.8 ] ,
2858
+ false
2859
+ }
2860
+
2839
2861
#[ simd_test( enable = "altivec" ) ]
2840
2862
unsafe fn test_vec_cmpb ( ) {
2841
2863
let a: vector_float = transmute ( f32x4:: new ( 0.1 , 0.5 , 0.6 , 0.9 ) ) ;
0 commit comments