1 //===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the CellSPU implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPU_INSTRUCTIONINFO_H
15 #define SPU_INSTRUCTIONINFO_H
18 #include "llvm/Target/TargetInstrInfo.h"
19 #include "SPURegisterInfo.h"
22 //! Cell SPU instruction information class
23 class SPUInstrInfo : public TargetInstrInfo
26 const SPURegisterInfo RI;
28 SPUInstrInfo(SPUTargetMachine &tm);
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).
34 virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
36 /// getPointerRegClass - Return the register class to use to hold pointers.
37 /// This is used for addressing modes.
38 virtual const TargetRegisterClass *getPointerRegClass() const;
40 // Return true if the instruction is a register to register move and
41 // leave the source and dest operands in the passed parameters.
43 virtual bool isMoveInstr(const MachineInstr& MI,
45 unsigned& destReg) const;
47 unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
48 unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;