Updated source file headers to llvm coding standard.
[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 and is distributed under the
7 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 //
11 // This file contains the CellSPU implementation of the TargetInstrInfo class.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef SPU_INSTRUCTIONINFO_H
16 #define SPU_INSTRUCTIONINFO_H
17
18 #include "SPU.h"
19 #include "llvm/Target/TargetInstrInfo.h"
20 #include "SPURegisterInfo.h"
21
22 namespace llvm {
23   //! Cell SPU instruction information class
24   class SPUInstrInfo : public TargetInstrInfo
25   {
26     SPUTargetMachine &TM;
27     const SPURegisterInfo RI;
28   public:
29     SPUInstrInfo(SPUTargetMachine &tm);
30
31     /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
32     /// such, whenever a client has an instance of instruction info, it should
33     /// always be able to get register info as well (through this method).
34     ///
35     virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
36
37     /// getPointerRegClass - Return the register class to use to hold pointers.
38     /// This is used for addressing modes.
39     virtual const TargetRegisterClass *getPointerRegClass() const;  
40
41     // Return true if the instruction is a register to register move and
42     // leave the source and dest operands in the passed parameters.
43     //
44     virtual bool isMoveInstr(const MachineInstr& MI,
45                              unsigned& sourceReg,
46                              unsigned& destReg) const;
47
48     unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
49     unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
50   };
51 }
52
53 #endif