From: Alexandros Lamprineas Date: Sun, 14 Jul 2019 20:31:15 +0000 (+0000) Subject: [TargetParser][ARM] Account dependencies when processing target features X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d6543acf18dbc4e9595c191caa9c0de36505adc;p=clang [TargetParser][ARM] Account dependencies when processing target features Teaches ARM::appendArchExtFeatures to account dependencies when processing target features: i.e. when you say -march=armv8.1-m.main+mve.fp+nofp it means mve.fp should get discarded too. (Split from D63936) Differential Revision: https://reviews.llvm.org/D64048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366031 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Preprocessor/arm-target-features.c b/test/Preprocessor/arm-target-features.c index 95231e2a81..df5af4a933 100644 --- a/test/Preprocessor/arm-target-features.c +++ b/test/Preprocessor/arm-target-features.c @@ -762,12 +762,29 @@ // CHECK-V81M-MVE: #define __ARM_FEATURE_MVE 1 // CHECK-V81M-MVE: #define __ARM_FEATURE_SIMD32 1 -// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-FP %s -// CHECK-V81M-MVE-FP: #define __ARM_FEATURE_DSP 1 -// CHECK-V81M-MVE-FP: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1 -// CHECK-V81M-MVE-FP: #define __ARM_FEATURE_MVE 3 -// CHECK-V81M-MVE-FP: #define __ARM_FEATURE_SIMD32 1 -// CHECK-V81M-MVE-FP: #define __ARM_FPV5__ 1 +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP %s +// CHECK-V81M-MVEFP: #define __ARM_FEATURE_DSP 1 +// CHECK-V81M-MVEFP: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1 +// CHECK-V81M-MVEFP: #define __ARM_FEATURE_MVE 3 +// CHECK-V81M-MVEFP: #define __ARM_FEATURE_SIMD32 1 +// CHECK-V81M-MVEFP: #define __ARM_FPV5__ 1 + +// nofp discards mve.fp +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp+nofp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP-NOFP %s +// CHECK-V81M-MVEFP-NOFP-NOT: #define __ARM_FEATURE_MVE + +// nomve discards mve.fp +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve.fp+nomve -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVEFP-NOMVE %s +// CHECK-V81M-MVEFP-NOMVE-NOT: #define __ARM_FEATURE_MVE + +// mve+fp doesn't imply mve.fp +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve+fp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-FP %s +// CHECK-V81M-MVE-FP: #define __ARM_FEATURE_MVE 1 + +// nodsp discards both dsp and mve +// RUN: %clang -target arm-arm-none-eabi -march=armv8.1-m.main+mve+nodsp -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81M-MVE-NODSP %s +// CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_MVE +// CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_DSP // RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s // CHECK-V81A: #define __ARM_ARCH 8