NuPlusInstrInfo class

From NaplesPU Documentation
Jump to: navigation, search

The NuPlusInstrInfo class implements the NuPlusInstrInfo interface generetaed by Tablegen which inherits from TargetInstrInfo class. It describes the target machine instruction set to the code generator.

The NuPlusInstrInfo class implements the following methods:

  • getRegisterInfo, returns the NuPlusRegisterInfo private object.
  • isLoadFromStackSlot, determines if the specified machine instruction is a direct load from a stack slot and return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot. If not, return 0.
  • isStoreToStackSlot, similar to isLoadFromStackSlot.
  • analyzeBranch, analyze the branching code at the end of MBB, returning true if it cannot be understood, false otherwise.
  • RemoveBranch, invoked in cases where AnalyzeBranch returns success, it removes the branching code at the end of the specific MBB and returns the number of instructions that were removed.
  • InsertBranch, inserts a branch code into the end of the specified MachineBasicBlock.
  • copyPhysReg, emits instructions to copy a pair of physical registers.
  • storeRegToStackSlot, stores the specified register of the given register class to the specified stack frame index.
  • loadRegFromStackSlot, similar to storeRegToStackSlot,
  • adjustStackPointer, utility function that emits instructions to adjust the stack pointer with the given amount.
  • loadConstant, utility function that emits the necessary instructions to load an immediate value. It is only used in adjustStackPointer.
  • getMemOperand, returns a MachineMemOperand describing a Load/Store operation to the stack. It is used in storeRegToStackSlot and loadRegFromStackSlot.