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 06CFB3857C72 for ; Wed, 17 Jan 2024 07:42:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06CFB3857C72 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 06CFB3857C72 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=1705477343; cv=none; b=Djz+D61HlHpnex/ehW7G/AMNI95r3G1Sw2LJsFl7kmvALzUXe1pbOgLUsPaWFAGLRh9gZwLs49ehxxiO9FQ/UUYLDMLojtlyhAKxlgSPHqAwpKqcmTJcAPbqvAiEPr1blvSFywWkSMT1fy0gbiTs0OTRon3lMEgQzSI+ASGge5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705477343; c=relaxed/simple; bh=DUGEOgGToap+rJ0HyOcC0bpotb+0Q27iVcuBeiIOdVk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Q8ADZ19DYQNQx4kzNyKzkPqulDGl9WYAVoyQegQh/A3VctXUdsOdvaDvvJwLKj/gaagvYn9LvSHLCre1sdeTtXCvwhbZxIUKzIA2E74ba0TU5vAa/eloyKr+/291ASPNulqskNLkY5/2LDRSNYPU6vkOiVvJ5S4T9C+7qxAWnIg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705477340; 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=vAVvl76/ZR4lwmtLGO45PX/K7mCS8tcMst1yCbwdnkY=; b=L+7kGP6ZVfEU0lXgbVH6R6X5Hsx+qrKYfsi5QO5v8PCVJCtEow6ZBiW6dGTOmqf78JfcXk l97nGaNYznDS0OrmllCO4/6l6h7rNtK1VPF7MsZ1OwJ6B7c7KvKtPhplMseR/q29NPgkRf cBgy4cS71l7srfFz6TQQDO2Iza0wZWw= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-ujye35GONASAwrot8902SQ-1; Wed, 17 Jan 2024 02:42:18 -0500 X-MC-Unique: ujye35GONASAwrot8902SQ-1 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-5e744f7ca3bso168566517b3.2 for ; Tue, 16 Jan 2024 23:42:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705477338; x=1706082138; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vAVvl76/ZR4lwmtLGO45PX/K7mCS8tcMst1yCbwdnkY=; b=AWclC5TFhBwr3+Hj84cAChJE8mRc+Lt+oEdVndM5P0Ftk6hpZ7xoocX+SGqKH/bq4C ZAN+s+dritY8xNMATb8lLJeE0FGJN+0lVhs6N0PYOmF5mLZE+K4uMUAf0VxAkWT1RUjY IhaLBjK1w6KepZhgTAHEwkxkszoKSVa716CQ1BGQbNGHz7S8DJ1HhJPfv+ReiicE8cXZ DJzlehy3mqq9bZcePPV1HuiQVKSbHCxzo/M4/cnNL679NI0Y8zNXLOA6C8zK+2Ra8OZ/ g6184nY1TX6FWpqXxplGYF4jc8zpO5Oy71HQ0kAbnMioNhlpwbLwZx/RQnGs7GY2ihZn ZlAw== X-Gm-Message-State: AOJu0Yxbkf0w46uUQvlFK2TYb7aMjsIwxbEYcFI7/+qyCWQ/PYEsgd/P HmZHAS+7TOnL9+ZUrM2UKByoEJ2CIWGCkgpkVSzccz5dSkBezSpuChf4ZSuVOOtw59/Vpw994iq mKEP9nLtjOArLsTHS4/ZnJZ9wGmn0ZpzN9nA87D2+Lg== X-Received: by 2002:a81:57c6:0:b0:5f7:a46:6bfd with SMTP id l189-20020a8157c6000000b005f70a466bfdmr5409921ywb.14.1705477338328; Tue, 16 Jan 2024 23:42:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdWfKp+umqufArzOsISuRveS4aJhJdQsllUQ15C+6g5yAf4+0gyAi3HP1F3PVf1uVbct0Q+FkSyKo/jSkltOA= X-Received: by 2002:a81:57c6:0:b0:5f7:a46:6bfd with SMTP id l189-20020a8157c6000000b005f70a466bfdmr5409916ywb.14.1705477338146; Tue, 16 Jan 2024 23:42:18 -0800 (PST) MIME-Version: 1.0 References: <20240110194031.2384005-1-kmatsui@gcc.gnu.org> <20240110194031.2384005-2-kmatsui@gcc.gnu.org> <25fff4d0-f560-4cb9-9180-6ec6620dfaa4@redhat.com> In-Reply-To: <25fff4d0-f560-4cb9-9180-6ec6620dfaa4@redhat.com> From: Jonathan Wakely Date: Wed, 17 Jan 2024 07:42:02 +0000 Message-ID: Subject: Re: [PATCH 01/14] c++: Implement __is_integral built-in trait To: Jason Merrill Cc: Jonathan Wakely , libstdc++@gcc.gnu.org, Ken Matsui , gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 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,URIBL_SBL_A 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 at 00:31, Jason Merrill wrote: > > On 1/10/24 04:22, Ken Matsui wrote: > > +/* Return true if T is an integral type. With __STRICT_ANSI__, __int128 and > > + unsigned __int128 are not integral types. */ > > This really needs a rationale, since they are actually integer types. I > know __int128 is considered an extension rather than an extended integer > type under the standard, but is there a writeup we can point to for why? > > And even if we don't want to subject it to all the standard requirements > of an extended integer type, why not still say it's an integral type? > flag_iso is only supposed to disable features that could conflict with > obscure but standard-conforming code, and since __int128 is in the > reserved namespace, I'd think it should be safe to support (to the > degree that we do) regardless of flag_iso. The reason for __int128 not being an integral type is because the standard says that intmax_t must be the largest standard or extended integer type, and intmax_t is fixed by ABI to be a 64-bit type. As a result, GCC has historically said that 128-bit integer types are not part of the "standard or extended integer type"classification, in Joseph's words they're sui generis types. But C2x and C++23 changed this, and now we can just do the obvious, simple thing and say that 128-bit integer types are integer types. This changed with https://cplusplus.github.io/LWG/issue3828 for C++. 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.