This is an archive of the discontinued LLVM Phabricator instance.

ARM: define __ARM_VFPV5__ when present.
AcceptedPublic

Authored by t.p.northover on Jul 12 2016, 11:59 AM.

Details

Summary

We've had embedded developers requesting we extend the ARM_VFPVn series to support Cortex-M7, which sounds reasonable apart from the name bikeshedding.

The features added are equivalent to a v8 FPU and the LLVM codebase is pretty split on whether it's fp-armv8 or vfpv5. Since this is user-facing, I thought I'd ask for opinions. The obvious choices are:

  • __ARM_VFPV5__ everywhere (including Cortex-A57 for example). This matches Cortex-M7 naming from ARM, but probably not Cortex-A57. It also matches our historical #defines.
  • __ARM_FPV8__ (or similar) everywhere. Reverse problem from above.
  • Both, depending on whether the CPU really is v8. No naming mismatch, but two #defines for what's essentially the same thing. It's difficult to imagine code actually wanting to distinguish the two.

I've got a mild preference for the first, hence this patch. Any objections or other suggestions?

Tim.

Diff Detail

Event Timeline

t.p.northover retitled this revision from to ARM: define __ARM_VFPV5__ when present..
t.p.northover updated this object.
t.p.northover added reviewers: rengolin, jmolloy.
t.p.northover added a subscriber: cfe-commits.

I don't mind either way, but would be good to be compatible with gcc in that respect. Least surprise and all.

ARM was naming it fpv8 for the command line options and other things, might also be good to keep the consistency.

Would it be too bad to have both?

Hi all

At first glance I thought this would be something that is in the ACLE, so was going to give an opinion. On second look, this is not actually an ACLE macro, and seems to be a clang special - my arm-none-eabi-gcc 5.4.2 does not emit it. I think it would be best to use the right names in all circumstances, although I appreciate the situation has not been made easy by ARM giving two names to the same thing. If that approach is not practical, then Tim's patch is probably ok.

The thinking behind not having this in the ACLE by the way is that ACLE now tries to define feature test macros per architectural feature rather than generationally. The one exception is the __ARM_ARCH macro and it would not be practical to describe all the changes between e.g. ARMv7 and ARMv8 via individual macros. Given that, the meaning of this macro can be expressed by combining the __ARM_ARCH, __ARM_FP and __ARM_FEATURE_FMA macros to pick between VFPv2,VFPv3,...,FP-ARMv8.

rengolin accepted this revision.Oct 4 2016, 5:36 AM
rengolin edited edge metadata.

Hi Tim,

This patch seems stale. I think neither me nor Richard have any strong feelings against this, so I'll just approve and let you decide on which solution is best. I have a mild preference for both.

cheers,
--renato

This revision is now accepted and ready to land.Oct 4 2016, 5:36 AM