2017-08-04 06:12:30 +08:00
|
|
|
//===- MipsSEISelLowering.h - MipsSE DAG Lowering Interface -----*- C++ -*-===//
|
2013-03-13 08:54:29 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-03-13 08:54:29 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Subclass of MipsTargetLowering specialized for mips32/64.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
|
2013-03-13 08:54:29 +08:00
|
|
|
|
|
|
|
#include "MipsISelLowering.h"
|
2017-08-04 06:12:30 +08:00
|
|
|
#include "llvm/CodeGen/SelectionDAGNodes.h"
|
2018-03-24 07:58:25 +08:00
|
|
|
#include "llvm/Support/MachineValueType.h"
|
2013-03-13 08:54:29 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2017-08-04 06:12:30 +08:00
|
|
|
|
|
|
|
class MachineBasicBlock;
|
|
|
|
class MachineInstr;
|
|
|
|
class MipsSubtarget;
|
|
|
|
class MipsTargetMachine;
|
|
|
|
class SelectionDAG;
|
|
|
|
class TargetRegisterClass;
|
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
class MipsSETargetLowering : public MipsTargetLowering {
|
|
|
|
public:
|
2014-09-20 07:30:42 +08:00
|
|
|
explicit MipsSETargetLowering(const MipsTargetMachine &TM,
|
2014-07-19 07:25:04 +08:00
|
|
|
const MipsSubtarget &STI);
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Enable MSA support for the given integer type and Register
|
2013-09-23 20:02:46 +08:00
|
|
|
/// class.
|
2013-09-11 18:15:48 +08:00
|
|
|
void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
|
2017-08-04 06:12:30 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Enable MSA support for the given floating-point type and
|
2013-09-23 20:02:46 +08:00
|
|
|
/// 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
|
|
|
|
2019-06-13 01:14:03 +08:00
|
|
|
bool allowsMisalignedMemoryAccesses(
|
|
|
|
EVT VT, unsigned AS = 0, unsigned Align = 1,
|
|
|
|
MachineMemOperand::Flags Flags = MachineMemOperand::MONone,
|
|
|
|
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 *
|
2016-07-01 06:52:52 +08:00
|
|
|
EmitInstrWithCustomInserter(MachineInstr &MI,
|
2014-04-29 15:58:02 +08:00
|
|
|
MachineBasicBlock *MBB) const override;
|
2013-03-13 08:54:29 +08:00
|
|
|
|
2017-07-26 16:06:58 +08:00
|
|
|
bool isShuffleMaskLegal(ArrayRef<int> Mask, EVT VT) const override {
|
2013-04-13 08:45:02 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-07-03 07:18:40 +08:00
|
|
|
const TargetRegisterClass *getRepRegClassFor(MVT VT) const override;
|
2013-03-30 09:12:05 +08:00
|
|
|
|
2013-03-13 08:54:29 +08:00
|
|
|
private:
|
2014-11-03 00:09:29 +08:00
|
|
|
bool isEligibleForTailCallOptimization(
|
|
|
|
const CCState &CCInfo, 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,
|
2017-08-04 06:12:30 +08:00
|
|
|
std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
|
2013-03-13 08:54:29 +08:00
|
|
|
bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
|
2014-10-01 16:22:21 +08:00
|
|
|
bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee,
|
2014-04-29 15:58:02 +08:00
|
|
|
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;
|
2019-04-25 15:47:28 +08:00
|
|
|
SDValue lowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
|
2013-09-07 08:52:30 +08:00
|
|
|
|
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;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Lower VECTOR_SHUFFLE into one of a number of instructions
|
2013-09-24 22:02:15 +08:00
|
|
|
/// depending on the indices in the shuffle.
|
|
|
|
SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
|
2017-07-20 21:08:18 +08:00
|
|
|
SDValue lowerSELECT(SDValue Op, SelectionDAG &DAG) const;
|
2013-04-13 10:13:30 +08:00
|
|
|
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitBPOSGE32(MachineInstr &MI,
|
2013-03-13 08:54:29 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitMSACBranchPseudo(MachineInstr &MI,
|
2013-08-28 20:14:50 +08:00
|
|
|
MachineBasicBlock *BB,
|
|
|
|
unsigned BranchOp) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the COPY_FW pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitCOPY_FW(MachineInstr &MI,
|
2013-09-27 20:17:32 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the COPY_FD pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitCOPY_FD(MachineInstr &MI,
|
2013-09-27 20:17:32 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the INSERT_FW pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitINSERT_FW(MachineInstr &MI,
|
2013-09-27 20:31:32 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the INSERT_FD pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitINSERT_FD(MachineInstr &MI,
|
2013-09-27 20:31:32 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the INSERT_([BHWD]|F[WD])_VIDX pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitINSERT_DF_VIDX(MachineInstr &MI,
|
2014-04-30 20:09:32 +08:00
|
|
|
MachineBasicBlock *BB,
|
|
|
|
unsigned EltSizeInBytes,
|
|
|
|
bool IsFP) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FILL_FW pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitFILL_FW(MachineInstr &MI,
|
2013-10-15 21:14:41 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FILL_FD pseudo instruction
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitFILL_FD(MachineInstr &MI,
|
2013-10-15 21:14:41 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FEXP2_W_1 pseudo instructions.
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitFEXP2_W_1(MachineInstr &MI,
|
2013-10-23 18:36:52 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FEXP2_D_1 pseudo instructions.
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *emitFEXP2_D_1(MachineInstr &MI,
|
2013-10-23 18:36:52 +08:00
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FILL_FW pseudo instruction
|
2016-11-19 00:17:44 +08:00
|
|
|
MachineBasicBlock *emitLD_F16_PSEUDO(MachineInstr &MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FILL_FD pseudo instruction
|
2016-11-19 00:17:44 +08:00
|
|
|
MachineBasicBlock *emitST_F16_PSEUDO(MachineInstr &MI,
|
|
|
|
MachineBasicBlock *BB) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FEXP2_W_1 pseudo instructions.
|
2016-11-19 00:17:44 +08:00
|
|
|
MachineBasicBlock *emitFPEXTEND_PSEUDO(MachineInstr &MI,
|
|
|
|
MachineBasicBlock *BB,
|
|
|
|
bool IsFGR64) const;
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Emit the FEXP2_D_1 pseudo instructions.
|
2016-11-19 00:17:44 +08:00
|
|
|
MachineBasicBlock *emitFPROUND_PSEUDO(MachineInstr &MI,
|
|
|
|
MachineBasicBlock *BBi,
|
|
|
|
bool IsFGR64) const;
|
2013-03-13 08:54:29 +08:00
|
|
|
};
|
|
|
|
|
2017-08-04 06:12:30 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
|