[mips] Fix definitions of multiply, multiply-add/sub and divide instructions.
[oota-llvm.git] / lib / Target / Mips / MipsSEISelLowering.h
1 //===-- MipsSEISelLowering.h - MipsSE DAG Lowering Interface ----*- C++ -*-===//
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 MipsTargetLowering specialized for mips32/64.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MipsSEISELLOWERING_H
15 #define MipsSEISELLOWERING_H
16
17 #include "MipsISelLowering.h"
18 #include "MipsRegisterInfo.h"
19
20 namespace llvm {
21   class MipsSETargetLowering : public MipsTargetLowering  {
22   public:
23     explicit MipsSETargetLowering(MipsTargetMachine &TM);
24
25     virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const;
26
27     virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
28
29     virtual MachineBasicBlock *
30     EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
31
32     virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
33       if (VT == MVT::Untyped)
34         return Subtarget->hasDSP() ? &Mips::ACRegsDSPRegClass :
35                                      &Mips::ACRegsRegClass;
36
37       return TargetLowering::getRepRegClassFor(VT);
38     }
39
40   private:
41     virtual bool
42     isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
43                                       unsigned NextStackOffset,
44                                       const MipsFunctionInfo& FI) const;
45
46     virtual void
47     getOpndList(SmallVectorImpl<SDValue> &Ops,
48                 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
49                 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
50                 CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const;
51
52     SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
53                         SelectionDAG &DAG) const;
54
55     MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
56                                     MachineBasicBlock *BB) const;
57   };
58 }
59
60 #endif // MipsSEISELLOWERING_H