From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9877F3857421; Fri, 28 Oct 2022 09:47:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9877F3857421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666950470; bh=m6pfaDq0QXNrBE/Nb+gf1LsSPjC35KvXcAlc7BC4vXg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NODv7MYJdBasAdCxWr15Q4U9L+EfcTseQMJ95Doy8tau+OZDV4Bd0omtedUU1lAsD oIK2lQ7mtp1gNG6ehJ8Cw9nqbrNaIRwD2kEICrcw4Sn084eoR9g0nFnY4YFHGcXPLQ 6cYMy5nfYaZJiVfunT7bI67WQ3KTfWylHJO5YknQ= From: "rguenth 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 09:47:46 +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: rguenth 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 #26 from Richard Biener --- Some random comments. I wouldn't go with a new tree code, given semantics are INTEGER_TYPE it sho= uld be an INTEGER_TYPE. The TYPE_PRECISION issue is real - we have 16 spare bi= ts in tree_type_common so we could possibly afford to make it 16 bits. Does t= he C standard limit the number of bits? Does it allow implementation defined limits? As of SSA representation and "lowering" this feels much like Middle-End Arr= ay Expressions in the end. I agree that first and foremost we should have the types as registers but then we can simply lower early to a representati= on supported by the target? AKA make _BitInt(199) intfast_t[n] with appropria= te 'n' and lower all accesses, doing arithmetic either via builtins or internal functions on the whole object. 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). 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 stab.=