From: Matthias Kretz Date: Tue, 21 Feb 2023 09:43:13 +0000 (+0100) Subject: libstdc++: Test that integral simd reductions are precise X-Git-Tag: upstream/13.1.0~942 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8fda668e0919af9ceda9435f02a1708b375b2913;p=platform%2Fupstream%2Fgcc.git libstdc++: Test that integral simd reductions are precise Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/reductions.cc: Introduce max_distance as the type-dependent max error. --- diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 0c4c79f..fed1643 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc @@ -112,6 +112,7 @@ template T acc = x[0]; for (size_t i = 1; i < V::size(); ++i) acc += x[i]; - ULP_COMPARE(reduce(x), acc, V::size() / 2).on_failure("x = ", x); + const T max_distance = std::is_integral_v ? 0 : V::size() / 2; + ULP_COMPARE(reduce(x), acc, max_distance).on_failure("x = ", x); }); }