2013-03-13 08:54:29 +08:00
|
|
|
//===-- MipsSEISelLowering.h - MipsSE DAG Lowering Interface ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Subclass of MipsTargetLowering specialized for mips32/64.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef MipsSEISELLOWERING_H
|
|
|
|
#define MipsSEISELLOWERING_H
|
|
|
|
|
|
|
|
#include "MipsISelLowering.h"
|
2013-03-30 09:12:05 +08:00
|
|
|
#include "MipsRegisterInfo.h"
|
2013-03-13 08:54:29 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MipsSETargetLowering : public MipsTargetLowering {
|
|
|
|
public:
|
|
|
|
explicit MipsSETargetLowering(MipsTargetMachine &TM);
|
|
|
|
|
2013-09-23 20:02:46 +08:00
|
|
|
/// \brief Enable MSA support for the given integer type and Register
|
|
|
|
/// class.
|
2013-09-11 18:15:48 +08:00
|
|
|
void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
|
2013-09-23 20:02:46 +08:00
|
|
|
/// \brief Enable MSA support for the given floating-point type and
|
|
|
|
/// Register class.
|
2013-09-11 18:15:48 +08:00
|
|
|
void addMSAFloatType(MVT::SimpleValueType Ty,
|
|
|
|
const TargetRegisterClass *RC);
|
[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)
Includes:
add_a, adds_[asu], addv, addvi, andi.b, asub_[su].[bhwd], aver?_[su]_[bhwd],
bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bseli, bset, bseti,
c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw], div_[su],
dotp_[su], dpadd_[su], dpsub_[su], ilvev, ilvl, ilvod, ilvr, insv, insve,
ldi
Patch by Daniel Sanders
llvm-svn: 188457
2013-08-15 20:24:57 +08:00
|
|
|
|
2014-04-28 12:05:08 +08:00
|
|
|
bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS = 0,
|
|
|
|
bool *Fast = nullptr) const override;
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
|
2013-03-30 09:36:35 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
|
2013-03-30 09:42:24 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
MachineBasicBlock *
|
|
|
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *MBB) const override;
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
|
|
|
|
EVT VT) const override {
|
2013-04-13 08:45:02 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
const TargetRegisterClass *getRepRegClassFor(MVT VT) const override {
|
2013-03-30 09:12:05 +08:00
|
|
|
if (VT == MVT::Untyped)
|
2013-08-09 05:54:26 +08:00
|
|
|
return Subtarget->hasDSP() ? &Mips::ACC64DSPRegClass :
|
|
|
|
&Mips::ACC64RegClass;
|
2013-03-30 09:12:05 +08:00
|
|
|
|
|
|
|
return TargetLowering::getRepRegClassFor(VT);
|
|
|
|
}
|
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
private:
|
2014-04-29 15:58:02 +08:00
|
|
|
bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
|
|
|
|
unsigned NextStackOffset,
|
|
|
|
const MipsFunctionInfo& FI) const override;
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2014-04-29 15:58:02 +08:00
|
|
|
void
|
2013-03-13 08:54:29 +08:00
|
|
|
getOpndList(SmallVectorImpl<SDValue> &Ops,
|
|
|
|
std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
|
|
|
|
bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
|
2014-04-29 15:58:02 +08:00
|
|
|
CallLoweringInfo &CLI, SDValue Callee,
|
|
|
|
SDValue Chain) const override;
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2013-09-07 08:52:30 +08:00
|
|
|
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
|
2013-03-30 09:36:35 +08:00
|
|
|
SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
|
|
|
|
SelectionDAG &DAG) const;
|
|
|
|
|
2013-04-13 10:13:30 +08:00
|
|
|
SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
2013-08-28 20:04:29 +08:00
|
|
|
SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-23 22:03:12 +08:00
|
|
|
SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-23 20:02:46 +08:00
|
|
|
SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-24 22:02:15 +08:00
|
|
|
/// \brief Lower VECTOR_SHUFFLE into one of a number of instructions
|
|
|
|
/// depending on the indices in the shuffle.
|
|
|
|
SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
|
2013-04-13 10:13:30 +08:00
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2013-08-28 20:14:50 +08:00
|
|
|
MachineBasicBlock *emitMSACBranchPseudo(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB,
|
|
|
|
unsigned BranchOp) const;
|
2013-09-27 20:17:32 +08:00
|
|
|
/// \brief Emit the COPY_FW pseudo instruction
|
|
|
|
MachineBasicBlock *emitCOPY_FW(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
|
|
|
/// \brief Emit the COPY_FD pseudo instruction
|
|
|
|
MachineBasicBlock *emitCOPY_FD(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2013-09-27 20:31:32 +08:00
|
|
|
/// \brief Emit the INSERT_FW pseudo instruction
|
|
|
|
MachineBasicBlock *emitINSERT_FW(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
|
|
|
/// \brief Emit the INSERT_FD pseudo instruction
|
|
|
|
MachineBasicBlock *emitINSERT_FD(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2014-04-30 20:09:32 +08:00
|
|
|
/// \brief Emit the INSERT_([BHWD]|F[WD])_VIDX pseudo instruction
|
|
|
|
MachineBasicBlock *emitINSERT_DF_VIDX(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB,
|
|
|
|
unsigned EltSizeInBytes,
|
|
|
|
bool IsFP) const;
|
2013-10-15 21:14:41 +08:00
|
|
|
/// \brief Emit the FILL_FW pseudo instruction
|
|
|
|
MachineBasicBlock *emitFILL_FW(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
|
|
|
/// \brief Emit the FILL_FD pseudo instruction
|
|
|
|
MachineBasicBlock *emitFILL_FD(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2013-10-23 18:36:52 +08:00
|
|
|
/// \brief Emit the FEXP2_W_1 pseudo instructions.
|
|
|
|
MachineBasicBlock *emitFEXP2_W_1(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
|
|
|
/// \brief Emit the FEXP2_D_1 pseudo instructions.
|
|
|
|
MachineBasicBlock *emitFEXP2_D_1(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2013-03-13 08:54:29 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MipsSEISELLOWERING_H
|