https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116787
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <[email protected]>: https://gcc.gnu.org/g:92f39bfa356bfd7c79bdde5dd40a1bda7e3d86af commit r17-7016-g92f39bfa356bfd7c79bdde5dd40a1bda7e3d86af Author: liuhongt <[email protected]> Date: Mon Nov 23 23:34:09 2026 -0800 x86: Do V2SF vcond_mask in V4SFmode so that min/max can be formed vec_cmpv2sfv2si compares in V4SFmode but vcond_mask_v2sfv2si selected in V2SFmode, so a two-lane a > b ? a : b as in PR128923 never matched the V4SF min/max splitters and gave cmpltps + blendvps (or andps/andnps/orps) instead of maxps. Widen the arms with movq_v2sf_to_sse like vec_cmpv2sfv2si does and select in V4SFmode. The upper lanes are always zero, so min/max raises no spurious exceptions even with -ftrapping-math. Constant arms are widened with zeros so that a zero arm stays CONST0_RTX. Without -mpartial-vector-fp-math there is no vec_cmpv2sfv2si and so no min or max to form, so keep selecting in V2SFmode there. gcc/ChangeLog: PR target/116787 PR target/128923 * config/i386/mmx.md (vcond_mask_<mode><mmxintvecmodelower>): Use MMXMODEI instead of MMXMODE124. (vcond_mask_v2sfv2si): New expander. gcc/testsuite/ChangeLog: PR target/116787 PR target/128923 * gcc.target/i386/pr128923.c: New test. * gcc.target/i386/pr128923-2.c: New test. * g++.target/i386/pr128923.C: New test. * g++.target/i386/pr128923-run.C: New test.
