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.133.124]) by sourceware.org (Postfix) with ESMTP id C57CE388F015 for ; Thu, 24 Jun 2021 14:12:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C57CE388F015 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-v1H5Z_gqNAC6eFcdiIuahg-1; Thu, 24 Jun 2021 10:12:46 -0400 X-MC-Unique: v1H5Z_gqNAC6eFcdiIuahg-1 Received: by mail-wm1-f70.google.com with SMTP id p22-20020a7bcc960000b02901de8f2ae18aso1705058wma.8 for ; Thu, 24 Jun 2021 07:12:46 -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=HOx4IhllS9r2X8LeNHjspX69CWfuPNVEVZAXvTKHZyUBaFgVavMVSuR0qVaHFAZsEb UdpQYsWVAN0RNQXPOp7GC1SIty9Q4Hi0jfyEFVS2qIRNJlvT89D191Qj7CsYybmVubNx GiWaoLcRlAt6h0J6BKxmXyTilsZNlqW+4clereiOv1LuA44c7s6chzn5VN0FH8N98KvF +q3BNcGaJT1VLNHcfhKDuUdkgC6yjsyOQETZS+As365dDTvbpORVb0oTMKVLS599bAUi 0QxaIUeIwscnP9ZXa+42y9stH9F0Q6xTSRD7g+gSRsiBvXMgR3+aYp3VFoxgIp2wCpYI 9X7Q== X-Gm-Message-State: AOAM532PqTjRayhRWugH9sDh89zfXrcGNrzUAulLSaoysHhWPrjZ/kt8 tqOFJv37jKTU9rh9dFzTFwS5vM0LAyPqADyB9v2HcxrVmzTqvfnLkyg0yaj0W7Sl9K5J7NjVbsJ q0/Rn0m/78VUYPokVcKHRtQFJ8ALDdsvTDg== X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr4867197wrx.13.1624543965181; 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.8 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: 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: Thu, 24 Jun 2021 14:12:48 -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/