From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 27CFC3858288; Tue, 6 Jun 2023 12:01:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27CFC3858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686052867; bh=LvdWFJ1Kh7iAcaL39gvRZ/mcM1/uCXn8xPCXvEuoBLU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gYQTq8V+wk1hLKGA417hhjxokLQOvPq6HzrUnQ9aRqu6Be/TzTNRlvaQgXd9RHRcF vFXCR/Eh5w3N1cOJ67uihBvH4NS3Ju6NI62meWkqieqMO7D2d9OFxllWjRniywDBB9 vufub3h7CHAQwh9L7OjUh9IOsHUadreaVVlAyrbI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/79173] add-with-carry and subtract-with-borrow support (x86_64 and others) Date: Tue, 06 Jun 2023 12:01:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to attachments.created 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=3D79173 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gn= u.org --- Comment #16 from Jakub Jelinek --- Created attachment 55271 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55271&action=3Dedit gcc14-pr79173-wip.patch Untested WIP (with backend implementation for x86 only so far). Still, need to add/tweak some peephole2s to make pr79173-{1,2,3,4}.c tests clean on both x86-64 and i?86, and then as can be seen in pr79173-5.c need to do = some tweaks so that it pattern recognizes also the pattern recognized __builtin_{add,sub}_overflow instead of those being used directly. C23 is standardizing __builtin_{add,sub,mul}_overflow under the ckd_{add,sub,mul} names, so pattern recognizing it that way is definitely desirable. Oh, and maybe incrementally check what happens if one of the addends or subtrahends are immediate.=