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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 055DA388F037 for ; Thu, 24 Jun 2021 14:11:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 055DA388F037 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-599-oo1bIW42Nji4vR0sjtJXBA-1; Thu, 24 Jun 2021 10:11:13 -0400 X-MC-Unique: oo1bIW42Nji4vR0sjtJXBA-1 Received: by mail-wm1-f72.google.com with SMTP id k5-20020a7bc3050000b02901e081f69d80so579175wmj.8 for ; Thu, 24 Jun 2021 07:11:13 -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=Gd0PVhjB6GsUExKoMdUicoRrLcr60kS0Va9QNuSTvZQ=; b=tn6grwuMUzZc6RUdPMGnFHkB+r2ABlkpHyk6NjVqUch9RTnlk9jKcVsiwq7qruXazO iqKbM4YkXzkE0Ohv6/47eOVl7+RavEu+lv5V1/IpZNue5y7K4xEKQwrYDqCBOD9YXKx6 YrBFvfI6MPOKE2+HzWkIj8/Nftzpg9bvQRIIEJ4m7kGkboxdOkHV3w4EzNGFn4+EsqIr +gj9pFEcWUfdGGY2FUX0sI5h+/fpTpFPpoABGH3sIRouFEBZrdHt87qYMQr21Fx9YKC/ 5jH0d/3RPgrDVZahaWz3kMYFKfIKjAe9Ei/aC9I7I7SJtjCDAjsP7fU7N+O5M27bAvpG GKPw== X-Gm-Message-State: AOAM531oSfq+hP5Mw9tUljXpq92mdg6p7BEff3OVcTNOZAmK5G2AqYiG ricksWcewrgXQVUnj19p5C5G3Nl9czp0/EpGeUuHMq1fP+5WI5rIBUWjLGlky7Fsq8OPv0lnzrL H/N1tOPiB9tZOsfLwbgg2urmaxcyXDoI= X-Received: by 2002:a1c:4c19:: with SMTP id z25mr4591934wmf.131.1624543872187; Thu, 24 Jun 2021 07:11:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsvJSem6Lcty2vR4miZG6Wcd1Rm/IZklkZK4QoS4tHg3l29drsLrVU7h2Jk4GPBBf9WDEwXa/nWlVKw6VdzYs= X-Received: by 2002:a1c:4c19:: with SMTP id z25mr4591902wmf.131.1624543871963; Thu, 24 Jun 2021 07:11:11 -0700 (PDT) MIME-Version: 1.0 References: <270527782.u9WJ3AIrlG@excalibur> <3553838.ebMzRN9Arp@excalibur> <3315301.e9AK2G76lq@excalibur> <14392010.RDIVbhacDa@minbar> <20210624140837.GT7746@tucnak> In-Reply-To: <20210624140837.GT7746@tucnak> From: Jonathan Wakely Date: Thu, 24 Jun 2021 15:11:01 +0100 Message-ID: Subject: Re: [PATCH 04/11 v3] libstdc++: Make use of __builtin_bit_cast To: Jakub Jelinek Cc: Matthias Kretz , gcc Patches , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Thu, 24 Jun 2021 14:11:16 -0000 On Thu, 24 Jun 2021 at 15:08, Jakub Jelinek wrote: > > On Thu, Jun 24, 2021 at 04:01:34PM +0200, Matthias Kretz wrote: > > --- a/libstdc++-v3/include/experimental/bits/simd.h > > +++ b/libstdc++-v3/include/experimental/bits/simd.h > > @@ -1598,7 +1598,9 @@ template > > _GLIBCXX_SIMD_INTRINSIC constexpr _To > > __bit_cast(const _From __x) > > { > > - // TODO: implement with / replace by __builtin_bit_cast ASAP > > +#if __has_builtin(__builtin_bit_cast) > > Shouldn't that use #if _GLIBCXX_HAS_BUILTIN(__builtin_bit_cast) in > c++config to define a new macro and use that macro here? > Though it is true that c++config already uses > #if __has_builtin(__builtin_is_constant_evaluated) > and so would fail miserably for compilers that don't support __has_builtin GCC was the last of our supported compilers to implement __has_builtin, so for GCC trunk we can assume that it's always supported. The code in c++config.h still has some value for built-ins that aren't called __builtin_xxx because older versions of Clang need different handling for those. But for __builtin_bit_cast and __builtin_is_constant_evaluted we can just use __is_builtin directly.