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 2D7C7388F00F for ; Thu, 24 Jun 2021 14:12:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D7C7388F00F Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-aN3D2EWaOU-2Z2vtFK0PXQ-1; Thu, 24 Jun 2021 10:12:46 -0400 X-MC-Unique: aN3D2EWaOU-2Z2vtFK0PXQ-1 Received: by mail-wr1-f71.google.com with SMTP id g4-20020a5d64e40000b029012469ad3be8so2008111wri.1 for ; Thu, 24 Jun 2021 07:12:45 -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=eOmA01CtDtI0X3XCSY0WJEk+85klEjCrWoyWfVHans0=; b=ZgjLnw8w8jyBSISe+Ix054KtzbadiJG67bcf1hpfceg+IFP3gjTSbwftamaA/HPnd/ gqE0TXCYl3FZAVPq4PkRyouJxGrzD734j+G3Dp/izHoOEXiEqOkW+A3lTCt+HhUztbyQ q/S072/x7+KK4jz9cGO+xgr6a9mbScU9X1hNGUs4wLSTcLvjkRriC1EI+Wf3O1rsLyI4 J5bZD2HbAie3jHHe9rZVQ9s+K3xftd7owvsUAPGBHfoqCOIiccfEDnTzZRutWCzgTbbL aAVqOu8aS4NMYwvyHE8Mg1pMmvuhIZ2w8Fs3g6ILTu2CPLBSZzmasaZNFXks15MG5dJ6 MKig== X-Gm-Message-State: AOAM533JRhbpiLHgRxJw8rne57UU2Wad4m/PKsLPRjHNkIxvXIXTxe9v 2S7M+4zgXnrfsNxPHIGSaA/S8VF/FmN/C3LDRiu3po0M9INQSRgUhcY/fVNsIWKur8pRdoPMCte /0WEyZy+b1KojiS01O7J1Bj5nAXuFAis= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr4867171wrx.13.1624543965045; Thu, 24 Jun 2021 07:12:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNLD9uM/aynCDfPskFtTgvEH39oEY+9tQhAPA8+FgFAY/0klFZbbG1C74mEX3dj6+q41l16OCPeveclPYsZso= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr4867152wrx.13.1624543964844; Thu, 24 Jun 2021 07:12:44 -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: From: Jonathan Wakely Date: Thu, 24 Jun 2021 15:12:33 +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.5 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=unavailable 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:12:52 -0000 On Thu, 24 Jun 2021 at 15:11, Jonathan Wakely wrote: > > 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. s/__is_builtin/__has_builtin/