From patchwork Thu Feb 23 08:48:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 5776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp208853wrd; Thu, 23 Feb 2023 00:59:00 -0800 (PST) X-Google-Smtp-Source: AK7set8iACwRCkw8eiOjW2rccfRPbagW7BPojQIPZRWBoywWuL2rNaTFhIAOlKGs/wo4jDRGN7iz X-Received: by 2002:aa7:d794:0:b0:4ad:7224:ce9f with SMTP id s20-20020aa7d794000000b004ad7224ce9fmr11404606edq.17.1677142740665; Thu, 23 Feb 2023 00:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677142740; cv=none; d=google.com; s=arc-20160816; b=pc2TTO+mqGj3Jmi8swiho6/0RFJMootAQyZcmzJPmkjG3ABkLVKNyuWtZahNrLv62C N8R6X5GaCVg5x+Trn+mzwJfmuXb/NXvpxLeHzhf/LsLQqARD5kRka6CsmglZCkzJgDe5 f1Wu5zxYl1cgdIIADGQFeGaApadn5WE1YiJiyy8IbhHx/SXbko+uJBKoyYv/8zerh0O7 IhGv712ZSFxO70u+MRGSyxMkZ/NcvX7EX9gf7ZA2KP/jJJLS3ZAy7GdvecTHjxAlMMfI UaqABv0tirwxjtsJzPyZTxkeYXPjUgrn82QIwy83xRtDpyGLrg4XbCsb1O1kq4Rw41yC SFkA== 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=wOfINACi4qtaA33Ba+HVD2hKGiI1ScI95D8ez7Saajc=; b=wgSJ7ZVWqBDhx6/e5njSea0f3jcM7E67+JrqYwmCI5xfbGO62Ld9lxq/ys55fDJNqw 8UE8x1ixC43Krh8bsr4PtYhfBgKHj/XHWIt1yw1zdIRXvtXzfxfimuv8kC+w6wpuVJwl TFTSIwHNUUXMVhFn+BidxDqW9oICPfQ0BhYkDkSM/z5GXQxbensnqkASJIWD83y1X4nn v+J7WAbIJCTU5TKfMIbi6ug73AbXDkXJ974mdCmRfb+C7pmUkIJ+nC/bErKbqzdMDX8Y Kb2qF9vq+vioXa3IFTQUcGf/nFk/LaXW48xWCUimCYYjkTAByQxBcRs4gzAKyirh0Cr+ oToQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="LOnU/4cd"; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t2-20020a05640203c200b004acc00fed01si2120380edw.589.2023.02.23.00.59.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 00:59:00 -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="LOnU/4cd"; 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 7C1E6383EC4B for ; Thu, 23 Feb 2023 08:54:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C1E6383EC4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677142479; bh=wOfINACi4qtaA33Ba+HVD2hKGiI1ScI95D8ez7Saajc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LOnU/4cdDSDYDURjoB7RpVdLT0gpapzn6yptTDmnbU+jnS5fUuzwd/xxTQ2d3wjyA Bu3m6GjtfyS5V9Gl878A27DkJRxUp05pwyr5tZAWN3mqAJjc/GrB8CJJprhln4tQ4W wCHD9C/zi2UjrYaYOhbBTS0Wsj0WPxNhf3pmyNlo= 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 B58B8385B50B; Thu, 23 Feb 2023 08:50:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B58B8385B50B Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id A6BFF2027E3F; Thu, 23 Feb 2023 09:50:54 +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 jo7sJnnu_X1S; Thu, 23 Feb 2023 09:50:54 +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 8F572203E7FC; Thu, 23 Feb 2023 09:50:54 +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:54 +0100 To: , Subject: [PATCH 0/8] std::experimental::simd patchset Date: Thu, 23 Feb 2023 09:48:23 +0100 Message-ID: <2218250.iZASKD2KPV@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvEX7.Campus.gsi.de (10.10.4.97) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-4.1 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?1758611626415607936?= X-GMAIL-MSGID: =?utf-8?q?1758611626415607936?= Tested on x86_64-pc-linux. This patchset provides the final changes for PR108030 and resolves PR108856. The latter is a pure optimization and could wait for Stage 1 (I'm submitting the patch because simd is experimental/TS) Matthias Kretz (8): libstdc++: Simplify three helper functions into one libstdc++: Fix simd build failure on clang libstdc++: More efficient masked inc-/decrement implementation libstdc++: Add missing constexpr on simd shift implementation libstdc++: Always-inline most of non-cmath fixed_size implementation libstdc++: Fix formatting libstdc++: Fix -Wsign-compare issue libstdc++: Test that integral simd reductions are precise libstdc++-v3/include/experimental/bits/simd.h | 485 ++++++------ .../include/experimental/bits/simd_builtin.h | 721 +++++++++--------- .../include/experimental/bits/simd_detail.h | 3 +- .../experimental/bits/simd_fixed_size.h | 286 ++++--- .../include/experimental/bits/simd_neon.h | 24 +- .../include/experimental/bits/simd_ppc.h | 3 +- .../include/experimental/bits/simd_scalar.h | 362 +++++---- .../include/experimental/bits/simd_x86.h | 158 ++-- .../experimental/simd/tests/reductions.cc | 3 +- 9 files changed, 1075 insertions(+), 970 deletions(-)