https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94790
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:5f19303ada7db92c155332e7ba317233ca05946b commit r12-6538-g5f19303ada7db92c155332e7ba317233ca05946b Author: Haochen Jiang <haochen.ji...@intel.com> Date: Wed Jan 12 10:01:21 2022 +0800 Optimize a ^ ((a ^ b) & mask) to (~mask & a) | (b & mask). From the perspective of the pipeline, `andn + and + ior` version take 2 cycles(AND and ANDN doesn't have dependence), but xor + and + xor will take 3 cycles. - xorl %edi, %esi andl %edx, %esi - movl %esi, %eax - xorl %edi, %eax + andn %edi, %edx, %eax + orl %esi, %eax gcc/ChangeLog: PR target/94790 * config/i386/i386.md (*xor2andn): New define_insn_and_split. gcc/testsuite/ChangeLog: PR target/94790 * gcc.target/i386/pr94790-1.c: New test. * gcc.target/i386/pr94790-2.c: Ditto.