1 //===-- MipsSEISelDAGToDAG.h - A Dag to Dag Inst Selector for MipsSE -----===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Subclass of MipsDAGToDAGISel specialized for mips32/64.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSSEISELDAGTODAG_H
15 #define MIPSSEISELDAGTODAG_H
17 #include "MipsISelDAGToDAG.h"
21 class MipsSEDAGToDAGISel : public MipsDAGToDAGISel {
24 explicit MipsSEDAGToDAGISel(MipsTargetMachine &TM) : MipsDAGToDAGISel(TM) {}
28 virtual bool runOnMachineFunction(MachineFunction &MF);
30 void addDSPCtrlRegOperands(bool IsDef, MachineInstr &MI,
33 unsigned getMSACtrlReg(const SDValue RegIdx) const;
35 bool replaceUsesWithZeroReg(MachineRegisterInfo *MRI, const MachineInstr&);
37 std::pair<SDNode*, SDNode*> selectMULT(SDNode *N, unsigned Opc, SDLoc dl,
38 EVT Ty, bool HasLo, bool HasHi);
40 SDNode *selectAddESubE(unsigned MOp, SDValue InFlag, SDValue CmpLHS,
41 SDLoc DL, SDNode *Node) const;
43 virtual bool selectAddrRegImm(SDValue Addr, SDValue &Base,
44 SDValue &Offset) const;
46 virtual bool selectAddrRegReg(SDValue Addr, SDValue &Base,
47 SDValue &Offset) const;
49 virtual bool selectAddrDefault(SDValue Addr, SDValue &Base,
50 SDValue &Offset) const;
52 virtual bool selectIntAddr(SDValue Addr, SDValue &Base,
53 SDValue &Offset) const;
55 virtual bool selectAddrRegImm12(SDValue Addr, SDValue &Base,
56 SDValue &Offset) const;
58 virtual bool selectIntAddrMM(SDValue Addr, SDValue &Base,
59 SDValue &Offset) const;
61 virtual std::pair<bool, SDNode*> selectNode(SDNode *Node);
63 virtual void processFunctionAfterISel(MachineFunction &MF);
65 // Insert instructions to initialize the global base register in the
66 // first MBB of the function.
67 void initGlobalBaseReg(MachineFunction &MF);
70 FunctionPass *createMipsSEISelDag(MipsTargetMachine &TM);