blob: 6b69b75b0bbaeeb51e5a4066d6f81cc5eb344605 [file] [log] [blame]
Scott Michel8b6b4202007-12-04 22:35:58 +00001//===- 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
Scott Michel43e7c5e2007-12-05 01:40:25 +00006// Department at The Aerospace Corporation and is distributed under the
7// University of Illinois Open Source License. See LICENSE.TXT for details.
Scott Michel8b6b4202007-12-04 22:35:58 +00008//
9//===----------------------------------------------------------------------===//
10//
Scott Michel43e7c5e2007-12-05 01:40:25 +000011// This file contains the CellSPU implementation of the TargetInstrInfo class.
Scott Michel8b6b4202007-12-04 22:35:58 +000012//
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
22namespace 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