From ebb88a034dfe2228e7cd56fbb269acf7d76f184a Mon Sep 17 00:00:00 2001 From: LLVM Packaging Team Date: Sat, 4 May 2024 07:30:47 +0200 Subject: [PATCH] mips-fpxx-enable =================================================================== Gbp-Pq: Topic mips Gbp-Pq: Name mips-fpxx-enable.diff --- llvm/lib/Target/Mips/MipsSubtarget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/Mips/MipsSubtarget.cpp b/llvm/lib/Target/Mips/MipsSubtarget.cpp index 323e611207..8321f323e6 100644 --- a/llvm/lib/Target/Mips/MipsSubtarget.cpp +++ b/llvm/lib/Target/Mips/MipsSubtarget.cpp @@ -81,7 +81,7 @@ MipsSubtarget::MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, InMips16HardFloat(Mips16HardFloat), InMicroMipsMode(false), HasDSP(false), HasDSPR2(false), HasDSPR3(false), AllowMixed16_32(Mixed16_32 || Mips_Os16), Os16(Mips_Os16), HasMSA(false), UseTCCInDIV(false), HasSym32(false), - HasEVA(false), DisableMadd4(false), HasMT(false), HasCRC(false), + HasEVA(false), DisableMadd4(true), HasMT(false), HasCRC(false), HasVirt(false), HasGINV(false), UseIndirectJumpsHazard(false), StackAlignOverride(StackAlignOverride), TM(TM), TargetTriple(TT), TSInfo(), InstrInfo(MipsInstrInfo::create( @@ -92,6 +92,9 @@ MipsSubtarget::MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, if (MipsArchVersion == MipsDefault) MipsArchVersion = Mips32; + if (hasMips32r6() || hasMips64r6()) + DisableMadd4 = false; + // MIPS-I has not been tested. if (MipsArchVersion == Mips1 && !MIPS1WarningPrinted) { errs() << "warning: MIPS-I support is experimental\n"; @@ -242,6 +245,7 @@ MipsSubtarget & MipsSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM) { StringRef CPUName = MIPS_MC::selectMipsCPU(TM.getTargetTriple(), CPU); + SubtargetFeatures Features(FS); // Parse features string. ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS); @@ -264,6 +268,13 @@ MipsSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS, report_fatal_error("64-bit code requested on a subtarget that doesn't " "support it!"); + for (const std::string &Feature : Features.getFeatures()) { + if (Feature == "+nomadd4") + DisableMadd4 = true; + else if (Feature == "-nomadd4") + DisableMadd4 = false; + } + return *this; } -- 2.30.2