1 //===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
9 //===----------------------------------------------------------------------===//
11 // This file contains the CellSPU implementation of the TargetInstrInfo class.
13 //===----------------------------------------------------------------------===//
15 #ifndef SPU_INSTRUCTIONINFO_H
16 #define SPU_INSTRUCTIONINFO_H
19 #include "llvm/Target/TargetInstrInfo.h"
20 #include "SPURegisterInfo.h"
23 //! Cell SPU instruction information class
24 class SPUInstrInfo : public TargetInstrInfo
27 const SPURegisterInfo RI;
29 SPUInstrInfo(SPUTargetMachine &tm);
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).
35 virtual const MRegisterInfo &getRegisterInfo() const { return RI; }
37 /// getPointerRegClass - Return the register class to use to hold pointers.
38 /// This is used for addressing modes.
39 virtual const TargetRegisterClass *getPointerRegClass() const;
41 // Return true if the instruction is a register to register move and
42 // leave the source and dest operands in the passed parameters.
44 virtual bool isMoveInstr(const MachineInstr& MI,
46 unsigned& destReg) const;
48 unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
49 unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;