]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: x r<< (c - y) to x r>> y etc. optimization [PR117930]
authorJakub Jelinek <jakub@redhat.com>
Sat, 7 Dec 2024 10:40:12 +0000 (11:40 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 7 Dec 2024 10:40:12 +0000 (11:40 +0100)
commit4abcf4ad38a4081f02ed09aed7892a3a6af61cbb
tree94b2bcfd114b3960a2879b18419d6b8f769c10c7
parentb7dd0d976022c5ba20d9d676e2f684614231eb72
i386: x r<< (c - y) to x r>> y etc. optimization [PR117930]

The following patch optimizes x r<< (c - y) to x r>> y,
x r>> (c - y) to x r<< y, x r<< (c + y) to x r<< y and
x r>> (c + y) to x r>> y if c is a multiple of x's bitsize.

2024-12-07  Jakub Jelinek  <jakub@redhat.com>

PR target/117930
* config/i386/i386.md (crotate): New define_code_attr.
(*<insn><mode>3_add, *<insn><mode>3_add_1,
*<insn><mode>3_sub, *<insn><mode>3_sub_1): New define_insn_and_split
patterns plus following define_split for constant first input
operand.

* gcc.target/i386/pr117930.c: New test.
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr117930.c [new file with mode: 0644]