https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127177

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hongyu Wang <[email protected]>:

https://gcc.gnu.org/g:6d1b92ce276d4705b12c21723f94238a9d34b055

commit r17-4240-g6d1b92ce276d4705b12c21723f94238a9d34b055
Author: Hongyu Wang <[email protected]>
Date:   Thu Sep 10 15:50:06 2026 +0800

    i386: Don't turn quiet FP comparisons into signaling ones [PR127177]

    The unordered compares (UNLT, UNLE, UNGT, UNGE and UNEQ) must not raise
    FE_INVALID on a quiet NaN.  AVX and AVX512 have an imm8 encoding for the
    quiet _UQ predicate of each, so just select it.

    Legacy SSE2 has only 8 predicates and can express UNGE/UNGT/UNLT/UNLE
    only as the signaling NLT/NLE, so reject those four codes in the packed
    FP vec_cmp expanders when trapping math is in effect and NaNs are honored.

    gcc/ChangeLog:

            PR target/127177
            * config/i386/i386-expand.cc (ix86_fp_cmp_code_to_pcmp_immediate):
            Return the _UQ predicate immediates for UNLE, UNLT, UNGE, UNGT and
            UNEQ.
            * config/i386/i386.cc (ix86_print_operand):Likewise to print the
            _uq suffixed AVX predicates for these codes.
            * config/i386/predicates.md (ix86_fp_vec_cmp_operator): New
            predicate.
            * config/i386/sse.md (vec_cmp<mode><sseintvecmodelower>): Use the
            new predicate for the VF_128 compare.
            * config/i386/mmx.md (vec_cmpv2sfv2si): Likewise.

    gcc/testsuite/ChangeLog:

            PR target/127177
            * gcc.target/i386/pr127177-1.c: New test.
            * gcc.target/i386/pr127177-2.c: Likewise.
            * gcc.target/i386/pr127177-3.c: Likewise.
            * gcc.target/i386/pr127177-4.c: Likewise.
            * gcc.target/i386/pr127177-5.c: Likewise.

Reply via email to