1 //===-- MipsSEISelLowering.h - MipsSE DAG Lowering Interface ----*- C++ -*-===//
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 MipsTargetLowering specialized for mips32/64.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSSEISELLOWERING_H
15 #define MIPSSEISELLOWERING_H
17 #include "MipsISelLowering.h"
18 #include "MipsRegisterInfo.h"
21 class MipsSETargetLowering : public MipsTargetLowering {
23 explicit MipsSETargetLowering(MipsTargetMachine &TM,
24 const MipsSubtarget &STI);
26 /// \brief Enable MSA support for the given integer type and Register
28 void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
29 /// \brief Enable MSA support for the given floating-point type and
31 void addMSAFloatType(MVT::SimpleValueType Ty,
32 const TargetRegisterClass *RC);
34 bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS = 0,
35 bool *Fast = nullptr) const override;
37 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
39 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
42 EmitInstrWithCustomInserter(MachineInstr *MI,
43 MachineBasicBlock *MBB) const override;
45 bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
46 EVT VT) const override {
50 const TargetRegisterClass *getRepRegClassFor(MVT VT) const override;
53 bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
54 unsigned NextStackOffset,
55 const MipsFunctionInfo& FI) const override;
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,
62 SDValue Chain) const override;
64 SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
65 SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
67 SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
68 SelectionDAG &DAG) const;
70 SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
71 SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
72 SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
73 SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
74 SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
75 /// \brief Lower VECTOR_SHUFFLE into one of a number of instructions
76 /// depending on the indices in the shuffle.
77 SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
79 MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
80 MachineBasicBlock *BB) const;
81 MachineBasicBlock *emitMSACBranchPseudo(MachineInstr *MI,
82 MachineBasicBlock *BB,
83 unsigned BranchOp) const;
84 /// \brief Emit the COPY_FW pseudo instruction
85 MachineBasicBlock *emitCOPY_FW(MachineInstr *MI,
86 MachineBasicBlock *BB) const;
87 /// \brief Emit the COPY_FD pseudo instruction
88 MachineBasicBlock *emitCOPY_FD(MachineInstr *MI,
89 MachineBasicBlock *BB) const;
90 /// \brief Emit the INSERT_FW pseudo instruction
91 MachineBasicBlock *emitINSERT_FW(MachineInstr *MI,
92 MachineBasicBlock *BB) const;
93 /// \brief Emit the INSERT_FD pseudo instruction
94 MachineBasicBlock *emitINSERT_FD(MachineInstr *MI,
95 MachineBasicBlock *BB) const;
96 /// \brief Emit the INSERT_([BHWD]|F[WD])_VIDX pseudo instruction
97 MachineBasicBlock *emitINSERT_DF_VIDX(MachineInstr *MI,
98 MachineBasicBlock *BB,
99 unsigned EltSizeInBytes,
101 /// \brief Emit the FILL_FW pseudo instruction
102 MachineBasicBlock *emitFILL_FW(MachineInstr *MI,
103 MachineBasicBlock *BB) const;
104 /// \brief Emit the FILL_FD pseudo instruction
105 MachineBasicBlock *emitFILL_FD(MachineInstr *MI,
106 MachineBasicBlock *BB) const;
107 /// \brief Emit the FEXP2_W_1 pseudo instructions.
108 MachineBasicBlock *emitFEXP2_W_1(MachineInstr *MI,
109 MachineBasicBlock *BB) const;
110 /// \brief Emit the FEXP2_D_1 pseudo instructions.
111 MachineBasicBlock *emitFEXP2_D_1(MachineInstr *MI,
112 MachineBasicBlock *BB) const;
116 #endif // MipsSEISELLOWERING_H