]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: PR target/115457 Implement missing __ARM_FEATURE_BF16 macro
authorKyrylo Tkachov <ktkachov@nvidia.com>
Thu, 27 Jun 2024 10:40:41 +0000 (16:10 +0530)
committerKyrylo Tkachov <ktkachov@nvidia.com>
Tue, 9 Jul 2024 11:54:16 +0000 (17:24 +0530)
commitd32cfe3352f3863325f8452e83400063b1e71e5b
tree855d4572a5f0a2b2220b9e67036c1def615200b5
parentc98bd715ae4f8405848622387915f4d4b8e30a54
aarch64: PR target/115457 Implement missing __ARM_FEATURE_BF16 macro

The ACLE asks the user to test for __ARM_FEATURE_BF16 before using the
<arm_bf16.h> header but GCC doesn't set this up.
LLVM does, so this is an inconsistency between the compilers.

This patch enables that macro for TARGET_BF16_FP.
Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/

PR target/115457
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
Define __ARM_FEATURE_BF16 for TARGET_BF16_FP.

gcc/testsuite/

PR target/115457
* gcc.target/aarch64/acle/bf16_feature.c: New test.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
(cherry picked from commit c10942134fa759843ac1ed1424b86fcb8e6368ba)
gcc/config/aarch64/aarch64-c.c
gcc/testsuite/gcc.target/aarch64/acle/bf16_feature.c [new file with mode: 0644]