xref: /aosp_15_r20/external/llvm/lib/Target/Mips/Mips16ISelLowering.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- Mips16ISelLowering.h - Mips16 DAG Lowering Interface ----*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // Subclass of MipsTargetLowering specialized for mips16.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "MipsISelLowering.h"
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker namespace llvm {
20*9880d681SAndroid Build Coastguard Worker   class Mips16TargetLowering : public MipsTargetLowering  {
21*9880d681SAndroid Build Coastguard Worker   public:
22*9880d681SAndroid Build Coastguard Worker     explicit Mips16TargetLowering(const MipsTargetMachine &TM,
23*9880d681SAndroid Build Coastguard Worker                                   const MipsSubtarget &STI);
24*9880d681SAndroid Build Coastguard Worker 
25*9880d681SAndroid Build Coastguard Worker     bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
26*9880d681SAndroid Build Coastguard Worker                                         unsigned Align,
27*9880d681SAndroid Build Coastguard Worker                                         bool *Fast) const override;
28*9880d681SAndroid Build Coastguard Worker 
29*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *
30*9880d681SAndroid Build Coastguard Worker     EmitInstrWithCustomInserter(MachineInstr &MI,
31*9880d681SAndroid Build Coastguard Worker                                 MachineBasicBlock *MBB) const override;
32*9880d681SAndroid Build Coastguard Worker 
33*9880d681SAndroid Build Coastguard Worker   private:
34*9880d681SAndroid Build Coastguard Worker     bool isEligibleForTailCallOptimization(
35*9880d681SAndroid Build Coastguard Worker         const CCState &CCInfo, unsigned NextStackOffset,
36*9880d681SAndroid Build Coastguard Worker         const MipsFunctionInfo &FI) const override;
37*9880d681SAndroid Build Coastguard Worker 
38*9880d681SAndroid Build Coastguard Worker     void setMips16HardFloatLibCalls();
39*9880d681SAndroid Build Coastguard Worker 
40*9880d681SAndroid Build Coastguard Worker     unsigned int
41*9880d681SAndroid Build Coastguard Worker       getMips16HelperFunctionStubNumber(ArgListTy &Args) const;
42*9880d681SAndroid Build Coastguard Worker 
43*9880d681SAndroid Build Coastguard Worker     const char *getMips16HelperFunction
44*9880d681SAndroid Build Coastguard Worker       (Type* RetTy, ArgListTy &Args, bool &needHelper) const;
45*9880d681SAndroid Build Coastguard Worker 
46*9880d681SAndroid Build Coastguard Worker     void
47*9880d681SAndroid Build Coastguard Worker     getOpndList(SmallVectorImpl<SDValue> &Ops,
48*9880d681SAndroid Build Coastguard Worker                 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
49*9880d681SAndroid Build Coastguard Worker                 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
50*9880d681SAndroid Build Coastguard Worker                 bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee,
51*9880d681SAndroid Build Coastguard Worker                 SDValue Chain) const override;
52*9880d681SAndroid Build Coastguard Worker 
53*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitSel16(unsigned Opc, MachineInstr &MI,
54*9880d681SAndroid Build Coastguard Worker                                  MachineBasicBlock *BB) const;
55*9880d681SAndroid Build Coastguard Worker 
56*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitSeliT16(unsigned Opc1, unsigned Opc2,
57*9880d681SAndroid Build Coastguard Worker                                    MachineInstr &MI,
58*9880d681SAndroid Build Coastguard Worker                                    MachineBasicBlock *BB) const;
59*9880d681SAndroid Build Coastguard Worker 
60*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitSelT16(unsigned Opc1, unsigned Opc2,
61*9880d681SAndroid Build Coastguard Worker                                   MachineInstr &MI,
62*9880d681SAndroid Build Coastguard Worker                                   MachineBasicBlock *BB) const;
63*9880d681SAndroid Build Coastguard Worker 
64*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitFEXT_T8I816_ins(unsigned BtOpc, unsigned CmpOpc,
65*9880d681SAndroid Build Coastguard Worker                                            MachineInstr &MI,
66*9880d681SAndroid Build Coastguard Worker                                            MachineBasicBlock *BB) const;
67*9880d681SAndroid Build Coastguard Worker 
68*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitFEXT_T8I8I16_ins(unsigned BtOpc, unsigned CmpiOpc,
69*9880d681SAndroid Build Coastguard Worker                                             unsigned CmpiXOpc, bool ImmSigned,
70*9880d681SAndroid Build Coastguard Worker                                             MachineInstr &MI,
71*9880d681SAndroid Build Coastguard Worker                                             MachineBasicBlock *BB) const;
72*9880d681SAndroid Build Coastguard Worker 
73*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitFEXT_CCRX16_ins(unsigned SltOpc, MachineInstr &MI,
74*9880d681SAndroid Build Coastguard Worker                                            MachineBasicBlock *BB) const;
75*9880d681SAndroid Build Coastguard Worker 
76*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *emitFEXT_CCRXI16_ins(unsigned SltiOpc, unsigned SltiXOpc,
77*9880d681SAndroid Build Coastguard Worker                                             MachineInstr &MI,
78*9880d681SAndroid Build Coastguard Worker                                             MachineBasicBlock *BB) const;
79*9880d681SAndroid Build Coastguard Worker   };
80*9880d681SAndroid Build Coastguard Worker }
81*9880d681SAndroid Build Coastguard Worker 
82*9880d681SAndroid Build Coastguard Worker #endif
83