]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Add more forms peephole2 for adc/sbb
authorHu, Lin1 <lin1.hu@intel.com>
Wed, 19 Feb 2025 07:51:40 +0000 (15:51 +0800)
committerHu, Lin1 <lin1.hu@intel.com>
Wed, 4 Jun 2025 05:36:43 +0000 (13:36 +0800)
commit31b887bcc898787a228672d417ec0b33a15b2fb2
tree66a7240ca350d4e39a916b4935c4bb35aebed820
parente1390c2c45186e4843b927e77a102d39a599374a
i386: Add more forms peephole2 for adc/sbb

Enable -mapxf will change some patterns about adc/sbb.

Hence gcc will raise an extra mov like
         movq    8(%rdi), %rax
         adcq    %rax, 8(%rsi), %rax
         movq    %rax, 8(%rdi)
rather than
         movq    8(%rsi), %rax
         adcq    %rax, 8(%rdi)

The patch add more kinds of peephole2 to eliminate the extra mov.

gcc/ChangeLog:

* config/i386/i386.md: Add 4 new peephole2 by swap the original
peephole2's operands' order to support new pattern.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr79173-13.c: New test.
* gcc.target/i386/pr79173-14.c: Ditto.
* gcc.target/i386/pr79173-15.c: Ditto.
* gcc.target/i386/pr79173-16.c: Ditto.
* gcc.target/i386/pr79173-17.c: Ditto.
* gcc.target/i386/pr79173-18.c: Ditto.
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr79173-13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr79173-14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr79173-15.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr79173-16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr79173-17.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr79173-18.c [new file with mode: 0644]