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 tree-optimization/103857] implement ternary without jump (and comparison) Date: Wed, 29 Dec 2021 13:03:32 +0000 [thread overview] Message-ID: <bug-103857-4-tWcYPrfw0q@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103857-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103857 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I don't think that's equivalent. For a[i] equal to b it will be and similarly it will be for a[i] equal to c, but not for all the other values. E.g. 13 == 42 ? 24 : 42 is 42, but 13 ^ (24 ^ 42) is 63. So, we could do this only if something assures us that a[i] only has 2 possible values, either equal to b or to c. So that would rule out non-constant b or c, perhaps it could be done if value range is two adjacent constants equal to b and c, or perhaps if the non-zero bits has a single bit and one of b or c is 0 and the other one is that non-zero bitmask of the other comparison operand.
next prev parent reply other threads:[~2021-12-29 13:03 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-29 12:16 [Bug tree-optimization/103857] New: " drepper.fsp+rhbz at gmail dot com 2021-12-29 13:03 ` jakub at gcc dot gnu.org [this message] 2021-12-29 13:24 ` [Bug tree-optimization/103857] " drepper.fsp+rhbz at gmail dot com 2021-12-29 20:23 ` pinskia at gcc dot gnu.org 2021-12-29 20:26 ` 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-103857-4-tWcYPrfw0q@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).