Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 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" |
Akira Hatanaka | 3a34d14 | 2013-03-30 01:12:05 +0000 | [diff] [blame] | 18 | #include "MipsRegisterInfo.h" |
Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | class MipsSETargetLowering : public MipsTargetLowering { |
| 22 | public: |
| 23 | explicit MipsSETargetLowering(MipsTargetMachine &TM); |
| 24 | |
Daniel Sanders | 3c9a0ad | 2013-08-23 10:10:13 +0000 | [diff] [blame] | 25 | void addMSAType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC); |
Jack Carter | babdcc8 | 2013-08-15 12:24:57 +0000 | [diff] [blame] | 26 | |
Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 27 | virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const; |
| 28 | |
Akira Hatanaka | be8612f | 2013-03-30 01:36:35 +0000 | [diff] [blame] | 29 | virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const; |
| 30 | |
Akira Hatanaka | 9efcd76 | 2013-03-30 01:42:24 +0000 | [diff] [blame] | 31 | virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; |
| 32 | |
Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 33 | virtual MachineBasicBlock * |
| 34 | EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const; |
| 35 | |
Akira Hatanaka | 48996b0 | 2013-04-13 00:45:02 +0000 | [diff] [blame] | 36 | virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask, |
| 37 | EVT VT) const { |
| 38 | return false; |
| 39 | } |
| 40 | |
Akira Hatanaka | 3a34d14 | 2013-03-30 01:12:05 +0000 | [diff] [blame] | 41 | virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const { |
| 42 | if (VT == MVT::Untyped) |
Akira Hatanaka | 00fcf2e | 2013-08-08 21:54:26 +0000 | [diff] [blame] | 43 | return Subtarget->hasDSP() ? &Mips::ACC64DSPRegClass : |
| 44 | &Mips::ACC64RegClass; |
Akira Hatanaka | 3a34d14 | 2013-03-30 01:12:05 +0000 | [diff] [blame] | 45 | |
| 46 | return TargetLowering::getRepRegClassFor(VT); |
| 47 | } |
| 48 | |
Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 49 | private: |
| 50 | virtual bool |
| 51 | isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo, |
| 52 | unsigned NextStackOffset, |
| 53 | const MipsFunctionInfo& FI) const; |
| 54 | |
| 55 | virtual void |
| 56 | getOpndList(SmallVectorImpl<SDValue> &Ops, |
| 57 | std::deque< std::pair<unsigned, SDValue> > &RegsToPass, |
| 58 | bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage, |
| 59 | CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const; |
| 60 | |
Akira Hatanaka | be8612f | 2013-03-30 01:36:35 +0000 | [diff] [blame] | 61 | SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi, |
| 62 | SelectionDAG &DAG) const; |
| 63 | |
Akira Hatanaka | a6bbde5 | 2013-04-13 02:13:30 +0000 | [diff] [blame] | 64 | SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const; |
| 65 | SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const; |
Daniel Sanders | e6ed5b7 | 2013-08-28 12:04:29 +0000 | [diff] [blame^] | 66 | SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const; |
Akira Hatanaka | a6bbde5 | 2013-04-13 02:13:30 +0000 | [diff] [blame] | 67 | |
Akira Hatanaka | 96ca182 | 2013-03-13 00:54:29 +0000 | [diff] [blame] | 68 | MachineBasicBlock *emitBPOSGE32(MachineInstr *MI, |
| 69 | MachineBasicBlock *BB) const; |
| 70 | }; |
| 71 | } |
| 72 | |
| 73 | #endif // MipsSEISELLOWERING_H |