summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/Mips16ISelDAGToDAG.h
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-03-14 18:27:31 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-03-14 18:27:31 +0000
commit554d9312b284265f91ac5ee5bf0351d446f669b1 (patch)
tree0565eb97ee8372ca185b6c0dab33c94081a4c16f /lib/Target/Mips/Mips16ISelDAGToDAG.h
parenta0c9939873c404f272b3e0abb102c335146764fe (diff)
downloadllvm-554d9312b284265f91ac5ee5bf0351d446f669b1.tar.gz
llvm-554d9312b284265f91ac5ee5bf0351d446f669b1.tar.bz2
llvm-554d9312b284265f91ac5ee5bf0351d446f669b1.tar.xz
[mips] Define two subclasses of MipsDAGToDAGISel. Mips16DAGToDAGISel is for
mips16 and MipsSEDAGToDAGISel is for mips32/64. No functionality changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Mips16ISelDAGToDAG.h')
-rw-r--r--lib/Target/Mips/Mips16ISelDAGToDAG.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Target/Mips/Mips16ISelDAGToDAG.h b/lib/Target/Mips/Mips16ISelDAGToDAG.h
new file mode 100644
index 0000000000..e5688d84ca
--- /dev/null
+++ b/lib/Target/Mips/Mips16ISelDAGToDAG.h
@@ -0,0 +1,51 @@
+//===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Subclass of MipsDAGToDAGISel specialized for mips16.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MIPS16ISELDAGTODAG_H
+#define MIPS16ISELDAGTODAG_H
+
+#include "MipsISelDAGToDAG.h"
+
+namespace llvm {
+
+class Mips16DAGToDAGISel : public MipsDAGToDAGISel {
+public:
+ explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
+
+private:
+ std::pair<SDNode*, SDNode*> SelectMULT(SDNode *N, unsigned Opc, DebugLoc dl,
+ EVT Ty, bool HasLo, bool HasHi);
+
+ SDValue getMips16SPAliasReg();
+
+ void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg);
+
+ virtual bool SelectAddr16(SDNode *Parent, SDValue N, SDValue &Base,
+ SDValue &Offset, SDValue &Alias);
+
+ virtual std::pair<bool, SDNode*> SelectNode(SDNode *Node);
+
+ virtual void ProcessFunctionAfterISel(MachineFunction &MF);
+
+ // Insert instructions to initialize the global base register in the
+ // first MBB of the function.
+ void InitGlobalBaseReg(MachineFunction &MF);
+
+ void InitMips16SPAliasReg(MachineFunction &MF);
+};
+
+FunctionPass *createMips16ISelDag(MipsTargetMachine &TM);
+
+}
+
+#endif