From c67803fb14b32de9b6a6b65359a0d689a45a89ae Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Wed, 21 Dec 2016 20:49:43 +0000 Subject: [PATCH] ARM: define a macro for the FPv5 FPU in ARM mode. FPv5 is in Cortex-M7 and the 64-bit CPUs when running in 32-bit mode. The name is from the Cortex-M7 TRM. llvm-svn: 290268 --- clang/lib/Basic/Targets.cpp | 2 ++ clang/test/Preprocessor/arm-target-features.c | 1 + 2 files changed, 3 insertions(+) diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index f887b05..dd88646 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -5391,6 +5391,8 @@ public: Builder.defineMacro("__ARM_VFPV3__"); if (FPU & VFP4FPU) Builder.defineMacro("__ARM_VFPV4__"); + if (FPU & FPARMV8) + Builder.defineMacro("__ARM_FPV5__"); } // This only gets set when Neon instructions are actually available, unlike diff --git a/clang/test/Preprocessor/arm-target-features.c b/clang/test/Preprocessor/arm-target-features.c index 1a27d5b..f45c5ba 100644 --- a/clang/test/Preprocessor/arm-target-features.c +++ b/clang/test/Preprocessor/arm-target-features.c @@ -389,6 +389,7 @@ // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 // M7-THUMB:#define __ARM_FEATURE_DSP 1 // M7-THUMB:#define __ARM_FP 0xE +// M7-THUMB:#define __ARM_FPV5__ 1 // Test whether predefines are as expected when targeting krait. // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s -- 2.7.4