https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108477
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Roger Sayle <[email protected]>: https://gcc.gnu.org/g:cc195978102e2076c4426b4dfbe457d2f223ae83 commit r17-4875-gcc195978102e2076c4426b4dfbe457d2f223ae83 Author: Roger Sayle <[email protected]> Date: Sun Oct 4 19:58:11 2026 +0100 i386: Ensure the x86 backend is any-or-plus (AOP) safe. This patch tweaks i386.md to ensure that it is AOP-safe, i.e. can recognize shld and shrd instructions when expressed in RTL using either PLUS, IOR or XOR. This is a pre-requisite to fixing PR tree-optimization/108477. This patch also documents aop_optab by definining and describing the aop<mode>3 named pattern (as requested by Richard Biener). 2026-10-04 Roger Sayle <[email protected]> Uros Bizjak <[email protected]> gcc/ChangeLog * config/i386/i386.md: Various whitespace and indentation clean-ups. (aop_name_pfx): New code attribute to produce "*" for XOR/PLUS. (x86_64_shld<nf_name>): Use any_or_plus and aop_name_pfx. (x86_64_shld_ndd<nf_name>): Likewise. (x86_64_shld_1<nf_name>): Likewise. (x86_64_shld_ndd_1<nf_name>): Likewise. (*x86_64_shld_shrd_1_nozext_nf): Use any_or_plus. (*x86_64_shld_shrd_1_nozext): Likewise. (*x86_64_shld_2): Likewise. (*x86_64_shld_ndd_2): Likewise. (x86_shld<nf_name>): Use any_or_plus and aop_name_pfx. (x86_shld_1<nf_name>): Likewise. (x86_shld_ndd_1<nf_name>): Likewise. (*x86_shld_shrd_1_nozext_nf): Use any_or_plus. (*x86_shld_shrd_1_nozext): Likewise. (*x86_shld_2): Likewise. (*x86_shld_ndd_2): Likewise. (x86_64_shrd<nf_name>): Use any_or_plus and aop_name_pfx. (x86_64_shrd_ndd<nf_name>): Likewise. (x86_64_shrd_1<nf_name>): Likewise. (x86_64_shrd_ndd_1<nf_name>): Likewise. (*x86_64_shrd_shld_1_nozext_nf): Use any_or_plus. (*x86_64_shrd_shld_1_nozext): Likewise. (*x86_64_shrd_2): Likewise. (*x86_64_shrd_ndd_2): Likewise. Fix match_dup operand numbering. (x86_shrd<nf_name>): Use any_or_plus and aop_name_pfx. (x86_shrd_ndd<nf_name>): Likewise. (x86_shrd_1<nf_name>): Likewise. (x86_shrd_ndd_1<nf_name>): Likewise. (*x86_shrd_shld_1_nozext_nf): Use any_or_plus. (*x86_shrd_shld_1_nozext): Likewise. (*x86_shrd_2): Likewise. (*x86_shrd_ndd_2): Likewise. * doc/md.texi: Document aop<mode>3 as a named pattern.
