1 //===-- Mips16ISelLowering.h - Mips16 DAG Lowering Interface ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Subclass of MipsTargetLowering specialized for mips16.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
15 #define LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
17 #include "MipsISelLowering.h"
20 class Mips16TargetLowering : public MipsTargetLowering {
22 explicit Mips16TargetLowering(const MipsTargetMachine &TM,
23 const MipsSubtarget &STI);
25 bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
27 bool *Fast) const override;
30 EmitInstrWithCustomInserter(MachineInstr *MI,
31 MachineBasicBlock *MBB) const override;
34 bool isEligibleForTailCallOptimization(
35 const CCState &CCInfo, unsigned NextStackOffset,
36 const MipsFunctionInfo &FI) const override;
38 void setMips16HardFloatLibCalls();
41 getMips16HelperFunctionStubNumber(ArgListTy &Args) const;
43 const char *getMips16HelperFunction
44 (Type* RetTy, ArgListTy &Args, bool &needHelper) const;
47 getOpndList(SmallVectorImpl<SDValue> &Ops,
48 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
49 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
50 bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee,
51 SDValue Chain) const override;
53 MachineBasicBlock *emitSel16(unsigned Opc, MachineInstr *MI,
54 MachineBasicBlock *BB) const;
56 MachineBasicBlock *emitSeliT16(unsigned Opc1, unsigned Opc2,
58 MachineBasicBlock *BB) const;
60 MachineBasicBlock *emitSelT16(unsigned Opc1, unsigned Opc2,
62 MachineBasicBlock *BB) const;
64 MachineBasicBlock *emitFEXT_T8I816_ins(unsigned BtOpc, unsigned CmpOpc,
66 MachineBasicBlock *BB) const;
68 MachineBasicBlock *emitFEXT_T8I8I16_ins(
69 unsigned BtOpc, unsigned CmpiOpc, unsigned CmpiXOpc, bool ImmSigned,
70 MachineInstr *MI, MachineBasicBlock *BB) const;
72 MachineBasicBlock *emitFEXT_CCRX16_ins(
74 MachineInstr *MI, MachineBasicBlock *BB) const;
76 MachineBasicBlock *emitFEXT_CCRXI16_ins(
77 unsigned SltiOpc, unsigned SltiXOpc,
78 MachineInstr *MI, MachineBasicBlock *BB )const;