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

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

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

commit r16-10022-g6def98963e5c1e174318d513a8dd45b1002090ae
Author: Hongyu Wang <[email protected]>
Date:   Tue Nov 24 16:25:45 2026 +0800

    i386: Compare BFmode EQ/NE in SFmode when NaNs are honored [PR128985]

    vcomisbf16 sets the flags like comiss, so EQ and NE need both ZF and PF,
    but under -mavx10.2 -fno-trapping-math they were treated as single-flag
    tests and NaN operands compared equal. Convert BFmode EQ/NE to SFmode
    when HONOR_NANS then vucomxss handles it with one flag correctly.

    gcc/ChangeLog:

            PR target/128985
            * config/i386/i386-expand.cc (ix86_prepare_fp_compare_args):
            Convert BFmode EQ/NE to SFmode under AVX10.2 when NaNs are honored.

    gcc/testsuite/ChangeLog:

            PR target/128985
            * gcc.target/i386/avx10_2-comibf-1.c: Adjust scan.
            * gcc.target/i386/avx10_2-comibf-3.c: Likewise.
            * gcc.target/i386/avx10_2-comibf-2.c: Test NaN.
            * gcc.target/i386/avx10_2-comibf-5.c: New test.
            * gcc.target/i386/avx10_2-comibf-6.c: Likewise.

    (cherry picked from commit 48688cfeadf6ec3b2dd22783f5048db6fc444d04)

Reply via email to