This is an archive of the discontinued LLVM Phabricator instance.

[Clang][ARM] Define __VFP_FP__ macro unconditionally
ClosedPublic

Authored by vhscampos on Apr 13 2021, 2:06 AM.

Details

Summary

Clang only defines VFP_FP when the FPU is enabled. However, gcc
defines it unconditionally.

This patch aligns Clang with gcc.

Diff Detail

Event Timeline

vhscampos created this revision.Apr 13 2021, 2:06 AM
vhscampos requested review of this revision.Apr 13 2021, 2:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2021, 2:06 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
peter.smith accepted this revision.Apr 14 2021, 5:27 AM
peter.smith added reviewers: compnerd, rengolin.
peter.smith added a subscriber: peter.smith.

I think this is the right thing to do. GCC changed to unconditionally set the macro with https://gcc.gnu.org/legacy-ml/gcc-patches/2016-10/msg01025.html my understanding is that the macro means that floating point representation uses the VFP format and not the FPA format (predecessor to VFP, not supported by clang, found in very old systems), it does not mean that there is a VFP unit present.

see https://wiki.debian.org/ArmEabiPort for the mutually exclusive __MAVERICK__ whcih refers to https://wiki.debian.org/ArmEabiMaverickCrunch the processor that had the FPA FPU.

I've set LGTM, and added a few more non-Arm people involved in the area for visibility, will be good to give them a chance to comment before committing.

clang/lib/Basic/Targets/ARM.cpp
758

Worth a comment like "VFP_FP means that the floating point format is VFP, not that a hardware FPU is present. The VFP format is the only one supported by clang."

This revision is now accepted and ready to land.Apr 14 2021, 5:27 AM
vhscampos updated this revision to Diff 337723.Apr 15 2021, 5:05 AM

Add a clarifying comment.

vhscampos marked an inline comment as done.Apr 15 2021, 5:05 AM

Thanks Peter. Since one week has passed, I plan to commit these changes by the end of the day if nothing surfaces.

rengolin accepted this revision.Apr 21 2021, 2:48 AM

It's a weird flag, for sure, but if that's the semantics of it, than this change LGTM. Thanks!

This revision was automatically updated to reflect the committed changes.