blob: 4c21a919e71843d693465ca1104b088d229d4142 [file] [log] [blame]
Akira Hatanaka96ca1822013-03-13 00:54:29 +00001//===-- Mips16ISelLowering.h - Mips16 DAG Lowering Interface ----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Subclass of MipsTargetLowering specialized for mips16.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
15#define LLVM_LIB_TARGET_MIPS_MIPS16ISELLOWERING_H
Akira Hatanaka96ca1822013-03-13 00:54:29 +000016
17#include "MipsISelLowering.h"
18
19namespace llvm {
20 class Mips16TargetLowering : public MipsTargetLowering {
21 public:
Eric Christopherb1526602014-09-19 23:30:42 +000022 explicit Mips16TargetLowering(const MipsTargetMachine &TM,
Eric Christopher8924d272014-07-18 23:25:04 +000023 const MipsSubtarget &STI);
Akira Hatanaka96ca1822013-03-13 00:54:29 +000024
Matt Arsenault6f2a5262014-07-27 17:46:40 +000025 bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
26 unsigned Align,
27 bool *Fast) const override;
Akira Hatanaka96ca1822013-03-13 00:54:29 +000028
Craig Topper56c590a2014-04-29 07:58:02 +000029 MachineBasicBlock *
30 EmitInstrWithCustomInserter(MachineInstr *MI,
31 MachineBasicBlock *MBB) const override;
Akira Hatanaka96ca1822013-03-13 00:54:29 +000032
33 private:
Craig Topper56c590a2014-04-29 07:58:02 +000034 bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
35 unsigned NextStackOffset,
36 const MipsFunctionInfo& FI) const override;
Akira Hatanaka96ca1822013-03-13 00:54:29 +000037
Akira Hatanaka96ca1822013-03-13 00:54:29 +000038 void setMips16HardFloatLibCalls();
39
40 unsigned int
41 getMips16HelperFunctionStubNumber(ArgListTy &Args) const;
42
43 const char *getMips16HelperFunction
44 (Type* RetTy, ArgListTy &Args, bool &needHelper) const;
45
Craig Topper56c590a2014-04-29 07:58:02 +000046 void
Akira Hatanaka96ca1822013-03-13 00:54:29 +000047 getOpndList(SmallVectorImpl<SDValue> &Ops,
48 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
49 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
Sasa Stankovic7072a792014-10-01 08:22:21 +000050 bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee,
Craig Topper56c590a2014-04-29 07:58:02 +000051 SDValue Chain) const override;
Akira Hatanaka96ca1822013-03-13 00:54:29 +000052
53 MachineBasicBlock *emitSel16(unsigned Opc, MachineInstr *MI,
54 MachineBasicBlock *BB) const;
55
56 MachineBasicBlock *emitSeliT16(unsigned Opc1, unsigned Opc2,
57 MachineInstr *MI,
58 MachineBasicBlock *BB) const;
59
60 MachineBasicBlock *emitSelT16(unsigned Opc1, unsigned Opc2,
61 MachineInstr *MI,
62 MachineBasicBlock *BB) const;
63
64 MachineBasicBlock *emitFEXT_T8I816_ins(unsigned BtOpc, unsigned CmpOpc,
65 MachineInstr *MI,
66 MachineBasicBlock *BB) const;
67
68 MachineBasicBlock *emitFEXT_T8I8I16_ins(
Reed Kotlerce510832013-06-09 23:23:46 +000069 unsigned BtOpc, unsigned CmpiOpc, unsigned CmpiXOpc, bool ImmSigned,
Akira Hatanaka96ca1822013-03-13 00:54:29 +000070 MachineInstr *MI, MachineBasicBlock *BB) const;
71
72 MachineBasicBlock *emitFEXT_CCRX16_ins(
73 unsigned SltOpc,
74 MachineInstr *MI, MachineBasicBlock *BB) const;
75
76 MachineBasicBlock *emitFEXT_CCRXI16_ins(
77 unsigned SltiOpc, unsigned SltiXOpc,
78 MachineInstr *MI, MachineBasicBlock *BB )const;
79 };
80}
81
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000082#endif