Skip to content

Commit 7436329

Browse files
mstorsjotstellar
authored andcommitted
Revert "[clang] [ARM] Explicitly enable NEON for Windows/Darwin targets (llvm#122095)"
This reverts commit 8fa0f0e. This change broke assembling for e.g. "armv7s-apple-darwin" triples, which should enable VFPv4 by default (and did that before this change), but after this change, only NEON/VFPv3 were available. This is being fixed properly in latest git main as part of llvm#130623 (possibly as a split out change), but any proper fix here seems to have too much potential surprises for an existing release branch.
1 parent a0c8959 commit 7436329

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

clang/lib/Driver/ToolChains/Arch/ARM.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -658,21 +658,13 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D,
658658
CPUArgFPUKind != llvm::ARM::FK_INVALID ? CPUArgFPUKind : ArchArgFPUKind;
659659
(void)llvm::ARM::getFPUFeatures(FPUKind, Features);
660660
} else {
661-
bool Generic = true;
662661
if (!ForAS) {
663662
std::string CPU = arm::getARMTargetCPU(CPUName, ArchName, Triple);
664-
if (CPU != "generic")
665-
Generic = false;
666663
llvm::ARM::ArchKind ArchKind =
667664
arm::getLLVMArchKindForARM(CPU, ArchName, Triple);
668665
FPUKind = llvm::ARM::getDefaultFPU(CPU, ArchKind);
669666
(void)llvm::ARM::getFPUFeatures(FPUKind, Features);
670667
}
671-
if (Generic && (Triple.isOSWindows() || Triple.isOSDarwin()) &&
672-
getARMSubArchVersionNumber(Triple) >= 7) {
673-
FPUKind = llvm::ARM::parseFPU("neon");
674-
(void)llvm::ARM::getFPUFeatures(FPUKind, Features);
675-
}
676668
}
677669

678670
// Now we've finished accumulating features from arch, cpu and fpu,

clang/test/Driver/arm-mfpu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,8 @@
356356
// CHECK-HF-DAG: "-target-cpu" "arm1176jzf-s"
357357

358358
// RUN: %clang -target armv7-apple-darwin -x assembler %s -### -c 2>&1 \
359-
// RUN: | FileCheck --check-prefix=ASM-NEON %s
360-
// RUN: %clang -target armv7-windows -x assembler %s -### -c 2>&1 \
361-
// RUN: | FileCheck --check-prefix=ASM-NEON %s
362-
// ASM-NEON: "-target-feature" "+neon"
359+
// RUN: | FileCheck --check-prefix=ASM %s
360+
// ASM-NOT: -target-feature
363361

364362
// RUN: %clang -target armv8-linux-gnueabi -mfloat-abi=soft -mfpu=none %s -### -c 2>&1 \
365363
// RUN: | FileCheck --check-prefix=CHECK-SOFT-ABI-FP %s

clang/test/Preprocessor/arm-target-features.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -132,30 +132,6 @@
132132
// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_ARCH_EXT_IDIV__ 1
133133
// CHECK-V7VE-DEFAULT-ABI-SOFT: #define __ARM_FP 0xc
134134

135-
// RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-DARWIN-V7 %s
136-
// CHECK-DARWIN-V7: #define __ARMEL__ 1
137-
// CHECK-DARWIN-V7: #define __ARM_ARCH 7
138-
// CHECK-DARWIN-V7: #define __ARM_ARCH_7A__ 1
139-
// CHECK-DARWIN-V7-NOT: __ARM_FEATURE_CRC32
140-
// CHECK-DARWIN-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
141-
// CHECK-DARWIN-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
142-
// CHECK-DARWIN-V7: #define __ARM_FP 0xc
143-
// CHECK-DARWIN-V7: #define __ARM_NEON 1
144-
// CHECK-DARWIN-V7: #define __ARM_NEON_FP 0x4
145-
// CHECK-DARWIN-V7: #define __ARM_NEON__ 1
146-
147-
// RUN: %clang -target armv7-windows -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-WINDOWS-V7 %s
148-
// CHECK-WINDOWS-V7: #define __ARMEL__ 1
149-
// CHECK-WINDOWS-V7: #define __ARM_ARCH 7
150-
// CHECK-WINDOWS-V7: #define __ARM_ARCH_7A__ 1
151-
// CHECK-WINDOWS-V7-NOT: __ARM_FEATURE_CRC32
152-
// CHECK-WINDOWS-V7-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
153-
// CHECK-WINDOWS-V7-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
154-
// CHECK-WINDOWS-V7: #define __ARM_FP 0xe
155-
// CHECK-WINDOWS-V7: #define __ARM_NEON 1
156-
// CHECK-WINDOWS-V7: #define __ARM_NEON_FP 0x6
157-
// CHECK-WINDOWS-V7: #define __ARM_NEON__ 1
158-
159135
// RUN: %clang -target x86_64-apple-macosx10.10 -arch armv7s -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7S %s
160136
// CHECK-V7S: #define __ARMEL__ 1
161137
// CHECK-V7S: #define __ARM_ARCH 7
@@ -164,9 +140,6 @@
164140
// CHECK-V7S-NOT: __ARM_FEATURE_NUMERIC_MAXMIN
165141
// CHECK-V7S-NOT: __ARM_FEATURE_DIRECTED_ROUNDING
166142
// CHECK-V7S: #define __ARM_FP 0xe
167-
// CHECK-V7S: #define __ARM_NEON 1
168-
// CHECK-V7S: #define __ARM_NEON_FP 0x6
169-
// CHECK-V7S: #define __ARM_NEON__ 1
170143

171144
// RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mfloat-abi=soft -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-VFP-FP %s
172145
// RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mfloat-abi=softfp -x c -E -dM %s | FileCheck -match-full-lines --check-prefix=CHECK-VFP-FP %s

0 commit comments

Comments
 (0)