public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/112600] Failed to optimize saturating addition using __builtin_add_overflow
Date: Mon, 22 Jan 2024 12:46:12 +0000	[thread overview]
Message-ID: <bug-112600-4-oSfCTv6qPT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112600-4@http.gcc.gnu.org/bugzilla/>

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #5 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Yeah, this is hurting us a lot on vectors as well:

https://godbolt.org/z/ecnGadxcG

The first one isn't vectorizable and the second one we generates too
complicated code as the pattern vec_cond is expanded to something quite
complicated.

It was too complicated for the intern we had at the time, but I think basically
we should still do the conclusion of this thread no?
https://www.mail-archive.com/gcc@gcc.gnu.org/msg95398.html

i.e. we should just make proper saturating IFN.

The only remaining question is, should we make them optab backed or can we do
something reasonably better for most target with better fallback code.

This seems to indicate yes since the REALPART_EXPR seems to screw things up a
bit.

  parent reply	other threads:[~2024-01-22 12:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 21:40 [Bug middle-end/112600] New: " redi at gcc dot gnu.org
2023-11-17 21:41 ` [Bug middle-end/112600] " redi at gcc dot gnu.org
2023-11-17 21:45 ` redi at gcc dot gnu.org
2023-11-19 21:43 ` pinskia at gcc dot gnu.org
2023-11-20  9:23 ` rguenth at gcc dot gnu.org
2024-01-22 12:46 ` tnfchris at gcc dot gnu.org [this message]
2024-05-16 12:09 ` cvs-commit at gcc dot gnu.org
2024-05-16 12:09 ` cvs-commit at gcc dot gnu.org
2024-05-17 14:57 ` cvs-commit at gcc dot gnu.org
2024-05-18  2:17 ` cvs-commit at gcc dot gnu.org
2024-06-05  8:38 ` cvs-commit at gcc dot gnu.org
2024-06-05 20:42 ` ubizjak at gmail dot com
2024-06-06 17:45 ` cvs-commit at gcc dot gnu.org
2024-06-08 10:19 ` cvs-commit at gcc dot gnu.org
2024-06-09 10:10 ` cvs-commit at gcc dot gnu.org
2024-06-11 16:59 ` cvs-commit 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-112600-4-oSfCTv6qPT@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).