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

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

https://gcc.gnu.org/g:52330debcdf1fcbb858aa1a07d10c5c286828a97

commit r17-4524-g52330debcdf1fcbb858aa1a07d10c5c286828a97
Author: Matt Turner <[email protected]>
Date:   Mon Sep 21 07:28:28 2026 -0600

    [PATCH 4/5] AArch64: Support HFmode and BFmode in isinf, isfinite and isnan
[PR 66462]

    The isinf, isfinite and isnan expanders are restricted to SFmode and
    DFmode, so _Float16 and __bf16 still classify with FP comparisons.
    Extend them to the two 16-bit formats.

    Neither has 16-bit integer arithmetic, so zero-extend the encoding into
    a word and shift the sign bit out of the top of that instead of out of
    the top of the 16-bit value.

    int isinf1 (_Float16 x) { return __builtin_isinf (x); }

    Before:
            umov    w0, v0.h[0]
            mvni    v30.4h, 0x84, lsl 8
            fcvt    s30, h30
            and     w0, w0, 32767
            dup     v31.4h, w0
            fcvt    s31, h31
            fcmp    s31, s30
            cset    w0, eq
            ret

    After:
            umov    w0, v0.h[0]
            mov     w1, -134217728
            cmp     w1, w0, lsl 17
            cset    w0, eq
            ret

    gcc/ChangeLog:

            PR middle-end/66462
            * config/aarch64/aarch64.md (cmp_swp_<shift>_reg<mode>): Add a
            parameterized name.
            (isinf<mode>2): Use GPF_HF_BF and handle the 16-bit formats.
            (isfinite<mode>2): Likewise.
            (isnan<mode>2): Likewise.

    gcc/testsuite/ChangeLog:

            PR middle-end/66462
            * gcc.target/aarch64/pr66462.c: Add _Float16 and __bf16 tests for
            isinf, isfinite and isnan.

Reply via email to