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 {
516
516
517
517
fn simd_clamp<const LANES : usize >( ) {
518
518
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 ;
520
520
for ( min, max) in min. iter_mut( ) . zip( max. iter_mut( ) ) {
521
521
if max < min {
522
522
core:: mem:: swap( min, max) ;
@@ -535,13 +535,14 @@ macro_rules! impl_float_tests {
535
535
}
536
536
let mut result_scalar_flush = [ Scalar :: default ( ) ; LANES ] ;
537
537
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] ;
541
541
}
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] ;
544
544
}
545
+ result_scalar_flush[ i] = value
545
546
}
546
547
let result_vector = Vector :: from_array( value) . simd_clamp( min. into( ) , max. into( ) ) . to_array( ) ;
547
548
test_helpers:: prop_assert_biteq!( result_vector, result_scalar, result_scalar_flush) ;
You can’t perform that action at this time.
0 commit comments