Class Register

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Register>
    Direct Known Subclasses:
    UnknownRegister

    public class Register
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Register>
    Class to represent a processor register. To sort of handle bit registers, a special addressing convention is used. First the upper bit is set. Second, the next 3 bits are used to specify what bit position within a byte that this register bit exists at. Finally, the rest of the address is the address of the byte where the register bit lives.
    See Also:
    Serialized Form
    • Constructor Detail

      • Register

        public Register​(java.lang.String name,
                        java.lang.String description,
                        Address address,
                        int numBytes,
                        boolean bigEndian,
                        int typeFlags)
        Constructs a new Register object.
        Parameters:
        name - the name of this Register.
        description - the description of this Register
        address - the address in register space of this register
        numBytes - the size (in bytes) of this register
        bigEndian - true if the most significant bytes are associated with the lowest register addresses, and false if the least significant bytes are associated with the lowest register addresses.
        typeFlags - the type(s) of this Register (TYPE_NONE, TYPE_FP, TYPE_SP, TYPE_PC, TYPE_CONTEXT, TYPE_ZERO);)
      • Register

        public Register​(Register register)
      • Register

        public Register​(java.lang.String name,
                        java.lang.String description,
                        Address address,
                        int numBytes,
                        int leastSignificantBit,
                        int bitLength,
                        boolean bigEndian,
                        int typeFlags)
    • Method Detail

      • getAliases

        public java.lang.Iterable<java.lang.String> getAliases()
        Return register aliases. NOTE: This is generally only supported for context register fields.
        Returns:
        register aliases or null
      • getName

        public java.lang.String getName()
        Gets the name of this Register.
        Returns:
        the name of this Register.
      • getDescription

        public java.lang.String getDescription()
        Get the description of the Register.
        Returns:
        the description of the register
      • isBigEndian

        public boolean isBigEndian()
      • getBitLength

        public int getBitLength()
        Gets the total number of bits for this Register.
        Returns:
        the total number of bits for this Register.
      • getMinimumByteSize

        public int getMinimumByteSize()
        Returns the minimum number of bytes required to store a value for this Register.
      • getOffset

        public int getOffset()
        Returns the offset into the register space for this register
      • getLeastSignificantBit

        public int getLeastSignificantBit()
        Returns the bit offset from the register address for this register.
        Returns:
        the bit offset from the register address for this register.
      • isDefaultFramePointer

        public boolean isDefaultFramePointer()
        Returns true if this is the default frame pointer register
      • followsFlow

        public boolean followsFlow()
        Returns true for a register whose context value should follow the disassembly flow.
      • isHidden

        public boolean isHidden()
        Returns true if this is a hidden register.
      • isProgramCounter

        public boolean isProgramCounter()
        Returns true if this is the program counter register
      • isProcessorContext

        public boolean isProcessorContext()
        Returns true if this is a processor state register
      • isZero

        public boolean isZero()
        Returns true for a register that is always zero
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • getAddressSpace

        public AddressSpace getAddressSpace()
        Returns the register address space
      • compareTo

        public int compareTo​(Register other)
        Specified by:
        compareTo in interface java.lang.Comparable<Register>
        See Also:
        Comparable.compareTo(java.lang.Object)
      • getAddress

        public Address getAddress()
        Returns the address of the register.
      • getParentRegister

        public Register getParentRegister()
      • getChildRegisters

        public java.util.List<Register> getChildRegisters()
        Returns list of children registers sorted by lest-significant bit-offset within this register.
      • getBaseRegister

        public Register getBaseRegister()
      • getLeastSignificatBitInBaseRegister

        public int getLeastSignificatBitInBaseRegister()
      • getTypeFlags

        public int getTypeFlags()
      • getBaseMask

        public byte[] getBaseMask()
        Returns the mask that indicates which bits in the base register apply to this register.
        Returns:
        the mask that indicates which bits in the base register apply to this register
      • hasChildren

        public boolean hasChildren()
      • getGroup

        public java.lang.String getGroup()
      • isBaseRegister

        public boolean isBaseRegister()
      • contains

        public boolean contains​(Register reg)
        Determines if reg is contained within this register. Method does not work for bit registers (e.g., context-bits)
        Parameters:
        reg - another register
        Returns:
        true if reg equals this register or is contained within it.
      • isVectorRegister

        public boolean isVectorRegister()
        Returns true if this is a vector register
        Returns:
        true precisely when this is a full vector register (i.e., a register that can be used as input or output for a SIMD operation).
      • isValidLaneSize

        public boolean isValidLaneSize​(int laneSizeInBytes)
        Determines whether laneSizeInBytes is a valid lane size for this register.
        Parameters:
        laneSizeInBytes - lane size to check, measured in bytes
        Returns:
        true precisely when this is a vector register and laneSizeInBytes is a valid lane size.
      • getLaneSizes

        public int[] getLaneSizes()
        Returns the sorted array of lane sizes for this register, measured in bytes.
        Returns:
        array of lane sizes, or null if this is not a vector register or no lane sizes have been set.