@@ -22,27 +22,27 @@ fn simd_ops_f32() {
2222 assert_eq ! ( a. lanes_ge( f32x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
2323 assert_eq ! ( a. lanes_gt( f32x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
2424
25- assert_eq ! ( a. horizontal_sum ( ) , 40.0 ) ;
26- assert_eq ! ( b. horizontal_sum ( ) , 2.0 ) ;
27- assert_eq ! ( a. horizontal_product ( ) , 100.0 * 100.0 ) ;
28- assert_eq ! ( b. horizontal_product ( ) , -24.0 ) ;
29- assert_eq ! ( a. horizontal_max ( ) , 10.0 ) ;
30- assert_eq ! ( b. horizontal_max ( ) , 3.0 ) ;
31- assert_eq ! ( a. horizontal_min ( ) , 10.0 ) ;
32- assert_eq ! ( b. horizontal_min ( ) , -4.0 ) ;
25+ assert_eq ! ( a. reduce_sum ( ) , 40.0 ) ;
26+ assert_eq ! ( b. reduce_sum ( ) , 2.0 ) ;
27+ assert_eq ! ( a. reduce_product ( ) , 100.0 * 100.0 ) ;
28+ assert_eq ! ( b. reduce_product ( ) , -24.0 ) ;
29+ assert_eq ! ( a. reduce_max ( ) , 10.0 ) ;
30+ assert_eq ! ( b. reduce_max ( ) , 3.0 ) ;
31+ assert_eq ! ( a. reduce_min ( ) , 10.0 ) ;
32+ assert_eq ! ( b. reduce_min ( ) , -4.0 ) ;
3333
3434 assert_eq ! (
3535 f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . max( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) ) ,
3636 f32x2:: from_array( [ 0.0 , 0.0 ] )
3737 ) ;
38- assert_eq ! ( f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . horizontal_max ( ) , 0.0 ) ;
39- assert_eq ! ( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) . horizontal_max ( ) , 0.0 ) ;
38+ assert_eq ! ( f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . reduce_max ( ) , 0.0 ) ;
39+ assert_eq ! ( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) . reduce_max ( ) , 0.0 ) ;
4040 assert_eq ! (
4141 f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . min( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) ) ,
4242 f32x2:: from_array( [ 0.0 , 0.0 ] )
4343 ) ;
44- assert_eq ! ( f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . horizontal_min ( ) , 0.0 ) ;
45- assert_eq ! ( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) . horizontal_min ( ) , 0.0 ) ;
44+ assert_eq ! ( f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . reduce_min ( ) , 0.0 ) ;
45+ assert_eq ! ( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) . reduce_min ( ) , 0.0 ) ;
4646}
4747
4848fn simd_ops_f64 ( ) {
@@ -66,27 +66,27 @@ fn simd_ops_f64() {
6666 assert_eq ! ( a. lanes_ge( f64x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
6767 assert_eq ! ( a. lanes_gt( f64x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
6868
69- assert_eq ! ( a. horizontal_sum ( ) , 40.0 ) ;
70- assert_eq ! ( b. horizontal_sum ( ) , 2.0 ) ;
71- assert_eq ! ( a. horizontal_product ( ) , 100.0 * 100.0 ) ;
72- assert_eq ! ( b. horizontal_product ( ) , -24.0 ) ;
73- assert_eq ! ( a. horizontal_max ( ) , 10.0 ) ;
74- assert_eq ! ( b. horizontal_max ( ) , 3.0 ) ;
75- assert_eq ! ( a. horizontal_min ( ) , 10.0 ) ;
76- assert_eq ! ( b. horizontal_min ( ) , -4.0 ) ;
69+ assert_eq ! ( a. reduce_sum ( ) , 40.0 ) ;
70+ assert_eq ! ( b. reduce_sum ( ) , 2.0 ) ;
71+ assert_eq ! ( a. reduce_product ( ) , 100.0 * 100.0 ) ;
72+ assert_eq ! ( b. reduce_product ( ) , -24.0 ) ;
73+ assert_eq ! ( a. reduce_max ( ) , 10.0 ) ;
74+ assert_eq ! ( b. reduce_max ( ) , 3.0 ) ;
75+ assert_eq ! ( a. reduce_min ( ) , 10.0 ) ;
76+ assert_eq ! ( b. reduce_min ( ) , -4.0 ) ;
7777
7878 assert_eq ! (
7979 f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . max( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) ) ,
8080 f64x2:: from_array( [ 0.0 , 0.0 ] )
8181 ) ;
82- assert_eq ! ( f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . horizontal_max ( ) , 0.0 ) ;
83- assert_eq ! ( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) . horizontal_max ( ) , 0.0 ) ;
82+ assert_eq ! ( f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . reduce_max ( ) , 0.0 ) ;
83+ assert_eq ! ( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) . reduce_max ( ) , 0.0 ) ;
8484 assert_eq ! (
8585 f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . min( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) ) ,
8686 f64x2:: from_array( [ 0.0 , 0.0 ] )
8787 ) ;
88- assert_eq ! ( f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . horizontal_min ( ) , 0.0 ) ;
89- assert_eq ! ( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) . horizontal_min ( ) , 0.0 ) ;
88+ assert_eq ! ( f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . reduce_min ( ) , 0.0 ) ;
89+ assert_eq ! ( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) . reduce_min ( ) , 0.0 ) ;
9090}
9191
9292fn simd_ops_i32 ( ) {
@@ -137,21 +137,21 @@ fn simd_ops_i32() {
137137 assert_eq ! ( a. lanes_ge( i32x4:: splat( 5 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
138138 assert_eq ! ( a. lanes_gt( i32x4:: splat( 5 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
139139
140- assert_eq ! ( a. horizontal_sum ( ) , 40 ) ;
141- assert_eq ! ( b. horizontal_sum ( ) , 2 ) ;
142- assert_eq ! ( a. horizontal_product ( ) , 100 * 100 ) ;
143- assert_eq ! ( b. horizontal_product ( ) , -24 ) ;
144- assert_eq ! ( a. horizontal_max ( ) , 10 ) ;
145- assert_eq ! ( b. horizontal_max ( ) , 3 ) ;
146- assert_eq ! ( a. horizontal_min ( ) , 10 ) ;
147- assert_eq ! ( b. horizontal_min ( ) , -4 ) ;
140+ assert_eq ! ( a. reduce_sum ( ) , 40 ) ;
141+ assert_eq ! ( b. reduce_sum ( ) , 2 ) ;
142+ assert_eq ! ( a. reduce_product ( ) , 100 * 100 ) ;
143+ assert_eq ! ( b. reduce_product ( ) , -24 ) ;
144+ assert_eq ! ( a. reduce_max ( ) , 10 ) ;
145+ assert_eq ! ( b. reduce_max ( ) , 3 ) ;
146+ assert_eq ! ( a. reduce_min ( ) , 10 ) ;
147+ assert_eq ! ( b. reduce_min ( ) , -4 ) ;
148148
149- assert_eq ! ( a. horizontal_and ( ) , 10 ) ;
150- assert_eq ! ( b. horizontal_and ( ) , 0 ) ;
151- assert_eq ! ( a. horizontal_or ( ) , 10 ) ;
152- assert_eq ! ( b. horizontal_or ( ) , -1 ) ;
153- assert_eq ! ( a. horizontal_xor ( ) , 0 ) ;
154- assert_eq ! ( b. horizontal_xor ( ) , -4 ) ;
149+ assert_eq ! ( a. reduce_and ( ) , 10 ) ;
150+ assert_eq ! ( b. reduce_and ( ) , 0 ) ;
151+ assert_eq ! ( a. reduce_or ( ) , 10 ) ;
152+ assert_eq ! ( b. reduce_or ( ) , -1 ) ;
153+ assert_eq ! ( a. reduce_xor ( ) , 0 ) ;
154+ assert_eq ! ( b. reduce_xor ( ) , -4 ) ;
155155}
156156
157157fn simd_mask ( ) {
0 commit comments