about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2023-07-22 19:22:30 -0400
committerCaleb Zulawski <caleb.zulawski@gmail.com>2023-07-22 19:22:30 -0400
commit52d6397da7d75deb32efa6636839ed4bcc6b2fdc (patch)
tree6da8d258874fbb073827d86796b0c032f8923301
parentca12492584e77fbb2d982942c9cf2843b8f99487 (diff)
downloadrust-52d6397da7d75deb32efa6636839ed4bcc6b2fdc.tar.gz
rust-52d6397da7d75deb32efa6636839ed4bcc6b2fdc.zip
Flush subnormals in reduce tests
-rw-r--r--crates/core_simd/tests/ops_macros.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/core_simd/tests/ops_macros.rs b/crates/core_simd/tests/ops_macros.rs
index 1f5d9488ad0..22265b8cf86 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<const LANES: usize>() {
                 test_helpers::test_1(&|x| {
+                    use test_helpers::subnormals::{flush, flush_in};
                     test_helpers::prop_assert_biteq! (
                         $vector::<LANES>::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<const LANES: usize>() {
                 test_helpers::test_1(&|x| {
+                    use test_helpers::subnormals::{flush, flush_in};
                     test_helpers::prop_assert_biteq! (
                         $vector::<LANES>::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(())
                 });