blob: 186f6a343dee637d6ec99a0ad485c2f4dab11429 [file] [log] [blame]
Akira Hatanaka5ac065a2013-03-13 00:54:29 +00001//===-- MipsSEISelLowering.h - MipsSE 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 mips32/64.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MipsSEISELLOWERING_H
15#define MipsSEISELLOWERING_H
16
17#include "MipsISelLowering.h"
Akira Hatanakacbcdcfb2013-03-30 01:12:05 +000018#include "MipsRegisterInfo.h"
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000019
20namespace llvm {
21 class MipsSETargetLowering : public MipsTargetLowering {
22 public:
23 explicit MipsSETargetLowering(MipsTargetMachine &TM);
24
25 virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const;
26
Akira Hatanakaf5926fd2013-03-30 01:36:35 +000027 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
28
Akira Hatanakad593a772013-03-30 01:42:24 +000029 virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
30
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000031 virtual MachineBasicBlock *
32 EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
33
Akira Hatanakacbcdcfb2013-03-30 01:12:05 +000034 virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
35 if (VT == MVT::Untyped)
36 return Subtarget->hasDSP() ? &Mips::ACRegsDSPRegClass :
37 &Mips::ACRegsRegClass;
38
39 return TargetLowering::getRepRegClassFor(VT);
40 }
41
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000042 private:
43 virtual bool
44 isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
45 unsigned NextStackOffset,
46 const MipsFunctionInfo& FI) const;
47
48 virtual void
49 getOpndList(SmallVectorImpl<SDValue> &Ops,
50 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
51 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
52 CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const;
53
Akira Hatanakaf5926fd2013-03-30 01:36:35 +000054 SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
55 SelectionDAG &DAG) const;
56
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000057 MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
58 MachineBasicBlock *BB) const;
59 };
60}
61
62#endif // MipsSEISELLOWERING_H