0728c41ade87e000cd94138088b50474ecddaf09
[oota-llvm.git] / lib / Target / CellSPU / SPUInstrInfo.h
1 //===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by a team from the Computer Systems Research
6 // Department at The Aerospace Corporation.
7 //
8 // See README.txt for details.
9 //
10 //===----------------------------------------------------------------------===//
11 //
12 // This file contains the PowerPC implementation of the TargetInstrInfo class.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef SPU_INSTRUCTIONINFO_H
17 #define SPU_INSTRUCTIONINFO_H
18
19 #include "SPU.h"
20 #include "llvm/Target/TargetInstrInfo.h"
21 #include "SPURegisterInfo.h"
22
23 namespace llvm {
24   //! Cell SPU instruction information class
25   class SPUInstrInfo : public TargetInstrInfo
26   {
27     SPUTargetMachine &TM;
28     const SPURegisterInfo RI;
29   public:
30     SPUInstrInfo(SPUTargetMachine &tm);
31
32     /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
33     /// such, whenever a client has an instance of instruction info, it should
34     /// always be able to get register info as well (through this method).
35     ///
36     virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
37
38     /// getPointerRegClass - Return the register class to use to hold pointers.
39     /// This is used for addressing modes.
40     virtual const TargetRegisterClass *getPointerRegClass() const;  
41
42     // Return true if the instruction is a register to register move and
43     // leave the source and dest operands in the passed parameters.
44     //
45     virtual bool isMoveInstr(const MachineInstr& MI,
46                              unsigned& sourceReg,
47                              unsigned& destReg) const;
48
49     unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
50     unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
51   };
52 }
53
54 #endif