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.129.124]) by sourceware.org (Postfix) with ESMTPS id 79A733858286 for ; Wed, 17 Jan 2024 11:28:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79A733858286 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 79A733858286 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705490909; cv=none; b=XM/64FaWYkQa1xd/rDULhog5L3NsCxSPThP3jiZJXd3E9WmBrdRMX0mIfd96eyECy0LIxYF95JTVyYKCQEikalaxxsmT15pcqnYqdj63jVgA2vadu6FS1VhYyloygvyyxHb+VhM4mR11G7zBCKJnaCcfYDxId4dlWjE3V2j47pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705490909; c=relaxed/simple; bh=AiPlrUORzJS7KvCN3cyvOjwvu2xmGpW+Q5aDAJHAqFc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Hx8x0T7o5rJEP2tDHbX/qVQ1SFKxuVS+4mn+0/wWU0EbYPjyPkUDIigSqOfFpxUfWrqsXa4zGnA5wx2YeuwXbFoiwDBSJM0eBjNW6MZMZ4rWdpVPjK0pYzajWe4+hDcSxobABEeqJCtQQtMqa4dkW/vunxTRzCWSMbT7iB1s11c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705490907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XEMj9weSJlK8gcFJAPVCFt6yrKeUENGP4kw7EbswZmU=; b=cIQK/XnrLq/6u9lNOAHW7YeNDSzwrPYo2ASSvxCZgsuZh+bWjSV97cpLo5yknjNvwVEOX7 fL/+C9rs1kUVDtiUQw+ZRcKrkEiCCr2JN8OJyi98H1FP/8BkNWvYT2nkCx+QWibpktiMU/ XiCGGGYzUidkhvnBo043ohSmx0QO8WM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-59-s0l6lxA5P6yJLUEWKYm7bQ-1; Wed, 17 Jan 2024 06:28:25 -0500 X-MC-Unique: s0l6lxA5P6yJLUEWKYm7bQ-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40d1ffbc3b8so85231145e9.0 for ; Wed, 17 Jan 2024 03:28:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705490904; x=1706095704; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XEMj9weSJlK8gcFJAPVCFt6yrKeUENGP4kw7EbswZmU=; b=rsWtbKNCZuTJQ7XYmQW/2Wl07ANpJCBv5387brxeRHJeES8YYs5PlmFWyyrm8lzMC9 n2UhjX5P7vJMgqx6FUYpKk9z6QKPuCUh97XsQ7QpNtnhdZ8gCNfZzZ6h5tWiQWUcQHqK bLN78td8a3IdMw60PBID5Xh3RsfkbkVEAI/UMPAlWlC8q2lP9XlVX8WgKYXuEjjso640 u26OGe+glEQ0lgY/0Sm8SU6HsYkzyZJIyaODFoQ/5aVqNjdUlKjsacatKI/eddoJRFP+ nCfD7/O7wwiS0/YhP+pweYaCgWl920v+L/2R7f60els1pcTLPrz++iMr+rTNdBhF1Cl5 bfxA== X-Gm-Message-State: AOJu0YzUxNzxkcE06PU1OHUko9aSa/OAoHxToR3J7uWCjfVJW9Qqojvg bIPn1LQKy8BWZu5kxsMGyY7pmwo6jiGaW36EjWobAl4sAD1QrCIGjwtBpMru2aJSTJAtVMFto88 rE7pbTJOqZHxyzLmEVONdL5BKeg== X-Received: by 2002:a7b:c45a:0:b0:40e:7611:e52f with SMTP id l26-20020a7bc45a000000b0040e7611e52fmr1522975wmi.315.1705490904781; Wed, 17 Jan 2024 03:28:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNwGVucMUWmmOP7A6BMftfL++YzJgcwEO8DahSPoA0U8hyFlzia6avw38g9gLheiwe7k9odg== X-Received: by 2002:a7b:c45a:0:b0:40e:7611:e52f with SMTP id l26-20020a7bc45a000000b0040e7611e52fmr1522968wmi.315.1705490904346; Wed, 17 Jan 2024 03:28:24 -0800 (PST) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c351000b0040e4914f28dsm25933180wmq.18.2024.01.17.03.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 03:28:24 -0800 (PST) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.95) (envelope-from ) id 1rQ45m-002NUp-KM; Wed, 17 Jan 2024 11:28:22 +0000 Date: Wed, 17 Jan 2024 11:28:22 +0000 (UTC) From: Joseph Myers To: Jonathan Wakely cc: Jason Merrill , Jonathan Wakely , libstdc++@gcc.gnu.org, Ken Matsui , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 01/14] c++: Implement __is_integral built-in trait In-Reply-To: Message-ID: References: <20240110194031.2384005-1-kmatsui@gcc.gnu.org> <20240110194031.2384005-2-kmatsui@gcc.gnu.org> <25fff4d0-f560-4cb9-9180-6ec6620dfaa4@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 17 Jan 2024, Jonathan Wakely wrote: > So we can remove the dependency on __STRICT_ISO__ for 128-bit integer > types, and implementing std::is_integral with a built-in seems like > the perfect time to do that. But that seems like stage 1 material, as > we need to go through the library and see what needs to change. As noted on IRC, for C23 there would also be library issues in making __int128 an extended integer type. If it's an extended integer type, then C23 would require to define int128_t, uint128_t, int_least128_t and uint_least128_t, along with the macros INT128_WIDTH, UINT128_WIDTH, INT_LEAST128_WIDTH, UINT_LEAST128_WIDTH (trivial), and INT128_C and UINT128_C (require an integer constant suffix), and INT128_MAX, INT128_MIN, UINT128_MAX, INT_LEAST128_MAX, INT_LEAST128_MIN, UINT_LEAST128_MAX (most simply defined using an integer constant suffix, though don't strictly require one). And would have to define all the printf and scanf format macros for int128_t, uint128_t, int_least128_t and uint_least128_t - so library support would be needed for those (the format macros themselves should probably expand to "w128d" and similar, a C23 feature already supported for narrower types by glibc and by GCC format checking, rather than inventing new features there). So because an extended integer type (without padding bits) in C23 is expected to have all the library support from and , you need integer constant suffixes and printf/scanf support before you can declare __int128 an extended integer type for C23. (If adding printf and scanf support for int128_t to glibc, it probably makes sense to add user-visible functions such as strtoi128 at the same time - no such functions are in the standard, but something like them would be needed internally as part of the scanf implementation, and it's likely they would be useful for users as well.) -- Joseph S. Myers josmyers@redhat.com