From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 619933856161; Fri, 28 Oct 2022 10:32:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 619933856161 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666953152; bh=POO8VpiTmNK8AwocIzna/Ep6reAk5cu6gcKDsaQKB8w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NQvCOBCcy5919RkqR+yrH04AfQA5Q3/C4lKQRed1ybwsN9zFJ1lHWNG8kXqpzJjsi plm2cQ4imv/iWiG5Gv/hDfSVTpRFZuIriPTB442q+wpYA0yeqdyhWPdi/opQK9Orfb zdbsRgjq6t7IYie1GXVPQPCMqVxlNk3N6zFZUwgU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102989] Implement C2x's n2763 (_BitInt) Date: Fri, 28 Oct 2022 10:32:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102989 --- Comment #27 from Jakub Jelinek --- (In reply to Richard Biener from comment #26) > Does the C standard limit the number of bits? Does it allow > implementation defined limits? The latter. limits.h defines BITINT_MAXWIDTH, which must be at least as la= rge as number of bits in unsigned long long. AFAIK LLVM plans 8388608 maximum = (but due to the missing library support uses 128 as maximum right now). > Constants are tricky indeed but I suppose there's no way to write a > 199 bit integer constant in source? We can always resort to constants > of the intfast_t[n] representation (aka a CTOR). One can specify even very large constants in the source. 123456789123456789123456789123456789123456789123456789123456789123456789123= 456789123456789123456789123456789123456789123456789123456789123456789123456= 789123456789123456789123456789123456789123456789123456789uwb will be _BitInt with the minimum number of bits to store the above unsigned constant. > That said, if C allows us to limit to 128bits then let's do that for now. > 32bit targets will still see all the complication when we give that a sta= b. I'm afraid once we define BITINT_MAXWIDTH, it will become part of the ABI, = so we can't increase it afterwards. Anyway, I'm afraid we probably don't have enough time to implement this properly in stage1, so might need to target GCC 14 with it. Unless somebody spends on it the remaining 2 weeks full time.=