File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -516,7 +516,7 @@ macro_rules! impl_float_tests {
516516
517517 fn simd_clamp<const LANES : usize >( ) {
518518 test_helpers:: test_3( & |value: [ Scalar ; LANES ] , mut min: [ Scalar ; LANES ] , mut max: [ Scalar ; LANES ] | {
519- use test_helpers:: subnormals:: FlushSubnormals ;
519+ use test_helpers:: subnormals:: flush_in ;
520520 for ( min, max) in min. iter_mut( ) . zip( max. iter_mut( ) ) {
521521 if max < min {
522522 core:: mem:: swap( min, max) ;
@@ -535,13 +535,14 @@ macro_rules! impl_float_tests {
535535 }
536536 let mut result_scalar_flush = [ Scalar :: default ( ) ; LANES ] ;
537537 for i in 0 ..LANES {
538- result_scalar_flush [ i ] = value[ i] ;
539- if FlushSubnormals :: flush ( value[ i ] ) < FlushSubnormals :: flush ( min[ i] ) {
540- result_scalar_flush [ i ] = min[ i] ;
538+ let mut value = flush_in ( value[ i] ) ;
539+ if value < flush_in ( min[ i] ) {
540+ value = min[ i] ;
541541 }
542- if FlushSubnormals :: flush ( value[ i ] ) > FlushSubnormals :: flush ( max[ i] ) {
543- result_scalar_flush [ i ] = max[ i] ;
542+ if value > flush_in ( max[ i] ) {
543+ value = max[ i] ;
544544 }
545+ result_scalar_flush[ i] = value
545546 }
546547 let result_vector = Vector :: from_array( value) . simd_clamp( min. into( ) , max. into( ) ) . to_array( ) ;
547548 test_helpers:: prop_assert_biteq!( result_vector, result_scalar, result_scalar_flush) ;
You can’t perform that action at this time.
0 commit comments