public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103743] PPC: Inefficient equality compare for large 64-bit constants having only 16-bit relevant bits in high part Date: Tue, 20 Dec 2022 03:59:43 +0000 [thread overview] Message-ID: <bug-103743-4-u3Hf6ugi9z@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103743-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103743 --- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jiu Fu Guo <guojiufu@gcc.gnu.org>: https://gcc.gnu.org/g:1060cd2ad00b5174f4f8ef8ca3d8c283e321ffca commit r13-4803-g1060cd2ad00b5174f4f8ef8ca3d8c283e321ffca Author: Jiufu Guo <guojiufu@linux.ibm.com> Date: Tue Dec 20 11:43:57 2022 +0800 rs6000: Optimize cmp on rotated 16bits constant Hi, When checking eq/ne with a constant which has only 16bits, it can be optimized to check the rotated data. By this, the constant building is optimized. As the example in PR103743: For "in == 0x8000000000000000LL", this patch generates: rotldi 3,3,1 ; cmpldi 0,3,1 instead of: li 9,-1 ; rldicr 9,9,0,0 ; cmpd 0,3,9 Compare with previous version: https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600475.html. This patch refactor the code according to review comments. e.g. updating function names/comments/code. This patch pass bootstrap and regtest on ppc64 and ppc64le. Is it ok for trunk? Thanks for comments! BR, Jeff(Jiufu) PR target/103743 gcc/ChangeLog: * config/rs6000/rs6000-protos.h (can_be_rotated_to_lowbits): New. (can_be_rotated_to_positive_16bits): New. (can_be_rotated_to_negative_15bits): New. * config/rs6000/rs6000.cc (can_be_rotated_to_lowbits): New definition. (can_be_rotated_to_positive_16bits): New definition. (can_be_rotated_to_negative_15bits): New definition. * config/rs6000/rs6000.md (*rotate_on_cmpdi): New define_insn_and_split. (eqne): Move earlier. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr103743.c: New test. * gcc.target/powerpc/pr103743_1.c: New test.
next prev parent reply other threads:[~2022-12-20 3:59 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-16 6:46 [Bug target/103743] New: " jens.seifert at de dot ibm.com 2021-12-16 6:49 ` [Bug target/103743] " pinskia at gcc dot gnu.org 2021-12-16 15:06 ` bergner at gcc dot gnu.org 2021-12-16 22:14 ` pthaugen at gcc dot gnu.org 2022-03-15 2:06 ` guojiufu at gcc dot gnu.org 2022-03-15 7:32 ` guojiufu at gcc dot gnu.org 2022-03-16 9:48 ` guojiufu at gcc dot gnu.org 2022-05-16 1:59 ` guojiufu at gcc dot gnu.org 2022-12-20 3:59 ` cvs-commit at gcc dot gnu.org [this message] 2023-01-09 5:29 ` guojiufu 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-103743-4-u3Hf6ugi9z@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).