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 7A6BC385828A for ; Wed, 17 Jan 2024 11:28:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A6BC385828A 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 7A6BC385828A 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-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-59-JHIYlXdpNfmXXOP9mI5bvA-1; Wed, 17 Jan 2024 06:28:25 -0500 X-MC-Unique: JHIYlXdpNfmXXOP9mI5bvA-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40e89a9a763so4651885e9.1 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=Nb0CHjwtnI51DaK7ZxhMpkSTdJZezRyIe3yoEQMaEYU226q70cVFIMucL8mg0xIOvg MVXTD/IBJVBqU2MxCWZDrbnivzXrRbH9aA00MrjYuv/B4S+cnUi5JZSthez9939u/sSG ey2riiS3g5FJur5pYQMe71g7nxeml1QoS1QjwT5uxqXaPGCs591PZcfRH9IBkVhW6yDP BcbrdDBwC5tk+uQt95RyqJixHk8qcj0qTu5t9/HjBm9XBmPR/A4YVu7BknrCGNYBAHn1 lKCGHHK5bQtN/5QrROzZSsW5UWMHKGP08FpxYyeRHoJVzetSEv3JU2YdfIy1pcSKvE+2 7ckQ== X-Gm-Message-State: AOJu0YyRqju7eNuVR8yKZprycpERKf8vgbW9i16kcoAyJHrGLF1ctDjI HCiWKVnrO0NgTr1pffwFgin/itJC6Qh6VQIQf4UlassAl1WxeXMhDToohhWpoThgv3/4Y2TUwuj kWzFf28Sa0/WQxIKks+YvJLY= X-Received: by 2002:a7b:c45a:0:b0:40e:7611:e52f with SMTP id l26-20020a7bc45a000000b0040e7611e52fmr1522971wmi.315.1705490904779; 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.8 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