From patchwork Wed Feb 15 20:48:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 5475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp410056wrn; Wed, 15 Feb 2023 12:49:38 -0800 (PST) X-Google-Smtp-Source: AK7set84bQvbwY4MEDv1QD+pgkbazQXcZx8wn2hMJplJjDJL7o+udsPRcYw7gN79whi/UIUGayLg X-Received: by 2002:a17:906:2659:b0:886:221b:44e5 with SMTP id i25-20020a170906265900b00886221b44e5mr3223999ejc.62.1676494178011; Wed, 15 Feb 2023 12:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676494177; cv=none; d=google.com; s=arc-20160816; b=NuKw7uGCGF5royUNLPwzT42lbcdnn08Z8dsQ1uW0N8AXODG1UZBYZL2TN++zwsIZRv pwDa6sNXxk7qyW8cN7AWUW/0wfKjyX1gVc9i2a6Yx57+6DET8VxBvbSWNJJskCLjEzEz wxZ/2GGrl8vTXaz0HxnJ5Zg6SiUsnJkxPeNEh04p1mUwe+wF+VfaIx0sGQMaYKVx6y3Y 9j5LsUgK8/3kEemFdkmA8cVeuaDi7k0WbdwiFLbdQ3g8FirYvHl2VgiIv1MWwgdXj0Ij PnRsGHoLVN4EnzqX9HZ20ZTD8W0f5zB5cj1owq+f2QJwvkXIpDGqp88CfZL+ZAaO8auc AbbQ== 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:organization:message-id:date :subject:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=1m+6ulG4uawXU7J8foCJx63Xp1n98s0UCd00qib8UXw=; b=hbc2XmAhw8ZozNj/ZOVKSOMuNd9NEbRS+IoRsnFjnPHdjDdRa5JHJT0YdlN0ZeYyMl 8awGLSKhIAigzX6X18V+9ZvMVVNNGaxcONP77/bj6o8G4QRMyMCVhjWvjTIT2K3yp1zI eL2h2WDCo8VTDB7GznZ7dJRIujN2M3ORftAy4lCYCaSUno97kvGoIIwNw80JA+2k3nmz 5tTlgFncgf47DPlWdIwa5RrK/4QvzgT7jMMkFF5QDUDD9yf2AcqPOnqe+EN+X8e4g/Fj TAhAo9q8QrPeiYXkVmFEkWT+x90Vl0uLLSYLjE0EH38lS36AWM7uWPkWUwqK/7Kh5w8D DnRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="S3Qp/HnQ"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h8-20020a17090791c800b008b143ca64b7si2388467ejz.604.2023.02.15.12.49.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 12:49:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="S3Qp/HnQ"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 C3136385B528 for ; Wed, 15 Feb 2023 20:49:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3136385B528 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676494168; bh=1m+6ulG4uawXU7J8foCJx63Xp1n98s0UCd00qib8UXw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=S3Qp/HnQHxV7So2NjbyyGPCs916Vt3cMHBcJSddFS1MYuuj9rIwi3dAezd4ov5BBg poTX+3/8YkWq3bFhptZwoi05BC8s1Ly8t4YwoB2odZcGWZl7SQczsDXmQVZFEJ7abW FWzDuaOAN/dzj4dQQzuij+kMnfOHeavEBkww4+mI= 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 999833858D28; Wed, 15 Feb 2023 20:48:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 999833858D28 Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id 42727202AD5E; Wed, 15 Feb 2023 21:48:41 +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 A8GQN6ud_M2m; Wed, 15 Feb 2023 21:48:41 +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 23684202AD51; Wed, 15 Feb 2023 21:48:41 +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.21; Wed, 15 Feb 2023 21:48:40 +0100 To: , Subject: [PATCH 0/7] Work on PR108030 and several simd bugfixes and testsuite improvements Date: Wed, 15 Feb 2023 21:48:40 +0100 Message-ID: <3238840.44csPzL39Z@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex5.Campus.gsi.de (10.10.4.95) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, BODY_8BITS, 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?1757931559407161813?= X-GMAIL-MSGID: =?utf-8?q?1757931559407161813?= As suggested in PR108030, I used __attribute__ syntax to annotate lambdas as always_inline. In few cases the lambda was meant to be a function boundary and the attribute was omitted. PR108030 mentions a few more functions as problematic. But ideally these should not be inline in some fixed_size_simd cases. This needs further verification. This fix is not simply an optimization. If the user hits this bug then using simd makes the code significantly slower than without using simd. That defeats the whole purpose of the type. While doing verification I found a few more issues and implemented the use of PCH to speed up the test suite. Matthias Kretz (7): libstdc++: Ensure __builtin_constant_p isn't lost on the way libstdc++: Annotate most lambdas with always_inline libstdc++: Document timeout and timeout-factor of simd tests libstdc++: Use a PCH to speed up check-simd libstdc++: printf format string fix in testsuite libstdc++: Fix incorrect __builtin_is_constant_evaluated calls libstdc++: Fix incorrect function call in -ffast-math optimization libstdc++-v3/include/experimental/bits/simd.h | 245 ++++++------ .../include/experimental/bits/simd_builtin.h | 351 ++++++++++-------- .../experimental/bits/simd_converter.h | 22 +- .../include/experimental/bits/simd_detail.h | 3 + .../experimental/bits/simd_fixed_size.h | 265 ++++++------- .../include/experimental/bits/simd_math.h | 56 +-- .../include/experimental/bits/simd_neon.h | 14 +- .../include/experimental/bits/simd_x86.h | 143 +++---- .../testsuite/experimental/simd/README.md | 10 +- .../experimental/simd/generate_makefile.sh | 24 +- .../testsuite/experimental/simd/tests/abs.cc | 4 +- .../experimental/simd/tests/algorithms.cc | 3 +- .../simd/tests/bits/conversions.h | 25 +- .../experimental/simd/tests/bits/main.h | 87 +++++ .../experimental/simd/tests/bits/make_vec.h | 10 + .../simd/tests/bits/mathreference.h | 3 + .../simd/tests/bits/test_values.h | 6 + .../experimental/simd/tests/bits/verify.h | 66 +--- .../experimental/simd/tests/broadcast.cc | 3 +- .../experimental/simd/tests/casts.cc | 4 +- .../experimental/simd/tests/fpclassify.cc | 4 +- .../experimental/simd/tests/frexp.cc | 4 +- .../experimental/simd/tests/generator.cc | 3 +- .../experimental/simd/tests/hypot3_fma.cc | 4 +- .../simd/tests/integer_operators.cc | 5 +- .../simd/tests/ldexp_scalbn_scalbln_modf.cc | 4 +- .../experimental/simd/tests/loadstore.cc | 4 +- .../experimental/simd/tests/logarithm.cc | 5 +- .../experimental/simd/tests/mask_broadcast.cc | 3 +- .../simd/tests/mask_conversions.cc | 2 +- .../simd/tests/mask_implicit_cvt.cc | 3 +- .../experimental/simd/tests/mask_loadstore.cc | 29 +- .../simd/tests/mask_operator_cvt.cc | 3 +- .../experimental/simd/tests/mask_operators.cc | 3 +- .../simd/tests/mask_reductions.cc | 30 +- .../experimental/simd/tests/math_1arg.cc | 3 +- .../experimental/simd/tests/math_2arg.cc | 4 +- .../experimental/simd/tests/operator_cvt.cc | 3 +- .../experimental/simd/tests/operators.cc | 14 +- .../experimental/simd/tests/reductions.cc | 4 +- .../experimental/simd/tests/remqo.cc | 4 +- .../testsuite/experimental/simd/tests/simd.cc | 2 +- .../experimental/simd/tests/sincos.cc | 6 +- .../experimental/simd/tests/split_concat.cc | 4 +- .../experimental/simd/tests/splits.cc | 2 +- .../experimental/simd/tests/trigonometric.cc | 4 +- .../simd/tests/trunc_ceil_floor.cc | 3 +- .../experimental/simd/tests/where.cc | 4 +- 48 files changed, 772 insertions(+), 735 deletions(-) create mode 100644 libstdc++-v3/testsuite/experimental/simd/tests/bits/ main.h