https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128327
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Qin Sun <[email protected]>: https://gcc.gnu.org/g:907a682ed4c23cef244e93ad4c25102029963166 commit r17-6880-g907a682ed4c23cef244e93ad4c25102029963166 Author: Sun, Qin <[email protected]> Date: Mon Nov 30 16:55:09 2026 +0800 i386: Add double-word integer spaceship<mode>4 expander Extend the integer spaceship<mode>4 expander to SWIDWI, so that a double-word <=> (128-bit on x86_64, 64-bit with -m32) is expanded with cmp/sbb/setcc instead of with branches. When the low half of a constant op1 is 0 or -1, one of the two double-word compares is decided by the high halves alone, so emit it as a single-word compare. gcc/ChangeLog: PR target/128327 * config/i386/i386-expand.cc (ix86_expand_setcc_zext): New function. (ix86_expand_doubleword_lt): Ditto. (ix86_expand_int_spaceship_doubleword): Ditto. (ix86_expand_int_spaceship): Call it for double-word modes. Use ix86_expand_setcc_zext. (ix86_expand_fp_spaceship): Use ix86_expand_setcc_zext. * config/i386/i386.md (general_spaceship_operand): New mode attribute. (spaceship<mode>4): Use SWIDWI mode iterator. Use <general_spaceship_operand> for operand 2. gcc/testsuite/ChangeLog: PR target/128327 * gcc.target/i386/spaceship-dwi-1.c: New test. * gcc.target/i386/spaceship-dwi-2.c: Ditto. * gcc.target/i386/spaceship-dwi-3.c: Ditto. * gcc.target/i386/spaceship-dwi-4.c: Ditto. * gcc.target/i386/spaceship-dwi-5.c: Ditto. * gcc.target/i386/spaceship-dwi-6.c: Ditto. * gcc.target/i386/spaceship-dwi-7.c: Ditto. * gcc.target/i386/spaceship-dwi-8.c: Ditto. * gcc.target/i386/spaceship-dwi-9.c: Ditto.
