[PATCH] D48217: [mips][wip] Disable the selection of mixed microMIPS/MIPS code

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 06:47:40 PDT 2018


sdardis created this revision.
sdardis added reviewers: atanasyan, abeserminji, smaksimovic.
Herald added a subscriber: arichardson.

This patch disables the selection of microMIPS and MIPS instructions and 
patterns that are defined in TableGen files. Certain pseudo instructions
are selectable in both modes, but these are expanded by C++ code.

WIP notes: There are still some test failures when this patch is applied.


Repository:
  rL LLVM

https://reviews.llvm.org/D48217

Files:
  lib/Target/Mips/MipsSubtarget.h


Index: lib/Target/Mips/MipsSubtarget.h
===================================================================
--- lib/Target/Mips/MipsSubtarget.h
+++ lib/Target/Mips/MipsSubtarget.h
@@ -286,8 +286,10 @@
   bool inMips16HardFloat() const {
     return inMips16Mode() && InMips16HardFloat;
   }
-  bool inMicroMipsMode() const { return InMicroMipsMode; }
-  bool inMicroMips32r6Mode() const { return InMicroMipsMode && hasMips32r6(); }
+  bool inMicroMipsMode() const { return InMicroMipsMode && !InMips16Mode; }
+  bool inMicroMips32r6Mode() const {
+    return inMicroMipsMode() && hasMips32r6();
+  }
   bool hasDSP() const { return HasDSP; }
   bool hasDSPR2() const { return HasDSPR2; }
   bool hasDSPR3() const { return HasDSPR3; }
@@ -303,14 +305,16 @@
   }
   bool useSmallSection() const { return UseSmallSection; }
 
-  bool hasStandardEncoding() const { return !inMips16Mode(); }
+  bool hasStandardEncoding() const {
+    return !inMips16Mode() && !inMicroMipsMode();
+  }
 
   bool useSoftFloat() const { return IsSoftFloat; }
 
   bool useLongCalls() const { return UseLongCalls; }
 
   bool enableLongBranchPass() const {
-    return hasStandardEncoding() || allowMixed16_32();
+    return hasStandardEncoding() || inMicroMipsMode() || allowMixed16_32();
   }
 
   /// Features related to the presence of specific instructions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48217.151501.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180615/7b3749fd/attachment.bin>


More information about the llvm-commits mailing list