public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gabravier at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95906] New: Failure to recognize max pattern with mask Date: Fri, 26 Jun 2020 04:17:55 +0000 [thread overview] Message-ID: <bug-95906-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95906 Bug ID: 95906 Summary: Failure to recognize max pattern with mask Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- typedef int8_t v16i8 __attribute__((__vector_size__ (16))); v16i8 f(v16i8 a, v16i8 b) { v16i8 cmp = (a > b); return (cmp & a) | (~cmp & b); } int f2(int a, int b) { int cmp = -(a > b); return (cmp & a) | (~cmp & b); } f can be optimized to `__builtin_ia32_pmaxsb128` (on x86 with `-msse4`) (the `pmax` instructions can be used for the same pattern with similar types) and `f2` can be optimized to using `MAX_EXPR` (they're essentially the same but I've included the pattern for vectorized types because I originally found this in a function (which was made before SSE4) made for SSE). LLVM does these transformations, but GCC does not.
next reply other threads:[~2020-06-26 4:17 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-26 4:17 gabravier at gmail dot com [this message] 2020-06-26 6:52 ` [Bug tree-optimization/95906] " rguenth at gcc dot gnu.org 2020-06-26 21:23 ` glisse at gcc dot gnu.org 2020-08-05 14:47 ` cvs-commit at gcc dot gnu.org 2020-08-05 15:08 ` glisse at gcc dot gnu.org 2021-07-25 4:37 ` pinskia at gcc dot gnu.org 2023-06-09 15:25 ` pinskia at gcc dot gnu.org 2023-06-09 20:45 ` pinskia at gcc dot gnu.org 2023-06-09 20:48 ` pinskia at gcc dot gnu.org 2023-08-23 2:43 ` pinskia at gcc dot gnu.org 2023-08-23 2:55 ` pinskia at gcc dot gnu.org 2023-08-23 5:18 ` pinskia at gcc dot gnu.org 2023-08-23 5:21 ` pinskia 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-95906-4@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: linkBe 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).