[mips][msa] Separate the configuration of int/float vector types since they will...
[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     void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
26     void addMSAFloatType(MVT::SimpleValueType Ty,
27                          const TargetRegisterClass *RC);
28
29     virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const;
30
31     virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
32
33     virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
34
35     virtual MachineBasicBlock *
36     EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
37
38     virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
39                                     EVT VT) const {
40       return false;
41     }
42
43     virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
44       if (VT == MVT::Untyped)
45         return Subtarget->hasDSP() ? &Mips::ACC64DSPRegClass :
46                                      &Mips::ACC64RegClass;
47
48       return TargetLowering::getRepRegClassFor(VT);
49     }
50
51   private:
52     virtual bool
53     isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
54                                       unsigned NextStackOffset,
55                                       const MipsFunctionInfo& FI) const;
56
57     virtual void
58     getOpndList(SmallVectorImpl<SDValue> &Ops,
59                 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
60                 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
61                 CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const;
62
63     SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
64     SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
65
66     SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
67                         SelectionDAG &DAG) const;
68
69     SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
70     SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
71     SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
72
73     MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
74                                     MachineBasicBlock *BB) const;
75     MachineBasicBlock *emitMSACBranchPseudo(MachineInstr *MI,
76                                             MachineBasicBlock *BB,
77                                             unsigned BranchOp) const;
78   };
79 }
80
81 #endif // MipsSEISELLOWERING_H