@@ -336,6 +336,35 @@ pub fn test_binary_elementwise_flush_subnormals<
336
336
} ) ;
337
337
}
338
338
339
+ /// Test a unary vector function against a unary scalar function, applied elementwise.
340
+ #[ inline( never) ]
341
+ pub fn test_binary_mask_elementwise < Scalar1 , Scalar2 , Vector1 , Vector2 , Mask , const LANES : usize > (
342
+ fv : & dyn Fn ( Vector1 , Vector2 ) -> Mask ,
343
+ fs : & dyn Fn ( Scalar1 , Scalar2 ) -> bool ,
344
+ check : & dyn Fn ( [ Scalar1 ; LANES ] , [ Scalar2 ; LANES ] ) -> bool ,
345
+ ) where
346
+ Scalar1 : Copy + core:: fmt:: Debug + DefaultStrategy ,
347
+ Scalar2 : Copy + core:: fmt:: Debug + DefaultStrategy ,
348
+ Vector1 : Into < [ Scalar1 ; LANES ] > + From < [ Scalar1 ; LANES ] > + Copy ,
349
+ Vector2 : Into < [ Scalar2 ; LANES ] > + From < [ Scalar2 ; LANES ] > + Copy ,
350
+ Mask : Into < [ bool ; LANES ] > + From < [ bool ; LANES ] > + Copy ,
351
+ {
352
+ test_2 ( & |x : [ Scalar1 ; LANES ] , y : [ Scalar2 ; LANES ] | {
353
+ proptest:: prop_assume!( check( x, y) ) ;
354
+ let result_v: [ bool ; LANES ] = fv ( x. into ( ) , y. into ( ) ) . into ( ) ;
355
+ let result_s: [ bool ; LANES ] = x
356
+ . iter ( )
357
+ . copied ( )
358
+ . zip ( y. iter ( ) . copied ( ) )
359
+ . map ( |( x, y) | fs ( x, y) )
360
+ . collect :: < Vec < _ > > ( )
361
+ . try_into ( )
362
+ . unwrap ( ) ;
363
+ crate :: prop_assert_biteq!( result_v, result_s) ;
364
+ Ok ( ( ) )
365
+ } ) ;
366
+ }
367
+
339
368
/// Test a binary vector-scalar function against a binary scalar function, applied elementwise.
340
369
#[ inline( never) ]
341
370
pub fn test_binary_scalar_rhs_elementwise <
0 commit comments