public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108847] [10/11/12/13/14 Regression] unnecessary bitwise AND on boolean types and shifting of the "sign" bit Date: Sat, 27 May 2023 07:02:01 +0000 [thread overview] Message-ID: <bug-108847-4-jOTtnl3UBd@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108847-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108847 --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Just for reference here are the functions I tried to see which way was the best (set_bool0 and set_bool0_ produce the best for x86): void set_bool(bool& fl, __UINT32_TYPE__ value) { bool t = fl; __UINT32_TYPE__ t1 = value>>31; __UINT32_TYPE__ t2 = t; t = t2 | t1; fl = t; } void set_bool0(bool& fl, __UINT32_TYPE__ value) { bool t = fl; __UINT32_TYPE__ t1 = value>>31; bool t3 = t1; t = t | t3; fl = t; } void set_bool0_(bool& fl, __INT32_TYPE__ value) { bool t = fl; __UINT32_TYPE__ t1 = value<0; bool t3 = t1; t = t | t3; fl = t; } void set_bool1(bool& fl, __UINT32_TYPE__ value) { fl |= value >> 31; }
next prev parent reply other threads:[~2023-05-27 7:02 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-19 13:37 [Bug middle-end/108847] New: unnecessary bitwise AND on boolean types lh_mouse at 126 dot com 2023-02-20 18:43 ` [Bug middle-end/108847] " pinskia at gcc dot gnu.org 2023-05-20 1:14 ` [Bug middle-end/108847] unnecessary bitwise AND on boolean types and shifting of the "sign" bit pinskia at gcc dot gnu.org 2023-05-20 23:31 ` pinskia at gcc dot gnu.org 2023-05-20 23:34 ` [Bug middle-end/108847] [10/11/12/13/14 Regression] " pinskia at gcc dot gnu.org 2023-05-20 23:34 ` pinskia at gcc dot gnu.org 2023-05-20 23:36 ` pinskia at gcc dot gnu.org 2023-05-27 6:50 ` pinskia at gcc dot gnu.org 2023-05-27 7:02 ` pinskia at gcc dot gnu.org [this message] 2023-09-17 1:49 ` [Bug middle-end/108847] [11/12/13/14 " pinskia at gcc dot gnu.org 2024-03-08 15:38 ` law at gcc dot gnu.org 2024-05-07 7:40 ` [Bug middle-end/108847] [11/12/13/14/15 " rguenth 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-108847-4-jOTtnl3UBd@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).