Fixed some bugs.
[llvm/zpu.git] / lib / Target / ZPU / ZPUInstrInfo.cpp
blob0f77f6c703461eab51805e0d61eb25bf05430efb
1 //===- ZPUInstrInfo.cpp - ZPU Instruction Information ---------*- 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 // This file contains the ZPU implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "ZPUInstrInfo.h"
15 #include "ZPUTargetMachine.h"
16 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/CodeGen/MachineInstrBuilder.h"
18 #include "llvm/CodeGen/MachineRegisterInfo.h"
19 #include "llvm/Support/ErrorHandling.h"
20 #include "ZPUGenInstrInfo.inc"
22 using namespace llvm;
24 ZPUInstrInfo::ZPUInstrInfo(ZPUTargetMachine &tm)
25 : TargetInstrInfoImpl(ZPUInsts, array_lengthof(ZPUInsts)),
26 TM(tm), RI(*this)
29 /// isLoadFromStackSlot - If the specified machine instruction is a direct
30 /// load from a stack slot, return the virtual or physical register number of
31 /// the destination along with the FrameIndex of the loaded stack slot. If
32 /// not, return 0. This predicate must return 0 if the instruction has
33 /// any side effects other than loading from the stack slot.
34 unsigned ZPUInstrInfo::
35 isLoadFromStackSlot(const MachineInstr *MI, int &FrameIndex) const
37 return 0;
40 /// isStoreToStackSlot - If the specified machine instruction is a direct
41 /// store to a stack slot, return the virtual or physical register number of
42 /// the source reg along with the FrameIndex of the loaded stack slot. If
43 /// not, return 0. This predicate must return 0 if the instruction has
44 /// any side effects other than storing to the stack slot.
45 unsigned ZPUInstrInfo::
46 isStoreToStackSlot(const MachineInstr *MI, int &FrameIndex) const
48 return 0;
51 /// insertNoop - If data hazard condition is found insert the target nop
52 /// instruction.
53 void ZPUInstrInfo::
54 insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
56 llvm_unreachable("not implemented");
59 void ZPUInstrInfo::
60 copyPhysReg(MachineBasicBlock &MBB,
61 MachineBasicBlock::iterator I, DebugLoc DL,
62 unsigned DestReg, unsigned SrcReg,
63 bool KillSrc) const
65 llvm_unreachable("not implemented");
68 void ZPUInstrInfo::
69 storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
70 unsigned SrcReg, bool isKill, int FI,
71 const TargetRegisterClass *RC,
72 const TargetRegisterInfo *TRI) const
74 llvm_unreachable("not implemented");
77 void ZPUInstrInfo::
78 loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
79 unsigned DestReg, int FI,
80 const TargetRegisterClass *RC,
81 const TargetRegisterInfo *TRI) const
83 llvm_unreachable("not implemented");