================ @@ -366,26 +366,50 @@ StringRef ARM::getArchExtFeature(StringRef ArchExt) { } static ARM::FPUKind findDoublePrecisionFPU(ARM::FPUKind InputFPUKind) { + if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE) + return ARM::FK_INVALID; + + const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind]; + + if (ARM::isDoublePrecision(InputFPU.Restriction)) + return InputFPUKind; + + // Otherwise, look for an FPU entry with all the same fields, except + // that it supports double precision. + for (const ARM::FPUName &CandidateFPU : ARM::FPUNames) { + if (CandidateFPU.FPUVer == InputFPU.FPUVer && + CandidateFPU.NeonSupport == InputFPU.NeonSupport && + ARM::has32Regs(CandidateFPU.Restriction) == + ARM::has32Regs(InputFPU.Restriction) && + ARM::isDoublePrecision(CandidateFPU.Restriction)) { + return CandidateFPU.ID; + } + } + + // nothing found + return ARM::FK_INVALID; +} + +static ARM::FPUKind findSinglePrecisionFPU(ARM::FPUKind InputFPUKind) { + if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE) + return ARM::FK_INVALID; + const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind]; // If the input FPU already supports double-precision, then there // isn't any different FPU we can return here. ---------------- john-brawn-arm wrote:
This comment should be above in findDoublePrecisionFPU, the comment here should be the opposite (i.e. should say the input FPU already doesn't have double-precision). https://github.com/llvm/llvm-project/pull/67412 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits