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

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

https://gcc.gnu.org/g:e44dc11c4d9b80e2dce5a91c0ff07606a3b527b0

commit r17-3585-ge44dc11c4d9b80e2dce5a91c0ff07606a3b527b0
Author: H.J. Lu <[email protected]>
Date:   Wed Aug 19 11:42:38 2026 +0800

    x86: Expand the default truncsfbf2 like vcvtneps2bf16

    Expand default truncsfbf2 like vcvtneps2bf16, which doesn't honor SNAN,
    turns sNAN into qNAN quietly, it always rounds to nearest even and
    flushes input denormals to zero, with

    (fromi + 0x7fff + ((fromi >> 16) & 1)) >> 16

    and flush input denormals to zero.

    gcc/

            PR target/126933
            * config/i386/i386-expand.cc (ix86_expand_truncsfbf2): New.
            * config/i386/i386-protos.h (ix86_expand_truncsfbf2): Likewise.
            * config/i386/i386.md (truncsfbf2): Changed to define_expand
            and update comments.
            (truncsfbf2_vcvtneps2bf16): New.

    gcc/testsuite/

            PR target/126933
            * gcc.target/i386/truncsfbf-1.c (dg-options): Add
            -mno-avxneconvert -mno-avx512bf16.  Use check-function-bodies to
            check updated codegen.
            * gcc.target/i386/truncsfbf-2.c (dg-options): Add
            -mno-avxneconvert -mno-avx512bf16.
            (foo): Make it static with __attribute__ ((noipa, noinline)).
            (CALC): Add __attribute__ ((noipa, noinline)).  Flush input
            denormal to zero.
            (main): Add tests for float denormal inputs.
            * gcc.target/i386/truncsfbf-3.c: New test.
            * gcc.target/i386/truncsfbf-4.c: Likewise.
            * gcc.target/i386/truncsfbf-5.c: Likewise.
            * gcc.target/i386/truncsfbf-6.c: Likewise.

    Signed-off-by: H.J. Lu <[email protected]>

Reply via email to