From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id A0B83383B798; Thu, 25 May 2023 07:04:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0B83383B798 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684998271; bh=k9+Y/dFOZaWrSw6VcJ2sH12sOYJgu+s1o2uSPFx5VKw=; h=From:To:Subject:Date:From; b=M+cdFMVwll+09IDmAUUpIxhX71y9CYHbEsYTsIVuoUclbW843d+eGN6WUaTDPSLO/ E7ljbSdwrM7orW3q/zdvAgx/ilGgLJ1I6s/qkX3h/X7zNpvmhfStYBT8QAEL5tn9eT 0SpFl+MIHlkBg31L+W84tQp5Fu4ogWjm6v8txu80= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Matthias Kretz To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10813] libstdc++: Test that integral simd reductions are precise X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: a2a953d11e80ac4b351bbaa4a8fa4e6b76de317c X-Git-Newrev: 1c588b53920227fe9f0388267eeb81bc2eb002f3 Message-Id: <20230525070431.A0B83383B798@sourceware.org> Date: Thu, 25 May 2023 07:04:31 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1c588b53920227fe9f0388267eeb81bc2eb002f3 commit r11-10813-g1c588b53920227fe9f0388267eeb81bc2eb002f3 Author: Matthias Kretz Date: Tue Feb 21 10:43:13 2023 +0100 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. (cherry picked from commit 8fda668e0919af9ceda9435f02a1708b375b2913) Diff: --- libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 1f20961825b..07ab50a2312 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc @@ -114,6 +114,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); }); }