1 //===-- Mips16ISelLowering.h - Mips16 DAG Lowering Interface ----*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Subclass of MipsTargetLowering specialized for mips16.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
14 #define LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
16 #include "MipsISelLowering.h"
19 class Mips16TargetLowering
: public MipsTargetLowering
{
21 explicit Mips16TargetLowering(const MipsTargetMachine
&TM
,
22 const MipsSubtarget
&STI
);
24 bool allowsMisalignedMemoryAccesses(EVT VT
, unsigned AddrSpace
,
26 bool *Fast
) const override
;
29 EmitInstrWithCustomInserter(MachineInstr
&MI
,
30 MachineBasicBlock
*MBB
) const override
;
33 bool isEligibleForTailCallOptimization(
34 const CCState
&CCInfo
, unsigned NextStackOffset
,
35 const MipsFunctionInfo
&FI
) const override
;
37 void setMips16HardFloatLibCalls();
40 getMips16HelperFunctionStubNumber(ArgListTy
&Args
) const;
42 const char *getMips16HelperFunction
43 (Type
* RetTy
, ArgListTy
&Args
, bool &needHelper
) const;
46 getOpndList(SmallVectorImpl
<SDValue
> &Ops
,
47 std::deque
< std::pair
<unsigned, SDValue
> > &RegsToPass
,
48 bool IsPICCall
, bool GlobalOrExternal
, bool InternalLinkage
,
49 bool IsCallReloc
, CallLoweringInfo
&CLI
, SDValue Callee
,
50 SDValue Chain
) const override
;
52 MachineBasicBlock
*emitSel16(unsigned Opc
, MachineInstr
&MI
,
53 MachineBasicBlock
*BB
) const;
55 MachineBasicBlock
*emitSeliT16(unsigned Opc1
, unsigned Opc2
,
57 MachineBasicBlock
*BB
) const;
59 MachineBasicBlock
*emitSelT16(unsigned Opc1
, unsigned Opc2
,
61 MachineBasicBlock
*BB
) const;
63 MachineBasicBlock
*emitFEXT_T8I816_ins(unsigned BtOpc
, unsigned CmpOpc
,
65 MachineBasicBlock
*BB
) const;
67 MachineBasicBlock
*emitFEXT_T8I8I16_ins(unsigned BtOpc
, unsigned CmpiOpc
,
68 unsigned CmpiXOpc
, bool ImmSigned
,
70 MachineBasicBlock
*BB
) const;
72 MachineBasicBlock
*emitFEXT_CCRX16_ins(unsigned SltOpc
, MachineInstr
&MI
,
73 MachineBasicBlock
*BB
) const;
75 MachineBasicBlock
*emitFEXT_CCRXI16_ins(unsigned SltiOpc
, unsigned SltiXOpc
,
77 MachineBasicBlock
*BB
) const;