From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 9C07C385F022; Fri, 16 Jul 2021 13:26:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9C07C385F022 Received: by mail-wr1-x42a.google.com with SMTP id d12so12058651wre.13; Fri, 16 Jul 2021 06:26:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V+fhMR/peQTxHulsGaHiXYQFw3YttgktSdnnKld9YnE=; b=Hc991sIK4umRrxAqP1CIrGzY1OZIiGa4ItkL+qnRvNUeco6yJsYw+LVHmi5y5A5VPO la1Mme3sMZlx1daVX52UV8Kcw4kKRyuE3mXecnMGbUH7biJhXF2u2TcVWcOCV0ZIKqBg daS3x23kKgJWrcC8ZPtIsB2jwqAwuoLOfR19x1SRICsUmJipfIVzIh18aHXYtor8Sgev LtOYd6GAyMBoowfpxrshjfhzbd6vbsGGCKk0rOib7MwZHry9YL/Mc29VQCNtwPmyljQv 2ZCjtLNraZIddURHQc1UVV93E4yVUdx9ODGWZj0r7LTHSNpPOe2yB8E1LlREue4MZb/n CZHQ== X-Gm-Message-State: AOAM533C0FdGCCj2ms6Zt0t/+0f2LSQ3CprZqrOX/kZzZYuizpi4Fg/H AgNPkI/60Hd+vMkhYPn7CkvNUjoUtFL36nsWgnk= X-Google-Smtp-Source: ABdhPJxwHYR8PJFE5pES73t/1J65Q7D8OkERDClzMoUeMUhoTfNvfKctX1qQHMEYgae8WaY4/2ldeYkRnllPXxihPa4= X-Received: by 2002:adf:a74a:: with SMTP id e10mr12157731wrd.185.1626442013709; Fri, 16 Jul 2021 06:26:53 -0700 (PDT) MIME-Version: 1.0 References: <20210716023656.670004-1-jason@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Fri, 16 Jul 2021 14:26:42 +0100 Message-ID: Subject: Re: [PATCH] c++: implement C++17 hardware interference size To: Jason Merrill Cc: gcc-patches List , "Richard Earnshaw (lists)" , "libstdc++" , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 16 Jul 2021 13:26:55 -0000 On Fri, 16 Jul 2021 at 03:42, Jason Merrill via Libstdc++ wrote: > > diff --git a/libstdc++-v3/include/std/version > > b/libstdc++-v3/include/std/version > > index 27bcd32cb60..d5e155db48b 100644 > > --- a/libstdc++-v3/include/std/version > > +++ b/libstdc++-v3/include/std/version > > @@ -140,6 +140,9 @@ > > #define __cpp_lib_filesystem 201703 > > #define __cpp_lib_gcd 201606 > > #define __cpp_lib_gcd_lcm 201606 > > +#ifdef __GCC_DESTRUCTIVE_SIZE > > +# define __cpp_lib_hardware_interference_size 201703L > > +#endif > > #define __cpp_lib_hypot 201603 > > #define __cpp_lib_invoke 201411L > > #define __cpp_lib_lcm 201606 > > diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new > > index 3349b13fd1b..7bc67a6cb02 100644 > > --- a/libstdc++-v3/libsupc++/new > > +++ b/libstdc++-v3/libsupc++/new > > @@ -183,9 +183,9 @@ inline void operator delete[](void*, void*) > > _GLIBCXX_USE_NOEXCEPT { } > > } // extern "C++" > > > > #if __cplusplus >= 201703L > > -#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER > > namespace std > > { > > +#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER > > #define __cpp_lib_launder 201606 > > /// Pointer optimization barrier [ptr.launder] > > template > > @@ -205,8 +205,14 @@ namespace std > > void launder(const void*) = delete; > > void launder(volatile void*) = delete; > > void launder(const volatile void*) = delete; > > -} > > #endif // _GLIBCXX_HAVE_BUILTIN_LAUNDER > > + > > +#ifdef __GCC_DESTRUCTIVE_SIZE > > +# define __cpp_lib_hardware_interference_size 201703L > > + inline constexpr size_t hardware_destructive_interference_size = > > __GCC_DESTRUCTIVE_SIZE; > > + inline constexpr size_t hardware_constructive_interference_size = > > __GCC_CONSTRUCTIVE_SIZE; > > +#endif // __GCC_DESTRUCTIVE_SIZE > > +} > > #endif // C++17 > > > > #if __cplusplus > 201703L Putting aside my dislike of the entire feature, the libstdc++ parts are fine, thanks.