================ @@ -781,6 +781,30 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D, if (FPUKind == llvm::ARM::FK_FPV5_D16 || FPUKind == llvm::ARM::FK_FPV5_SP_D16) Features.push_back("-mve.fp"); + // If SIMD has been disabled and the selected FPU support NEON, then features + // that rely on NEON Instructions should also be disabled. Cases where NEON + // needs activating to support another feature is handled below with the + // crypto feature. + bool HasSimd = false; + const auto ItSimd = + llvm::find_if(llvm::reverse(Features), + [](const StringRef F) { return F.contains("neon"); }); + const bool FoundSimd = ItSimd != Features.rend(); + const bool FPUSupportsNeon = (llvm::ARM::FPUNames[FPUKind].NeonSupport == + llvm::ARM::NeonSupportLevel::Neon) || + (llvm::ARM::FPUNames[FPUKind].NeonSupport == + llvm::ARM::NeonSupportLevel::Crypto); + if (FoundSimd) + HasSimd = ItSimd->take_front() == "+"; + if (!HasSimd && FPUSupportsNeon) { ---------------- Stylie777 wrote:
I have done this, it is a break from how multiple Features are usually added but it does make a cleaner implementation. https://github.com/llvm/llvm-project/pull/137595 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits