[PATCH] D52644: [ARM] Prevent DSP and SIM32 being set for v6m

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 28 02:10:43 PDT 2018


samparker created this revision.
samparker added a reviewer: dmgreen.
Herald added a reviewer: javed.absar.
Herald added subscribers: chrib, kristof.beyls.

My previous change (https://reviews.llvm.org/rL340911) set the two features for architectures >= 6, which wrongly includes v6m. Now set to >= 6 and not Cortex-M.


https://reviews.llvm.org/D52644

Files:
  lib/Basic/Targets/ARM.cpp
  test/Preprocessor/arm-acle-6.4.c


Index: test/Preprocessor/arm-acle-6.4.c
===================================================================
--- test/Preprocessor/arm-acle-6.4.c
+++ test/Preprocessor/arm-acle-6.4.c
@@ -174,15 +174,22 @@
 // CHECK-V7M:     __ARM_FEATURE_SAT 1
 // CHECK-V7M:     __ARM_FEATURE_UNALIGNED 1
 
+// RUN: %clang -target arm-none-linux-eabi -march=armv7-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
 // RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
+// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
+// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m0plus -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
+// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m23 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-NODSP
 // RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
 // RUN: %clang --target=arm-arm-none-eabi -march=armv8m.main+dsp -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP
 
 // CHECK-M-DSP: __ARM_FEATURE_DSP 1
 // CHECK-M-DSP: __ARM_FEATURE_SIMD32 1
 
+// CHECK-M-NODSP-NOT: __ARM_FEATURE_DSP 1
+// CHECK-M-NODSP-NOT: __ARM_FEATURE_SIMD32 1
+
 // RUN: %clang -target arm-none-linux-eabi -march=armv8-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V8A
 
 // CHECK-V8A: __ARM_ARCH 8
Index: lib/Basic/Targets/ARM.cpp
===================================================================
--- lib/Basic/Targets/ARM.cpp
+++ lib/Basic/Targets/ARM.cpp
@@ -663,7 +663,7 @@
   }
 
   // ACLE 6.4.9 32-bit SIMD instructions
-  if (ArchVersion >= 6 || (CPUProfile == "M" && DSP))
+  if ((ArchVersion >= 6 && CPUProfile != "M") || (CPUProfile == "M" && DSP))
     Builder.defineMacro("__ARM_FEATURE_SIMD32", "1");
 
   // ACLE 6.4.10 Hardware Integer Divide


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52644.167444.patch
Type: text/x-patch
Size: 2174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180928/c35d6106/attachment.bin>


More information about the llvm-commits mailing list