From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lxmtout2.gsi.de (lxmtout2.gsi.de [140.181.3.112]) by sourceware.org (Postfix) with ESMTPS id C05E73858D3C; Mon, 22 Apr 2024 15:29:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C05E73858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gsi.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gsi.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C05E73858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.181.3.112 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713799780; cv=none; b=tuBFPJg6jYUMubZPaoJQWPm3VmMUHybp+koAwhYVPlYuVKUHi843YhwgWkhYt0RZEgymiTFOlM8r+6oiqVLPetBm8UUw4XGMUYY9EZOyAosuATsPM/qFYNmtozK9aBJzSeAumfx0s170jyspFcC16NCY2MHWq69bqHE48XhpgLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713799780; c=relaxed/simple; bh=sWXmSgjgFfb7ziVljexm9T9uMSwdTJQJ+OJiOMWnOs4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=YlvxlbTE0MK8GYb9X234xc3Mct2V13u9bwgDHYyAzpEBpSgwoptFg0F5ZGkFxJmBr+7zgh9RP/rkGpIjUImD6b+CI4TcoPtBufVtIW0Pwiom0UjmzEhYKPUxPXKGg/LhUunN+yrq1M57Qeh3sQPY9cA1O30DDZoKLU1aw4hwt6g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id 9D69D20350E7; Mon, 22 Apr 2024 17:29:36 +0200 (CEST) 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 5rQNKdK7Wl6w; Mon, 22 Apr 2024 17:29:36 +0200 (CEST) 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 81DB320350E1; Mon, 22 Apr 2024 17:29:36 +0200 (CEST) Received: from centauriprime.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.1544.9; Mon, 22 Apr 2024 17:29:36 +0200 From: Matthias Kretz To: , Subject: [PATCH] libstdc++: Silence irrelevant warnings in Date: Mon, 22 Apr 2024 17:29:35 +0200 Message-ID: <5859837.GXAFRqVoOG@centauriprime> Organization: GSI Helmholtz Center for Heavy Ion Research MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2858446.tdWV9SEqCh"; micalg=pgp-sha512; protocol="application/pgp-signature" 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=-10.1 required=5.0 tests=BAYES_00,BODY_8BITS,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,URIBL_SBL_A 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: --nextPart2858446.tdWV9SEqCh Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Matthias Kretz To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Date: Mon, 22 Apr 2024 17:29:35 +0200 Message-ID: <5859837.GXAFRqVoOG@centauriprime> Organization: GSI Helmholtz Center for Heavy Ion Research MIME-Version: 1.0 Tested on x86_64-linux-gnu, powerpc64le-linux-gnu, aarch64-linux-gnu, arm- linux-gnueabihf OK for trunk and backports? =2D---------------------------- 8< --------------------------------- Avoid =2DWnarrowing in C code; =2DWtautological-compare in unconditional static_assert (necessary for faking a dependency on a template parameter) Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Ignore -Wnarrowing for arm_neon.h. (__int_for_sizeof): Replace tautological compare with checking for invalid template parameter value. * include/experimental/bits/simd_builtin.h (__extract_part): Remove tautological compare by combining two static_assert. =2D-- libstdc++-v3/include/experimental/bits/simd.h | 8 +++++++- libstdc++-v3/include/experimental/bits/simd_builtin.h | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/ include/experimental/bits/simd.h index 03c2e17a326..6ef9c955cfa 100644 =2D-- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -44,7 +44,12 @@ #if _GLIBCXX_SIMD_X86INTRIN #include #elif _GLIBCXX_SIMD_HAVE_NEON +#pragma GCC diagnostic push +// narrowing conversion of '__a' from 'uint64_t' {aka 'long long unsigned= =20 int'} to +// 'int64x1_t' {aka 'long long int'} [-Wnarrowing] +#pragma GCC diagnostic ignored "-Wnarrowing" #include +#pragma GCC diagnostic pop #endif #if _GLIBCXX_SIMD_HAVE_SVE #include @@ -598,6 +603,7 @@ struct __is_bitmask constexpr auto __int_for_sizeof() { + static_assert(_Bytes > 0); if constexpr (_Bytes =3D=3D sizeof(int)) return int(); #ifdef __clang__ @@ -663,7 +669,7 @@ struct _Ip return _Ip{}; } else =2D static_assert(_Bytes !=3D _Bytes, "this should be unreachable"); + static_assert(_Bytes =3D=3D 0, "this should be unreachable"); } #pragma GCC diagnostic pop =20 diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstd= c+ +-v3/include/experimental/bits/simd_builtin.h index af0c4886108..49c7c7e1c70 100644 =2D-- a/libstdc++-v3/include/experimental/bits/simd_builtin.h +++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h @@ -278,8 +278,7 @@ __extract_part(const _SimdWrapper<_Tp, _Np> __x) __extract_part(const _SimdWrapper __x) { static_assert(_Combine =3D=3D 1, "_Combine !=3D 1 not implemented"); =2D static_assert(__have_avx512f && _Np =3D=3D _Np); =2D static_assert(_Total >=3D 2 && _Index + _Combine <=3D _Total && _Ind= ex >=3D 0); + static_assert(__have_avx512f && _Total >=3D 2 && _Index + _Combine <= =3D=20 _Total && _Index >=3D 0); return __x._M_data >> (_Index * _Np / _Total); } =20 =2D-=20 =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 --nextPart2858446.tdWV9SEqCh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEroo/QdgfHhrjcEOni/oLaRkZhWgFAmYmgl8ACgkQi/oLaRkZ hWgiXQf/Z9END6gQi+1PNHVzbbnEJuwmzNajTGuJEEfSLnpCBxjGtDXQ32MARxO4 1prtXz3Jfy4lBZsQM7N+77gg/St0KhO8uTPhyBJxcdvBxtt1JQH8smXbnIypawU0 ZyV46Kt5MuhjSzTP7uixmDRTLGNxipFIoCzlLyOqFTu8DMe4K+IgNMPCiG5NajtB fIrWEW5oHPMuvw6R1s1QAC9fZrfVu63YCBOoa0mnSfDHzEkSzkNVhEG817a8DMEd x3ynHY13vvg6QH0lsPKEBvNo0gK4ssGQWCnbUQKAIp14zfW6lR7cmasl8exYCuVW pNx7UTnS8NPa6Fq7SA/3o0/EuLaA8A== =q0TO -----END PGP SIGNATURE----- --nextPart2858446.tdWV9SEqCh--