Class InterferenceRegisterMapper


public class InterferenceRegisterMapper extends BasicRegisterMapper
A register mapper that keeps track of the accumulated interference information for the registers in the new namespace. Please note that this mapper requires that the old namespace does not have variable register widths/categories, and the new namespace does.
  • Constructor Details

    • InterferenceRegisterMapper

      public InterferenceRegisterMapper(InterferenceGraph oldRegInterference, int countOldRegisters)
      Constructs an instance
      Parameters:
      countOldRegisters - number of registers in old namespace
  • Method Details

    • addMapping

      public void addMapping(int oldReg, int newReg, int category)
      Adds a mapping to the mapper. If oldReg has already been mapped, overwrites previous mapping with new mapping.
      Overrides:
      addMapping in class BasicRegisterMapper
      Parameters:
      oldReg - >= 0; old register
      newReg - >= 0; new register
      category - 1..2; width of reg
    • interferes

      public boolean interferes(int oldReg, int newReg, int category)
      Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.
      Parameters:
      oldReg - old namespace register
      newReg - new namespace register
      category - category of old namespace register
      Returns:
      true if oldReg will interfere with newReg
    • interferes

      public boolean interferes(RegisterSpec oldSpec, int newReg)
      Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.
      Parameters:
      oldSpec - non-null; old namespace register
      newReg - new namespace register
      Returns:
      true if oldReg will interfere with newReg
    • areAnyPinned

      public boolean areAnyPinned(RegisterSpecList oldSpecs, int newReg, int targetCategory)
      Checks to see if any of a set of old-namespace registers are pinned to the specified new-namespace reg + category. Takes into account the category of the old-namespace registers.
      Parameters:
      oldSpecs - non-null; set of old-namespace regs
      newReg - >= 0; new-namespace register
      targetCategory - 1..2; the number of adjacent new-namespace registers (starting at ropReg) to consider
      Returns:
      true if any of the old-namespace register have been mapped to the new-namespace register + category