Mips16ISelLowering.h revision 276479
1139749Simp//===-- Mips16ISelLowering.h - Mips16 DAG Lowering Interface ----*- C++ -*-===//
2193640Sariff//
3193640Sariff//                     The LLVM Compiler Infrastructure
450724Scg//
550724Scg// This file is distributed under the University of Illinois Open Source
650724Scg// License. See LICENSE.TXT for details.
750724Scg//
850724Scg//===----------------------------------------------------------------------===//
950724Scg//
1050724Scg// Subclass of MipsTargetLowering specialized for mips16.
1150724Scg//
1250724Scg//===----------------------------------------------------------------------===//
1350724Scg
1450724Scg#ifndef MIPS16ISELLOWERING_H
1550724Scg#define MIPS16ISELLOWERING_H
1650724Scg
1750724Scg#include "MipsISelLowering.h"
1850724Scg
1950724Scgnamespace llvm {
2050724Scg  class Mips16TargetLowering : public MipsTargetLowering  {
2150724Scg  public:
2250724Scg    explicit Mips16TargetLowering(MipsTargetMachine &TM,
2350724Scg                                  const MipsSubtarget &STI);
2450724Scg
2550724Scg    bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
2650724Scg                                       bool *Fast) const override;
2750733Speter
2850724Scg    MachineBasicBlock *
2950724Scg    EmitInstrWithCustomInserter(MachineInstr *MI,
30242435Shselasky                                MachineBasicBlock *MBB) const override;
31242435Shselasky
32242435Shselasky  private:
33170815Sariff    bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
34170815Sariff                                     unsigned NextStackOffset,
35170815Sariff                                     const MipsFunctionInfo& FI) const override;
3674763Scg
3774763Scg    void setMips16HardFloatLibCalls();
3874763Scg
39170815Sariff    unsigned int
40162588Snetchild      getMips16HelperFunctionStubNumber(ArgListTy &Args) const;
4150724Scg
4270944Sjhb    const char *getMips16HelperFunction
43246454Shselasky      (Type* RetTy, ArgListTy &Args, bool &needHelper) const;
4470944Sjhb
45246454Shselasky    void
4670944Sjhb    getOpndList(SmallVectorImpl<SDValue> &Ops,
4770618Sjhb                std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
48170815Sariff                bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
49170815Sariff                CallLoweringInfo &CLI, SDValue Callee,
50246421Shselasky                SDValue Chain) const override;
51246421Shselasky
52170815Sariff    MachineBasicBlock *emitSel16(unsigned Opc, MachineInstr *MI,
53170815Sariff                                 MachineBasicBlock *BB) const;
54170815Sariff
55170815Sariff    MachineBasicBlock *emitSeliT16(unsigned Opc1, unsigned Opc2,
56170815Sariff                                   MachineInstr *MI,
57170815Sariff                                   MachineBasicBlock *BB) const;
5874763Scg
5974763Scg    MachineBasicBlock *emitSelT16(unsigned Opc1, unsigned Opc2,
6074763Scg                                  MachineInstr *MI,
6174763Scg                                  MachineBasicBlock *BB) const;
62162738Sariff
63162738Sariff    MachineBasicBlock *emitFEXT_T8I816_ins(unsigned BtOpc, unsigned CmpOpc,
64162738Sariff                                           MachineInstr *MI,
65162738Sariff                                           MachineBasicBlock *BB) const;
6674763Scg
67184610Salfred    MachineBasicBlock *emitFEXT_T8I8I16_ins(
6850724Scg      unsigned BtOpc, unsigned CmpiOpc, unsigned CmpiXOpc, bool ImmSigned,
69162588Snetchild      MachineInstr *MI,  MachineBasicBlock *BB) const;
70162588Snetchild
71170815Sariff    MachineBasicBlock *emitFEXT_CCRX16_ins(
72170815Sariff      unsigned SltOpc,
73170815Sariff      MachineInstr *MI,  MachineBasicBlock *BB) const;
74170815Sariff
75170815Sariff    MachineBasicBlock *emitFEXT_CCRXI16_ins(
76170815Sariff      unsigned SltiOpc, unsigned SltiXOpc,
7774763Scg      MachineInstr *MI,  MachineBasicBlock *BB )const;
7874763Scg  };
7974763Scg}
8074763Scg
81170815Sariff#endif // Mips16ISELLOWERING_H
82170815Sariff