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
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const;
|
|
|
|
|
2013-03-30 09:36:35 +08:00
|
|
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
|
2013-03-30 09:42:24 +08:00
|
|
|
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
virtual MachineBasicBlock *
|
|
|
|
EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
|
|
|
|
|
2013-04-13 08:45:02 +08:00
|
|
|
virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
|
|
|
|
EVT VT) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-03-30 09:12:05 +08:00
|
|
|
virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
|
|
|
|
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:
|
|
|
|
virtual bool
|
|
|
|
isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
|
|
|
|
unsigned NextStackOffset,
|
|
|
|
const MipsFunctionInfo& FI) const;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
getOpndList(SmallVectorImpl<SDValue> &Ops,
|
|
|
|
std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
|
|
|
|
bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
|
|
|
|
CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const;
|
|
|
|
|
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-03-13 08:54:29 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MipsSEISELLOWERING_H
|