blob: 656e8dfb9dafacc572b87d60d897edca689afb55 [file] [log] [blame]
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +00001//===- MSP430InstrInfo.h - MSP430 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 MSP430 implementation of the TargetInstrInfo class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGET_MSP430INSTRINFO_H
15#define LLVM_TARGET_MSP430INSTRINFO_H
16
17#include "llvm/Target/TargetInstrInfo.h"
18#include "MSP430RegisterInfo.h"
19
20namespace llvm {
21
22class MSP430TargetMachine;
23
24class MSP430InstrInfo : public TargetInstrInfoImpl {
25 const MSP430RegisterInfo RI;
26 MSP430TargetMachine &TM;
27public:
28 explicit MSP430InstrInfo(MSP430TargetMachine &TM);
29
30 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
31 /// such, whenever a client has an instance of instruction info, it should
32 /// always be able to get register info as well (through this method).
33 ///
34 virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
Anton Korobeynikov1df221f2009-05-03 13:02:04 +000035
36 bool copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
37 unsigned DestReg, unsigned SrcReg,
38 const TargetRegisterClass *DestRC,
39 const TargetRegisterClass *SrcRC) const;
40
41 bool isMoveInstr(const MachineInstr& MI,
42 unsigned &SrcReg, unsigned &DstReg,
43 unsigned &SrcSubIdx, unsigned &DstSubIdx) const;
Anton Korobeynikovaa299152009-05-03 13:09:57 +000044
45 virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator MI,
47 unsigned SrcReg, bool isKill, int FrameIndex,
48 const TargetRegisterClass *RC) const;
49 virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
50 MachineBasicBlock::iterator MI,
51 unsigned DestReg, int FrameIdx,
52 const TargetRegisterClass *RC) const;
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +000053};
54
55}
56
57#endif