[llvm] r201694 - [mips] In the integrated assembler, select the default feature bits by changing the CPU value.

Daniel Sanders daniel.sanders at imgtec.com
Wed Feb 19 08:13:26 PST 2014


Author: dsanders
Date: Wed Feb 19 10:13:26 2014
New Revision: 201694

URL: http://llvm.org/viewvc/llvm-project?rev=201694&view=rev
Log:
[mips] In the integrated assembler, select the default feature bits by changing the CPU value.
    
This is consistent with the way CodeGen acheives this. However, CodeGen
always selects mips32 (even when the architecture is mips64).


Modified:
    llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp

Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=201694&r1=201693&r2=201694&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp Wed Feb 19 10:13:26 2014
@@ -39,27 +39,6 @@
 
 using namespace llvm;
 
-static std::string ParseMipsTriple(StringRef TT, StringRef CPU) {
-  std::string MipsArchFeature;
-  Triple TheTriple(TT);
-
-  if (TheTriple.getArch() == Triple::mips ||
-      TheTriple.getArch() == Triple::mipsel) {
-    if (CPU.empty() || CPU == "mips32") {
-      MipsArchFeature = "+mips32";
-    } else if (CPU == "mips32r2") {
-      MipsArchFeature = "+mips32r2";
-    }
-  } else {
-      if (CPU.empty() || CPU == "mips64") {
-        MipsArchFeature = "+mips64";
-      } else if (CPU == "mips64r2") {
-        MipsArchFeature = "+mips64r2";
-      }
-  }
-  return MipsArchFeature;
-}
-
 static MCInstrInfo *createMipsMCInstrInfo() {
   MCInstrInfo *X = new MCInstrInfo();
   InitMipsMCInstrInfo(X);
@@ -74,15 +53,17 @@ static MCRegisterInfo *createMipsMCRegis
 
 static MCSubtargetInfo *createMipsMCSubtargetInfo(StringRef TT, StringRef CPU,
                                                   StringRef FS) {
-  std::string ArchFS = ParseMipsTriple(TT,CPU);
-  if (!FS.empty()) {
-    if (!ArchFS.empty())
-      ArchFS = ArchFS + "," + FS.str();
+  if (CPU.empty()) {
+    Triple TheTriple(TT);
+    // FIXME: CodeGen picks mips32 in both cases.
+    if (TheTriple.getArch() == Triple::mips ||
+        TheTriple.getArch() == Triple::mipsel)
+      CPU = "mips32";
     else
-      ArchFS = FS;
+      CPU = "mips64";
   }
   MCSubtargetInfo *X = new MCSubtargetInfo();
-  InitMipsMCSubtargetInfo(X, TT, CPU, ArchFS);
+  InitMipsMCSubtargetInfo(X, TT, CPU, FS);
   return X;
 }
 





More information about the llvm-commits mailing list