public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/97437] builtins subcarry and addcarry still not generate the right code. Not get optimized to immediate value
Date: Thu, 15 Oct 2020 14:00:48 +0000	[thread overview]
Message-ID: <bug-97437-4-a7dSEf9rFX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97437-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97437

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #5)
> Trying 7 -> 9:
>     7: r97:SI=0x2a
>     9: {flags:CCC=cmp(r97:SI+r98:SI,r97:SI);r99:SI=r97:SI+r98:SI;}
>       REG_DEAD r98:SI
>       REG_DEAD r97:SI
> Failed to match this instruction:
> (parallel [
>         (set (reg:CC 17 flags)
>             (compare:CC (reg:SI 98 [ *b_12(D) ])
>                 (const_int -42 [0xffffffffffffffd6])))
>         (set (reg:SI 99)
>             (plus:SI (reg:SI 98 [ *b_12(D) ])
>                 (const_int 42 [0x2a])))
>     ])
> 
> On rs6000 we have four special variants for the immediate add-with-carry
> insn patterns: imm 0, imm -1, imm pos, imm neg.  All of these have
> different canonical RTL.

The i386 backend has various patterns for that too, the problem is with that
CCmode vs. CCCmode that was used originally here (otherwise sure, I can add
more).
These patterns ensure only CF is valid and so need to use CCCmode which ensures
that users will only query CF flag and nothing else.

  parent reply	other threads:[~2020-10-15 14:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  8:28 [Bug rtl-optimization/97437] New: " euloanty at live dot com
2020-10-15 11:20 ` [Bug target/97437] " jakub at gcc dot gnu.org
2020-10-15 12:29 ` jakub at gcc dot gnu.org
2020-10-15 12:52 ` jakub at gcc dot gnu.org
2020-10-15 13:47 ` euloanty at live dot com
2020-10-15 13:57 ` segher at gcc dot gnu.org
2020-10-15 13:59 ` segher at gcc dot gnu.org
2020-10-15 14:00 ` jakub at gcc dot gnu.org [this message]
2020-10-15 15:14 ` segher at gcc dot gnu.org
2020-10-15 15:20 ` jakub at gcc dot gnu.org
2020-10-15 17:00 ` segher at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97437-4-a7dSEf9rFX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).