From 52d6397da7d75deb32efa6636839ed4bcc6b2fdc Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Sat, 22 Jul 2023 19:22:30 -0400 Subject: [PATCH] Flush subnormals in reduce tests --- crates/core_simd/tests/ops_macros.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/core_simd/tests/ops_macros.rs b/crates/core_simd/tests/ops_macros.rs index 1f5d9488ad0e..22265b8cf865 100644 --- a/crates/core_simd/tests/ops_macros.rs +++ b/crates/core_simd/tests/ops_macros.rs @@ -96,9 +96,11 @@ macro_rules! impl_common_integer_tests { test_helpers::test_lanes! { fn reduce_sum() { test_helpers::test_1(&|x| { + use test_helpers::subnormals::{flush, flush_in}; test_helpers::prop_assert_biteq! ( $vector::::from_array(x).reduce_sum(), x.iter().copied().fold(0 as $scalar, $scalar::wrapping_add), + flush(x.iter().copied().map(flush_in).fold(0 as $scalar, $scalar::wrapping_add)), ); Ok(()) }); @@ -106,9 +108,11 @@ macro_rules! impl_common_integer_tests { fn reduce_product() { test_helpers::test_1(&|x| { + use test_helpers::subnormals::{flush, flush_in}; test_helpers::prop_assert_biteq! ( $vector::::from_array(x).reduce_product(), x.iter().copied().fold(1 as $scalar, $scalar::wrapping_mul), + flush(x.iter().copied().map(flush_in).fold(1 as $scalar, $scalar::wrapping_mul)), ); Ok(()) });