File: mips-fpxx-enable.diff

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,236,204 kB
  • sloc: cpp: 7,619,103; ansic: 1,433,921; asm: 1,058,734; python: 252,125; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 10,093; ml: 5,111; perl: 4,720; awk: 3,523; makefile: 3,397; javascript: 2,272; xml: 892; fortran: 770
file content (45 lines) | stat: -rw-r--r-- 2,143 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Index: llvm-toolchain-snapshot_21~++20250531102322+061ef3c6e227/llvm/lib/Target/Mips/MipsSubtarget.cpp
===================================================================
--- llvm-toolchain-snapshot_21~++20250531102322+061ef3c6e227.orig/llvm/lib/Target/Mips/MipsSubtarget.cpp
+++ llvm-toolchain-snapshot_21~++20250531102322+061ef3c6e227/llvm/lib/Target/Mips/MipsSubtarget.cpp
@@ -81,7 +81,7 @@ MipsSubtarget::MipsSubtarget(const Tripl
       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),
+      UseTCCInDIV(false), HasSym32(false), HasEVA(false), DisableMadd4(true),
       HasMT(false), HasCRC(false), HasVirt(false), HasGINV(false),
       UseIndirectJumpsHazard(false), StrictAlign(false),
       StackAlignOverride(StackAlignOverride), TM(TM), TargetTriple(TT),
@@ -93,6 +93,9 @@ MipsSubtarget::MipsSubtarget(const Tripl
   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";
@@ -246,6 +249,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);
@@ -268,6 +272,13 @@ MipsSubtarget::initializeSubtargetDepend
     reportFatalUsageError("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;
 }