diff --git a/crates/core_simd/tests/ops_macros.rs b/crates/core_simd/tests/ops_macros.rs index 22265b8cf86..7e705892b53 100644 --- a/crates/core_simd/tests/ops_macros.rs +++ b/crates/core_simd/tests/ops_macros.rs @@ -516,7 +516,7 @@ fn simd_max() { fn simd_clamp() { test_helpers::test_3(&|value: [Scalar; LANES], mut min: [Scalar; LANES], mut max: [Scalar; LANES]| { - use test_helpers::subnormals::FlushSubnormals; + use test_helpers::subnormals::flush_in; for (min, max) in min.iter_mut().zip(max.iter_mut()) { if max < min { core::mem::swap(min, max); @@ -535,13 +535,14 @@ fn simd_clamp() { } let mut result_scalar_flush = [Scalar::default(); LANES]; for i in 0..LANES { - result_scalar_flush[i] = value[i]; - if FlushSubnormals::flush(value[i]) < FlushSubnormals::flush(min[i]) { - result_scalar_flush[i] = min[i]; + let mut value = flush_in(value[i]); + if value < flush_in(min[i]) { + value = min[i]; } - if FlushSubnormals::flush(value[i]) > FlushSubnormals::flush(max[i]) { - result_scalar_flush[i] = max[i]; + if value > flush_in(max[i]) { + value = max[i]; } + result_scalar_flush[i] = value } let result_vector = Vector::from_array(value).simd_clamp(min.into(), max.into()).to_array(); test_helpers::prop_assert_biteq!(result_vector, result_scalar, result_scalar_flush);