From patchwork Thu Feb 23 08:50:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 60847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp207130wrd; Thu, 23 Feb 2023 00:52:29 -0800 (PST) X-Google-Smtp-Source: AK7set9LTAVBGkwzhd6oAXCy7+A+VlbBt9R9zjlvccgoXb5ETpW3CadP3NIMKfbzwVH8TlFAYZKp X-Received: by 2002:a17:907:2099:b0:8a9:fa2f:e440 with SMTP id pv25-20020a170907209900b008a9fa2fe440mr17368290ejb.55.1677142349070; Thu, 23 Feb 2023 00:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677142349; cv=none; d=google.com; s=arc-20160816; b=dEGJOCvuqbgMYgXV1N7sx3kc6zhAHcEI3GNPnxN1mOfPZPDBhNYilAQCn9Tc02q0dL BMnCqEx4wwcchDzJSvMTOTld6UnWEb7oUZizwG23ODmEe/PIUwoo7BRE5XL30EMNNa/A jEoB4L6I6uqJ3y1J/vtM+GoId89U/9e0OaJXCs92q5V0IqSK+vvcQXQRjpXQbo2TAvJd nuwWBHRo0oHkEtwwp8grby6ioX97vTO7wNoMOZ2C+0P5yfvbkB7QgHiyPnFG8zpxEGvQ YNTEAJAuIRaYNJHB65mRRy84kf6WwuQ32n6gCxHDJieXeYZoMdvjEkMIaqRcxZAJ+WQq dpdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :organization:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=s44/qYJy8Hdkp4mrrgRSETPzOYLwHKvxuo3ytACKjxo=; b=ab26b8/4E36P8nKfxTfCtBth5qR9So9wnXQhzGOezYXGyjiE3ZGpwxhJr0e19W8ff2 zD2K7+fl9gyuYxiHAmr/omLMoLv9TeUb8zrXIFxuF+xY1S3YjIM8Z474irw3MnMMcAFf D9As8+CYUt+FCWjwiOTwKlXJFI2iHUCdfEtAaSZg4/HRljm8iW69Ao0ztbBZtM9s7j1M BBcI2sSAzaYa1exvymkdf7arrtECwaJ4jYMCgizM2m2jqtcc+ZooAvdSdDtmarzazLCp tT2nKW4IQmi0AbgQL3JLFU6UKz8mLMJtKDbjHMZpKtMzkFGhs4x3RdOxv4R8iNwLr7BJ SYFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mCiRfzgt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 27-20020a170906015b00b008b17891459bsi25951777ejh.438.2023.02.23.00.52.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 00:52:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mCiRfzgt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ED7C73864806 for ; Thu, 23 Feb 2023 08:51:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED7C73864806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677142295; bh=s44/qYJy8Hdkp4mrrgRSETPzOYLwHKvxuo3ytACKjxo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mCiRfzgt8hAK5cNF3WXwxdox5/Xfo+n9Hkj7bysPRDlLrjv4F11f6976pvgwhDwZc CjNuF+rEl1g+PPtNEiijrO4GM1upNL1Ayy7kEVmVcRE5aDycu+eVl2v8q0t1QOnCrY XyL+YCxj4/aNTRiXcmcrnbjhFuWfDunzXlnezM0Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout2.gsi.de (lxmtout2.gsi.de [140.181.3.112]) by sourceware.org (Postfix) with ESMTPS id D85453858C83; Thu, 23 Feb 2023 08:50:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D85453858C83 Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id 967B22038F9E; Thu, 23 Feb 2023 09:50:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout2.gsi.de Received: from lxmtout2.gsi.de ([127.0.0.1]) by localhost (lxmtout2.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MqXo9-EwXakh; Thu, 23 Feb 2023 09:50:43 +0100 (CET) Received: from srvEX6.campus.gsi.de (unknown [10.10.4.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lxmtout2.gsi.de (Postfix) with ESMTPS id 77B622038F83; Thu, 23 Feb 2023 09:50:43 +0100 (CET) Received: from minbar.localnet (140.181.3.12) by srvEX6.campus.gsi.de (10.10.4.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Thu, 23 Feb 2023 09:50:43 +0100 To: , Subject: [PATCH 8/8] libstdc++: Test that integral simd reductions are precise Date: Thu, 23 Feb 2023 09:50:16 +0100 Message-ID: <2166927.NgBsaNRSFp@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research In-Reply-To: <2218250.iZASKD2KPV@minbar> References: <2218250.iZASKD2KPV@minbar> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvEX6.Campus.gsi.de (10.10.4.96) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Kretz via Gcc-patches From: Matthias Kretz Reply-To: Matthias Kretz Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758611215642224353?= X-GMAIL-MSGID: =?utf-8?q?1758611215642224353?= Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/reductions.cc: Introduce max_distance as the type-dependent max error. --- libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc index 0c4c79feb20..fed164314d7 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); }); }