From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14A8C3857702; Wed, 24 May 2023 12:46:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14A8C3857702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684932386; bh=5dM9OsuVOX6hVZDp4rXwwYq7XTDWnbOYU9efTy9fwOo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QiOrgB9ifRbGYZaw92ac5wu1P+2wwVy4wJw4UZMGR58pmqtVx7t9JYbbmqqy0GuKd JbGsXuYxLDKFva3pyeX9hGKW58f7YFxSBooW8Qc6Qluj8jJC3+0VvQ/Xd3jBHvJo3k dwKk4RdtteGeZlDmtD9oia50AsPqCQyBfW5vXzag= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102989] Implement C2x's n2763 (_BitInt) Date: Wed, 24 May 2023 12:46:25 +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: rguenther at suse dot de 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 #44 from rguenther at suse dot de --- On Wed, 24 May 2023, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102989 >=20 > Jakub Jelinek changed: >=20 > What |Removed |Added > -------------------------------------------------------------------------= --- > Attachment #55141|0 |1 > is obsolete| | >=20 > --- Comment #43 from Jakub Jelinek --- > Created attachment 55148 > --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55148&action=3Dedit > gcc14-bitint-wip.patch >=20 > Another update. This version can emit _BitInt(N) values in non-automatic > variable initializers, handles passing/returning _BitInt(N) and for N <= =3D 64 > (i.e. what fits into a single limb) from what I can see handling it in GI= MPLE > passes and and even expansion/RTL seems to work. > Now, as discussed earlier, for N > GET_MODE_PRECISION (limb_mode) I think= we > want to lower it in some pass in between IPA and vectorization. For N wh= ich > fits into DImode if limb is 32-bit (currently no target does that as we h= ave > just x86-64 support) or which fits into TImode for 64-bit if TImode is > supported, I guess we want to map arithmetics > to TImode arithmetics, for say 2-4x larger emit code for arithmetics (exc= ept > perhaps multiplication/division) inline as straight line code and for even > larger as loops. > In the last case, a question is if we could use e.g. TARGET_MEM_REF for t= he > variable offset in those loops on the vars even when they aren't > TREE_ADDRESSABLE (but would force them into memory during expansion). Note you should use TARGET_MEM_REF only when it describes the actual addressing mode you want to use. Otherwise just synthesize ARRAY_REFs like ARRAY_REF , index> with an appropriate VLA libm[] array type. I'd do the lowering right before pass_complete_unrolli and generally emit loopy form (another pass placement required in the -Og pipeline).=