2013-03-13 00:54:29 +00: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 01:12:05 +00:00
|
|
|
#include "MipsRegisterInfo.h"
|
2013-03-13 00:54:29 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MipsSETargetLowering : public MipsTargetLowering {
|
|
|
|
public:
|
|
|
|
explicit MipsSETargetLowering(MipsTargetMachine &TM);
|
|
|
|
|
2013-09-23 12:02:46 +00:00
|
|
|
/// \brief Enable MSA support for the given integer type and Register
|
|
|
|
/// class.
|
2013-09-11 10:15:48 +00:00
|
|
|
void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
|
2013-09-23 12:02:46 +00:00
|
|
|
/// \brief Enable MSA support for the given floating-point type and
|
|
|
|
/// Register class.
|
2013-09-11 10:15:48 +00: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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 12:24:57 +00:00
|
|
|
|
2014-04-28 04:05:08 +00:00
|
|
|
bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS = 0,
|
|
|
|
bool *Fast = nullptr) const override;
|
2013-03-13 00:54:29 +00:00
|
|
|
|
2013-03-30 01:36:35 +00:00
|
|
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
|
2013-03-30 01:42:24 +00:00
|
|
|
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
|
|
|
|
2013-03-13 00:54:29 +00:00
|
|
|
virtual MachineBasicBlock *
|
|
|
|
EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
|
|
|
|
|
2013-04-13 00:45:02 +00:00
|
|
|
virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
|
|
|
|
EVT VT) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-03-30 01:12:05 +00:00
|
|
|
virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
|
|
|
|
if (VT == MVT::Untyped)
|
2013-08-08 21:54:26 +00:00
|
|
|
return Subtarget->hasDSP() ? &Mips::ACC64DSPRegClass :
|
|
|
|
&Mips::ACC64RegClass;
|
2013-03-30 01:12:05 +00:00
|
|
|
|
|
|
|
return TargetLowering::getRepRegClassFor(VT);
|
|
|
|
}
|
|
|
|
|
2013-03-13 00:54:29 +00: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 00:52:30 +00:00
|
|
|
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
|
2013-03-30 01:36:35 +00:00
|
|
|
SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
|
|
|
|
SelectionDAG &DAG) const;
|
|
|
|
|
2013-04-13 02:13:30 +00:00
|
|
|
SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
2013-08-28 12:04:29 +00:00
|
|
|
SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-23 14:03:12 +00:00
|
|
|
SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-23 12:02:46 +00:00
|
|
|
SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-24 14:02:15 +00: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 02:13:30 +00:00
|
|
|
|
2013-03-13 00:54:29 +00:00
|
|
|
MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2013-08-28 12:14:50 +00:00
|
|
|
MachineBasicBlock *emitMSACBranchPseudo(MachineInstr *MI,
|
|
|
|
MachineBasicBlock *BB,
|
|
|
|
unsigned BranchOp) const;
|
2013-09-27 12:17:32 +00: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 12:31:32 +00: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;
|
2013-10-15 13:14:41 +00: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 10:36:52 +00: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 00:54:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MipsSEISELLOWERING_H
|