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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DA6413861893 for ; Mon, 13 May 2024 10:43:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA6413861893 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DA6413861893 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715597011; cv=none; b=liUdGm/daLrvjzjDWQI/F976JwRJbqDxcpS4jb5oojmMN+6e0GAV1b0CYY8/f/+u8WoKIfobnzCE0kDOmsrewm2ngT3NSbGqbq7KdTtReu8wbC9unVyYCqUPqjXuid4oK8uKE01t4Neo/1yrr3f3J9m5nafVZI7iwR7vUNX8Eyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715597011; c=relaxed/simple; bh=Vi5ZbLCBsqtgZxmCisUPeGtCunV7aMWFjtFIfBQu6jU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=tYm6/sQI7lUxCT4nylTOzFNF8YkzMhCfH4plbKtxgyZ3v/mLCAo3Jel39V+8Wa2JyR5VQ0dmupiuqThFpnieIyUT7pJsi/y+FiLWmye1JmfK3HbWVpTcokVyL+ekppkcnobkM6zdsQsy2XrovuRWvI6Swh76+qWOKtjp8sJQUGo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715597009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BAUPy36cX3wRSg5RiK9lgG5VCaPmqNHG4j4dKHDn+lE=; b=AsnjaceOQOWDp+itFx0UxDGUGwhI193tRwSoWOlq1QIZxPVO9l+K2g4O0Aman8MZ6XUvHQ bjcGu4i13JsBZASQ+Jji/g2OcgHWTsGzreERa5ZM7yf1LEva3HHy11kZXcvH5wwCxGFhMK iZd0O86PtYVB3ZO9QjHrIEG8KrF8vTw= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-LK-WbmvnOWGgMG4qclSKRw-1; Mon, 13 May 2024 06:43:27 -0400 X-MC-Unique: LK-WbmvnOWGgMG4qclSKRw-1 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-61be26af113so71786837b3.1 for ; Mon, 13 May 2024 03:43:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715597007; x=1716201807; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BAUPy36cX3wRSg5RiK9lgG5VCaPmqNHG4j4dKHDn+lE=; b=o3JXFjyzuHSqaJUcAP1hmWrjUpWpI2hC3iYhhSDE1MUS2v+Epzo9rcmuKAYmvTZItM /HGhsP4HQgt86tBU9WLQwl+ckOeZxg7aS0XxC+gDaf1RX7ZWfpTDK+7HV97+P/fIwgTo 2HBaP5Awm5tTafpRrBxJDYgAHHTqotOvqkta0RBt7hwFEeU3B76mJssApM2mvRaB5Uc2 3YkOFlmWOILZaz5GnbWKTGXxsWG6FA5oJsUGDhEnbGBD8t5uPGp83Mn/mmxXx2OquUKA Yw8RxPn6Z7CiQFKBEL5NVmo6YUoPdSM0VMqe9MRlUkztvLibUveaYRHmsAO/oE5xB5Z3 17pA== X-Gm-Message-State: AOJu0YxLO9Yn5zRDFS2L7dzjMR2bqoQSpF04cR2iPdvPpZzhBCY3Hfct cZiZYMsDyYXJW5fY4a1qumwFihqQMqr1upXnkD/NL5F4e6TOzv/r3hW46t/Py0fYVDgvinOMgv8 uwSDckKxiBtCxCTLWplcLemnXeoL44rzfIEMLTU8Ckh9suf0Puqq+9CElL+c2tc9Kp9ZC/4bNmw dgz8sDmdFvAU9c8U6c/Oq2oqfPoQAVNQ== X-Received: by 2002:a05:690c:f8f:b0:61a:e557:1abb with SMTP id 00721157ae682-622aff831f3mr99418157b3.24.1715597007241; Mon, 13 May 2024 03:43:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs3H0+2w4HWSzkbbyVGjGCgbJT7dra/H849So60hesyUEJD03ap7Mj+XwFzlaGYAjrdPEjySGSa4TiI/tmfhc= X-Received: by 2002:a05:690c:f8f:b0:61a:e557:1abb with SMTP id 00721157ae682-622aff831f3mr99418037b3.24.1715597006927; Mon, 13 May 2024 03:43:26 -0700 (PDT) MIME-Version: 1.0 References: <7312653.5fSG56mABF@excalibur> In-Reply-To: <7312653.5fSG56mABF@excalibur> From: Jonathan Wakely Date: Mon, 13 May 2024 11:43:10 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Use __builtin_shufflevector for simd split and concat To: Matthias Kretz Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Tue, 7 May 2024 at 14:42, Matthias Kretz wrote: > > Tested on x86_64-linux-gnu and aarch64-linux-gnu and with Clang 18 on x86= _64- > linux-gnu. > > OK for trunk and backport(s)? OK for all. > > ---------------------- 8< ---------------------------- > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > PR libstdc++/114958 > * include/experimental/bits/simd.h (__as_vector): Return scalar > simd as one-element vector. Return vector from single-vector > fixed_size simd. > (__vec_shuffle): New. > (__extract_part): Adjust return type signature. > (split): Use __extract_part for any split into non-fixed_size > simds. > (concat): If the return type stores a single vector, use > __vec_shuffle (which calls __builtin_shufflevector) to produce > the return value. > * include/experimental/bits/simd_builtin.h > (__shift_elements_right): Removed. > (__extract_part): Return single elements directly. Use > __vec_shuffle (which calls __builtin_shufflevector) to for all > non-trivial cases. > * include/experimental/bits/simd_fixed_size.h (__extract_part): > Return single elements directly. > * testsuite/experimental/simd/pr114958.cc: New test. > --- > libstdc++-v3/include/experimental/bits/simd.h | 161 +++++++++++++----- > .../include/experimental/bits/simd_builtin.h | 152 +---------------- > .../experimental/bits/simd_fixed_size.h | 4 +- > .../testsuite/experimental/simd/pr114958.cc | 20 +++ > 4 files changed, 145 insertions(+), 192 deletions(-) > create mode 100644 libstdc++-v3/testsuite/experimental/simd/pr114958.cc > > > -- > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > Dr. Matthias Kretz https://mattkretz.github.io > GSI Helmholtz Centre for Heavy Ion Research https://gsi.de > std=E2=82=93::simd > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80