]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / Mips / Mips16ISelDAGToDAG.h
CommitLineData
970d7e83
LB
1//===---- Mips16ISelDAGToDAG.h - A Dag to Dag Inst Selector for Mips ------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Subclass of MipsDAGToDAGISel specialized for mips16.
11//
12//===----------------------------------------------------------------------===//
13
1a4d82fc
JJ
14#ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
15#define LLVM_LIB_TARGET_MIPS_MIPS16ISELDAGTODAG_H
970d7e83
LB
16
17#include "MipsISelDAGToDAG.h"
18
19namespace llvm {
20
21class Mips16DAGToDAGISel : public MipsDAGToDAGISel {
22public:
23 explicit Mips16DAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
24
25private:
1a4d82fc 26 std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, SDLoc DL,
970d7e83
LB
27 EVT Ty, bool HasLo, bool HasHi);
28
29 SDValue getMips16SPAliasReg();
30
1a4d82fc
JJ
31 bool runOnMachineFunction(MachineFunction &MF) override;
32
970d7e83
LB
33 void getMips16SPRefReg(SDNode *Parent, SDValue &AliasReg);
34
1a4d82fc
JJ
35 bool selectAddr16(SDNode *Parent, SDValue N, SDValue &Base,
36 SDValue &Offset, SDValue &Alias) override;
970d7e83 37
1a4d82fc 38 std::pair<bool, SDNode*> selectNode(SDNode *Node) override;
970d7e83 39
1a4d82fc 40 void processFunctionAfterISel(MachineFunction &MF) override;
970d7e83
LB
41
42 // Insert instructions to initialize the global base register in the
43 // first MBB of the function.
44 void initGlobalBaseReg(MachineFunction &MF);
45
46 void initMips16SPAliasReg(MachineFunction &MF);
47};
48
49FunctionPass *createMips16ISelDag(MipsTargetMachine &TM);
50
51}
52
53#endif