]> git.ipfire.org Git - thirdparty/coreutils.git/commit
build: strengthen 16 bit float support checks
authorGrisha Levit <grishalevit@gmail.com>
Wed, 13 Mar 2024 02:24:34 +0000 (22:24 -0400)
committerPádraig Brady <P@draigBrady.com>
Wed, 13 Mar 2024 11:49:30 +0000 (11:49 +0000)
commit0cafa1524f8fa8c3c9d0b97bad94a9d72077b893
tree26a2b085dd0e7dd16fc06f08a0975088a777573e
parent00a34a05f5a35450a7a9a9df4f8594fc86af7a62
build: strengthen 16 bit float support checks

Recent clang provides __bf16 on aarch64 but it is broken.

If built with -O0, the conversion is wrong:

    $ printf '\x3F\x80' | od --end=big -An -tfB | tr -d ' '
    1.875

If built with -O1 or higher, compilation fails:

    fatal error: error in backend:
    Cannot select: 0xb400007a58d29780: f32 = fp_extend 0xb40000...
    0xb40000...: bf16,ch = CopyFromReg 0xb40000..., Register:bf16 %13
    0xb40000...: bf16 = Register %13
    In function: print_bfloat

The latter issue does not cause the existing configure test to fail
because the promotion is optimized out.

* configure.ac: Ensure 16 bit float promotion code does not get
optimized out, and produces an expected result.
configure.ac