This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Don't #define __ARM_FP when there's no FPU.
ClosedPublic

Authored by simon_tatham on Mar 10 2023, 3:42 AM.

Details

Summary

On some R-profile CPUs, leaving out the FPU is an option. Clang will
accept -march=armv8-r+nofp, but it's currently not possible to find
out via the preprocessor whether it's in that mode (e.g. to change or
disable inline asm statements in your code).

The __ARM_FP macro, which has a bit set for each size of floating
point number supported by the hardware, is the natural thing to test.
But Clang was defining it unconditionally on AArch64. Now it checks
for FP support before defining it at all.

Diff Detail

Event Timeline

simon_tatham created this revision.Mar 10 2023, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2023, 3:42 AM
simon_tatham requested review of this revision.Mar 10 2023, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2023, 3:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Mar 10 2023, 8:58 AM
tmatheson accepted this revision.Mar 13 2023, 9:10 AM

LGTM

clang/lib/Basic/Targets/AArch64.h
29–33

clang-format please

This revision was landed with ongoing or failed builds.Mar 13 2023, 9:43 AM
This revision was automatically updated to reflect the committed changes.