LLVM API Documentation

PIC16InstrInfo.h

Go to the documentation of this file.
00001 //===- PIC16InstrInfo.h - PIC16 Instruction Information----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the niversity of Illinois Open Source 
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the PIC16 implementation of the TargetInstrInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef PIC16INSTRUCTIONINFO_H
00015 #define PIC16INSTRUCTIONINFO_H
00016 
00017 #include "PIC16.h"
00018 #include "PIC16RegisterInfo.h"
00019 #include "llvm/Target/TargetInstrInfo.h"
00020 
00021 namespace llvm {
00022 
00023 
00024 class PIC16InstrInfo : public TargetInstrInfoImpl 
00025 {
00026   PIC16TargetMachine &TM;
00027   const PIC16RegisterInfo RegInfo;
00028 public:
00029   explicit PIC16InstrInfo(PIC16TargetMachine &TM);
00030 
00031   virtual const PIC16RegisterInfo &getRegisterInfo() const { return RegInfo; }
00032 
00033   /// isLoadFromStackSlot - If the specified machine instruction is a direct
00034   /// load from a stack slot, return the virtual or physical register number of
00035   /// the destination along with the FrameIndex of the loaded stack slot.  If
00036   /// not, return 0.  This predicate must return 0 if the instruction has
00037   /// any side effects other than loading from the stack slot.
00038   virtual unsigned isLoadFromStackSlot(const MachineInstr *MI, 
00039                                        int &FrameIndex) const;
00040                                                                                
00041   /// isStoreToStackSlot - If the specified machine instruction is a direct
00042   /// store to a stack slot, return the virtual or physical register number of
00043   /// the source reg along with the FrameIndex of the loaded stack slot.  If
00044   /// not, return 0.  This predicate must return 0 if the instruction has
00045   /// any side effects other than storing to the stack slot.
00046   virtual unsigned isStoreToStackSlot(const MachineInstr *MI, 
00047                                       int &FrameIndex) const;
00048 
00049   virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
00050                                    MachineBasicBlock::iterator MBBI,
00051                                    unsigned SrcReg, bool isKill, int FrameIndex,
00052                                    const TargetRegisterClass *RC) const;
00053                                                                                
00054   virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
00055                                     MachineBasicBlock::iterator MBBI,
00056                                     unsigned DestReg, int FrameIndex,
00057                                     const TargetRegisterClass *RC) const;
00058   virtual bool copyRegToReg(MachineBasicBlock &MBB,
00059                             MachineBasicBlock::iterator MBBI,
00060                             unsigned DestReg, unsigned SrcReg,
00061                             const TargetRegisterClass *DestRC,
00062                             const TargetRegisterClass *SrcRC) const;
00063   virtual bool isMoveInstr(const MachineInstr &MI,
00064                            unsigned &SrcReg, unsigned &DstReg,
00065                            unsigned &SrcSubIdx, unsigned &DstSubIdx) const;
00066 
00067 };
00068 
00069 } // namespace llvm
00070 
00071 #endif