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-08-23 18:10:13 +08:00
|
|
|
void addMSAType(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-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-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-03-13 08:54:29 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MipsSEISELLOWERING_H
|