i386: Optimize double-word negation [PR51954]
Introduce peephole2 pattern to convert from:
mov %esi, %edx
negl %eax
adcl $0, %edx
negl %edx
to:
xorl %edx, %edx
negl %eax
sbbl %esi, %edx
This conversion is profitable only when initial move is found. Otherwise,
additional move to a temporary together with clearing xor is needed.
2022-04-29 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
PR target/51954
* config/i386/i386.md (adcl/neg -> sbb peephole): New peephole2.
gcc/testsuite/ChangeLog:
PR target/51954
* gcc.target/i386/pr51954.c: New test.