File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -59,23 +59,13 @@ macro_rules! impl_float_reductions {
59
59
/// Produces the sum of the lanes of the vector.
60
60
#[ inline]
61
61
pub fn sum( self ) -> $scalar {
62
- // f32 SIMD sum is inaccurate on i586
63
- if cfg!( all( target_arch = "x86" , not( target_feature = "sse2" ) ) ) && core:: mem:: size_of:: <$scalar>( ) == 4 {
64
- self . as_slice( ) . iter( ) . sum( )
65
- } else {
66
- unsafe { crate :: intrinsics:: simd_reduce_add_ordered( self , 0. ) }
67
- }
62
+ unsafe { crate :: intrinsics:: simd_reduce_add_ordered( self , 0. ) }
68
63
}
69
64
70
65
/// Produces the sum of the lanes of the vector.
71
66
#[ inline]
72
67
pub fn product( self ) -> $scalar {
73
- // f32 SIMD product is inaccurate on i586
74
- if cfg!( all( target_arch = "x86" , not( target_feature = "sse2" ) ) ) && core:: mem:: size_of:: <$scalar>( ) == 4 {
75
- self . as_slice( ) . iter( ) . product( )
76
- } else {
77
- unsafe { crate :: intrinsics:: simd_reduce_mul_ordered( self , 1. ) }
78
- }
68
+ unsafe { crate :: intrinsics:: simd_reduce_mul_ordered( self , 1. ) }
79
69
}
80
70
81
71
/// Returns the maximum lane in the vector.
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ macro_rules! impl_float_tests {
483
483
test_helpers:: test_1( & |x| {
484
484
test_helpers:: prop_assert_biteq! (
485
485
Vector :: <LANES >:: from_array( x) . sum( ) ,
486
- x. iter( ) . copied ( ) . fold ( 0 as Scalar , < Scalar as core :: ops :: Add > :: add ) ,
486
+ x. iter( ) . sum ( ) ,
487
487
) ;
488
488
Ok ( ( ) )
489
489
} ) ;
@@ -493,7 +493,7 @@ macro_rules! impl_float_tests {
493
493
test_helpers:: test_1( & |x| {
494
494
test_helpers:: prop_assert_biteq! (
495
495
Vector :: <LANES >:: from_array( x) . product( ) ,
496
- x. iter( ) . copied ( ) . fold ( 1. as Scalar , < Scalar as core :: ops :: Mul > :: mul ) ,
496
+ x. iter( ) . product ( ) ,
497
497
) ;
498
498
Ok ( ( ) )
499
499
} ) ;
You can’t perform that action at this time.
0 commit comments