[PATCH] D38620: [mips] Add support for parsing target specific flags for MIR

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 04:11:43 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315451: [mips] Add support for parsing target specific flags for MIR (authored by sdardis).

Changed prior to commit:
  https://reviews.llvm.org/D38620?vs=117972&id=118586#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38620

Files:
  llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp
  llvm/trunk/lib/Target/Mips/MipsInstrInfo.h


Index: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp
@@ -618,3 +618,39 @@
   return true;
 }
 
+std::pair<unsigned, unsigned>
+MipsInstrInfo::decomposeMachineOperandsTargetFlags(unsigned TF) const {
+  return std::make_pair(TF, 0u);
+}
+
+ArrayRef<std::pair<unsigned, const char*>>
+MipsInstrInfo::getSerializableDirectMachineOperandTargetFlags() const {
+ using namespace MipsII;
+
+ static const std::pair<unsigned, const char*> Flags[] = {
+    {MO_GOT,          "mips-got"},
+    {MO_GOT_CALL,     "mips-got-call"},
+    {MO_GPREL,        "mips-gprel"},
+    {MO_ABS_HI,       "mips-abs-hi"},
+    {MO_ABS_LO,       "mips-abs-lo"},
+    {MO_TLSGD,        "mips-tlsgd"},
+    {MO_TLSLDM,       "mips-tlsldm"},
+    {MO_DTPREL_HI,    "mips-dtprel-hi"},
+    {MO_DTPREL_LO,    "mips-dtprel-lo"},
+    {MO_GOTTPREL,     "mips-gottprel"},
+    {MO_TPREL_HI,     "mips-tprel-hi"},
+    {MO_TPREL_LO,     "mips-tprel-lo"},
+    {MO_GPOFF_HI,     "mips-gpoff-hi"},
+    {MO_GPOFF_LO,     "mips-gpoff-lo"},
+    {MO_GOT_DISP,     "mips-got-disp"},
+    {MO_GOT_PAGE,     "mips-got-page"},
+    {MO_GOT_OFST,     "mips-got-ofst"},
+    {MO_HIGHER,       "mips-higher"},
+    {MO_HIGHEST,      "mips-highest"},
+    {MO_GOT_HI16,     "mips-got-hi16"},
+    {MO_GOT_LO16,     "mips-got-lo16"},
+    {MO_CALL_HI16,    "mips-call-hi16"},
+    {MO_CALL_LO16,    "mips-call-lo16"}
+  };
+  return makeArrayRef(Flags);
+}
Index: llvm/trunk/lib/Target/Mips/MipsInstrInfo.h
===================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.h
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.h
@@ -152,6 +152,12 @@
   bool verifyInstruction(const MachineInstr &MI,
                          StringRef &ErrInfo) const override;
 
+  std::pair<unsigned, unsigned>
+  decomposeMachineOperandsTargetFlags(unsigned TF) const override;
+
+  ArrayRef<std::pair<unsigned, const char *>>
+  getSerializableDirectMachineOperandTargetFlags() const override;
+
 protected:
   bool isZeroImm(const MachineOperand &op) const;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38620.118586.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171011/213a1788/attachment.bin>


More information about the llvm-commits mailing list