blob: ffc922aa214f81d362758f63d5368a9d0692c5c7 [file] [log] [blame]
Scott Michel66377522007-12-04 22:35:58 +00001//===- SPUInstrInfo.h - Cell SPU Instruction Information --------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Scott Michel66377522007-12-04 22:35:58 +00007//
8//===----------------------------------------------------------------------===//
9//
Scott Michel2466c372007-12-05 01:40:25 +000010// This file contains the CellSPU implementation of the TargetInstrInfo class.
Scott Michel66377522007-12-04 22:35:58 +000011//
12//===----------------------------------------------------------------------===//
13
14#ifndef SPU_INSTRUCTIONINFO_H
15#define SPU_INSTRUCTIONINFO_H
16
17#include "SPU.h"
18#include "llvm/Target/TargetInstrInfo.h"
19#include "SPURegisterInfo.h"
20
21namespace llvm {
22 //! Cell SPU instruction information class
23 class SPUInstrInfo : public TargetInstrInfo
24 {
25 SPUTargetMachine &TM;
26 const SPURegisterInfo RI;
27 public:
28 SPUInstrInfo(SPUTargetMachine &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 MRegisterInfo &getRegisterInfo() const { return RI; }
35
36 /// getPointerRegClass - Return the register class to use to hold pointers.
37 /// This is used for addressing modes.
38 virtual const TargetRegisterClass *getPointerRegClass() const;
39
40 // Return true if the instruction is a register to register move and
41 // leave the source and dest operands in the passed parameters.
42 //
43 virtual bool isMoveInstr(const MachineInstr& MI,
44 unsigned& sourceReg,
45 unsigned& destReg) const;
46
47 unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
48 unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
49 };
50}
51
52#endif