From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 711ED3896809 for ; Wed, 27 Jan 2021 16:41:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 711ED3896809 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-1E7qGLXjMTK08dWi5HxfzQ-1; Wed, 27 Jan 2021 11:41:34 -0500 X-MC-Unique: 1E7qGLXjMTK08dWi5HxfzQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FB5010054FF; Wed, 27 Jan 2021 16:41:33 +0000 (UTC) Received: from localhost (unknown [10.33.36.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3DE60C05; Wed, 27 Jan 2021 16:41:32 +0000 (UTC) Date: Wed, 27 Jan 2021 16:41:31 +0000 From: Jonathan Wakely To: Matthias Kretz Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH 1/2] Add std::experimental::simd from the Parallelism TS 2 Message-ID: <20210127164131.GA541588@redhat.com> References: <3133130.QemTDgPxUG@excalibur> MIME-Version: 1.0 In-Reply-To: <3133130.QemTDgPxUG@excalibur> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 16:41:38 -0000 On 18/12/20 16:49 +0100, Matthias Kretz wrote: >Resending this patch with proper commit message and rebased on master. > >From: Matthias Kretz > >Adds . > >This implements the simd and simd_mask class templates via >[[gnu::vector_size(N)]] data members. It implements overloads for all of > for simd. Explicit vectorization of the functions is not >finished. >The majority of functions are marked as [[gnu::always_inline]] to enable >quasi-ODR-conforming linking of TUs with different -m flags. >Performance optimization was done for x86_64. ARM, Aarch64, and POWER >rely on the compiler to recognize reduction, conversion, and shuffle >patterns. >Besides verification using many different machine flages, the code was >also verified with different fast-math flags. > >libstdc++-v3/ChangeLog: > * doc/xml/manual/status_cxx2017.xml: Add implementation status > of the Parallelism TS 2. Document implementation-defined types > and behavior. > * include/Makefile.am: Add new headers. > * include/Makefile.in: Regenerate. > * include/experimental/simd: New file. New header for > Parallelism TS 2. > * include/experimental/bits/numeric_traits.h: New file. > Implementation of P1841R1 using internal naming. Addition of > missing IEC559 functionality query. > * include/experimental/bits/simd.h: New file. Definition of the > public simd interfaces and general implementation helpers. > * include/experimental/bits/simd_builtin.h: New file. > Implementation of the _VecBuiltin simd_abi. > * include/experimental/bits/simd_converter.h: New file. Generic > simd conversions. > * include/experimental/bits/simd_detail.h: New file. Internal > macros for the simd implementation. > * include/experimental/bits/simd_fixed_size.h: New file. Simd > fixed_size ABI specific implementations. > * include/experimental/bits/simd_math.h: New file. Math > overloads for simd. > * include/experimental/bits/simd_neon.h: New file. Simd NEON > specific implementations. > * include/experimental/bits/simd_ppc.h: New file. Implement bit > shifts to avoid invalid results for integral types smaller than > int. > * include/experimental/bits/simd_scalar.h: New file. Simd scalar > ABI specific implementations. > * include/experimental/bits/simd_x86.h: New file. Simd x86 > specific implementations. > * include/experimental/bits/simd_x86_conversions.h: New file. > x86 specific conversion optimizations. The conversion patterns > work around missing conversion patterns in the compiler and > should be removed as soon as PR85048 is resolved. > * testsuite/experimental/simd/standard_abi_usable.cc: New file. > Test that all (not all fixed_size, though) standard simd and > simd_mask types are usable. > * testsuite/experimental/simd/standard_abi_usable_2.cc: New > file. As above but with -ffast-math. > * testsuite/libstdc++-dg/conformance.exp: Don't build simd tests > from the standard test loop. Instead use > check_vect_support_and_set_flags to build simd tests with the > relevant machine flags. >--- > .../doc/xml/manual/status_cxx2017.xml | 216 + > libstdc++-v3/include/Makefile.am | 13 + > libstdc++-v3/include/Makefile.in | 13 + > .../experimental/bits/numeric_traits.h | 567 ++ > libstdc++-v3/include/experimental/bits/simd.h | 5051 ++++++++++++++++ > .../include/experimental/bits/simd_builtin.h | 2949 ++++++++++ > .../experimental/bits/simd_converter.h | 354 ++ > .../include/experimental/bits/simd_detail.h | 306 + > .../experimental/bits/simd_fixed_size.h | 2066 +++++++ > .../include/experimental/bits/simd_math.h | 1500 +++++ > .../include/experimental/bits/simd_neon.h | 519 ++ > .../include/experimental/bits/simd_ppc.h | 123 + > .../include/experimental/bits/simd_scalar.h | 772 +++ > .../include/experimental/bits/simd_x86.h | 5169 +++++++++++++++++ > .../experimental/bits/simd_x86_conversions.h | 2029 +++++++ > libstdc++-v3/include/experimental/simd | 70 + > .../experimental/simd/standard_abi_usable.cc | 64 + > .../simd/standard_abi_usable_2.cc | 4 + > .../testsuite/libstdc++-dg/conformance.exp | 18 +- > 19 files changed, 21802 insertions(+), 1 deletion(-) > create mode 100644 libstdc++-v3/include/experimental/bits/numeric_traits.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_builtin.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_converter.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_detail.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_fixed_size.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_math.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_neon.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_ppc.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_scalar.h > create mode 100644 libstdc++-v3/include/experimental/bits/simd_x86.h > create mode 100644 libstdc++-v3/include/experimental/bits/ >simd_x86_conversions.h > create mode 100644 libstdc++-v3/include/experimental/simd > create mode 100644 libstdc++-v3/testsuite/experimental/simd/ >standard_abi_usable.cc > create mode 100644 libstdc++-v3/testsuite/experimental/simd/ >standard_abi_usable_2.cc I have pushed this to master, after a week of testing on x86_64 and powerpc64 and powerpc64le. I know it's stage 4 now, but this only adds a new experimental implementation of a TS, it doesn't touch any existing code. The new tests (which were in a separate patch) are all skipped by default, so shouldn't cause any new failures for testers.