@@ -22,27 +22,27 @@ fn simd_ops_f32() {
22
22
assert_eq ! ( a. lanes_ge( f32x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
23
23
assert_eq ! ( a. lanes_gt( f32x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
24
24
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 ) ;
33
33
34
34
assert_eq ! (
35
35
f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . max( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) ) ,
36
36
f32x2:: from_array( [ 0.0 , 0.0 ] )
37
37
) ;
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 ) ;
40
40
assert_eq ! (
41
41
f32x2:: from_array( [ 0.0 , f32 :: NAN ] ) . min( f32x2:: from_array( [ f32 :: NAN , 0.0 ] ) ) ,
42
42
f32x2:: from_array( [ 0.0 , 0.0 ] )
43
43
) ;
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 ) ;
46
46
}
47
47
48
48
fn simd_ops_f64 ( ) {
@@ -66,27 +66,27 @@ fn simd_ops_f64() {
66
66
assert_eq ! ( a. lanes_ge( f64x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
67
67
assert_eq ! ( a. lanes_gt( f64x4:: splat( 5.0 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
68
68
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 ) ;
77
77
78
78
assert_eq ! (
79
79
f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . max( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) ) ,
80
80
f64x2:: from_array( [ 0.0 , 0.0 ] )
81
81
) ;
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 ) ;
84
84
assert_eq ! (
85
85
f64x2:: from_array( [ 0.0 , f64 :: NAN ] ) . min( f64x2:: from_array( [ f64 :: NAN , 0.0 ] ) ) ,
86
86
f64x2:: from_array( [ 0.0 , 0.0 ] )
87
87
) ;
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 ) ;
90
90
}
91
91
92
92
fn simd_ops_i32 ( ) {
@@ -137,21 +137,21 @@ fn simd_ops_i32() {
137
137
assert_eq ! ( a. lanes_ge( i32x4:: splat( 5 ) * b) , Mask :: from_array( [ true , true , false , true ] ) ) ;
138
138
assert_eq ! ( a. lanes_gt( i32x4:: splat( 5 ) * b) , Mask :: from_array( [ true , false , false , true ] ) ) ;
139
139
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 ) ;
148
148
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 ) ;
155
155
}
156
156
157
157
fn simd_mask ( ) {
0 commit comments