From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id 58539386188A for ; Fri, 30 Apr 2021 20:25:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 58539386188A Received: by mail-lf1-x131.google.com with SMTP id j4so72492767lfp.0 for ; Fri, 30 Apr 2021 13:25:03 -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=5J4UyRT1NRanfF1xgziRbIu0rBkOmswazjncuONMaYQ=; b=Bqdv4gFIV0tzqVrEWviJgclCkYMLFfTAz+NHGTJovlP6UTKKx+90bR5OpipSaaB8PO ZcgjkVHMQLsfdNYTE/5XxLVgu2bifPpscrDcnCcDEfxflcklSol+avmmPLGbFmjhyAH5 CBP2okSYgWnXNYnfnokDQXypZbAyp6Kkm+kcNlscLf2KdP8wEMiGabtEETbrVJHCGNd1 BiUBU14inrOSNFL8JP07WlAk7/+F+neENEMWynhJNzhujcp/FnDagr9H4jnV3i/TsRFj 4nZMmnU6EEQNHRfBxYLnEms6ekj2/ayE8x4AZFxXxV/k7jBSjAzcNC7x9Q0ZJDT/+ddD LNdQ== X-Gm-Message-State: AOAM530io+mqq/p8PPrun/qG2QqIby32P7ICAi3xtWdITwXf0mr31STC Qb2OxXAMgmQxirzBtYcU7Mm7ltrGm8sddCKkRe0= X-Google-Smtp-Source: ABdhPJwiSlEDOoCjkrBFZuAna4fVMVBLZ5aFefmnj4WMGQW1N0S2ExrPwzDrJjg5DT0jDhnvkRavkJOzH0p/NU5ckwY= X-Received: by 2002:a05:6512:308a:: with SMTP id z10mr4569985lfd.15.1619814302050; Fri, 30 Apr 2021 13:25:02 -0700 (PDT) MIME-Version: 1.0 References: <20210108160959.GD9471@redhat.com> In-Reply-To: <20210108160959.GD9471@redhat.com> From: David Edelsohn Date: Fri, 30 Apr 2021 16:24:51 -0400 Message-ID: Subject: Re: [libstdc++] Inconsistent detection of __int128 To: Jonathan Wakely Cc: Jonathan Wakely , "libstdc++" , Iain Sandoe , "CHIGOT, CLEMENT" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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: Fri, 30 Apr 2021 20:25:04 -0000 On Fri, Jan 8, 2021 at 11:10 AM Jonathan Wakely wrote: > > On 03/01/21 22:26 -0500, David Edelsohn via Libstdc++ wrote: > >On Sun, Jan 3, 2021 at 9:45 PM Jonathan Wakely wrote: > >> > >> On Mon, 4 Jan 2021, 00:44 David Edelsohn via Libstdc++, wrote: > >>> > >>> Or is there some other reason that _GLIBCXX_USE_INT128 and > >>> __SIZEOF_INT128__ are used in different contexts? > >> > >> Yes. > >> > >> I'll reply when I'm back from taking some time off. Probably Wednesday. > > > >If the uses of _GLIBCXX_USE_INT128 in libstdc++ headers specifically > >are checking if __int128 type is different than "long" and "long > >long", as opposed to the availability of the __int128, can c++config.h > > Yes, the test is not just "is __int128 a valid type?" but "should we > use __int128 as a larger integer type?" > > We used to use it more widely, but many places that use __int128 > conditionally now check __GLIBCXX_INT_N_0 instead, because that is > defined when __int128 is available and we're not compiling in a > "strict ansi" dialect. > > Of the two remaining uses of _GLIBCXX_USE_INT128 I think one is wrong > and should test __SIZEOF__INT128__ directly. We specifically do want > to use unsigned __int128 in __to_chars_unsigned_type even if it's the > same as a standard type. > > So that leaves one remaining use, and I think that should do as you > suggest here ... > > >define _GLIBCXX_USE_INT128 by comparing __SIZEOF_INT128__ to > >__SIZEOF_LONG_LONG__ and __SIZEOF_LONG__ instead of the libstdc++ > >configure template typename test? > > Yes, that seems fine. But since we only need it in one place, let's > just do that test in that one place. It makes the purpose of the test > more explicit, and so you don't need to look up what > _GLIBCXX_USE_INT128 means and when it's true. > > Does the attached patch work for you? Hi, Jonathan Thanks for pushing the INT64_T patch. I tested your revised patch in January and it works perfectly. Could you push your INT128 patch to trunk when you have a moment? Thanks, David