[clang] [clang] [ARM] Explicitly enable NEON for Windows/Darwin targets (PR #122095)
Adam Nemet via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 09:46:51 PDT 2025
================
@@ -659,13 +659,21 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D,
CPUArgFPUKind != llvm::ARM::FK_INVALID ? CPUArgFPUKind : ArchArgFPUKind;
(void)llvm::ARM::getFPUFeatures(FPUKind, Features);
} else {
+ bool Generic = true;
if (!ForAS) {
std::string CPU = arm::getARMTargetCPU(CPUName, ArchName, Triple);
+ if (CPU != "generic")
+ Generic = false;
llvm::ARM::ArchKind ArchKind =
arm::getLLVMArchKindForARM(CPU, ArchName, Triple);
FPUKind = llvm::ARM::getDefaultFPU(CPU, ArchKind);
(void)llvm::ARM::getFPUFeatures(FPUKind, Features);
}
+ if (Generic && (Triple.isOSWindows() || Triple.isOSDarwin()) &&
----------------
anemet wrote:
Hi @mstorsjo, this breaks Darwin when compiling assembly with armv7s which is neon-vfp4. vfp4 instructions (e.g. vfma) are no longer recognized because you effectively downgraded neon-vfp4 to neon. When `ForAS` you assume a "generic" CPU unconditionally rather than "swift".
https://github.com/llvm/llvm-project/pull/122095
More information about the cfe-commits
mailing list