go/pkg/mod/github.com/mmcloughlin/[email protected]/reg/types.go

type Kind

type Index

type Family

// define builds a register and adds it to the Family.
func (f *Family) define(s Spec, idx Index, name string, flags ...Info) Physical {}

// add r to the family.
func (f *Family) add(r Physical) {}

// Virtual returns a virtual register from this family's kind.
func (f *Family) Virtual(idx Index, s Spec) Virtual {}

// Registers returns the registers in this family.
func (f *Family) Registers() []Physical {}

// Lookup returns the register with given physical index and spec. Returns nil if no such register exists.
func (f *Family) Lookup(idx Index, s Spec) Physical {}

type ID

// newid builds a new register ID from the virtual flag v, kind and index.
func newid(v uint8, kind Kind, idx Index) ID {}

// IsVirtual reports whether this is an ID for a virtual register.
func (id ID) IsVirtual() bool {}

// IsPhysical reports whether this is an ID for a physical register.
func (id ID) IsPhysical() bool {}

// Kind extracts the kind from the register ID.
func (id ID) Kind() Kind {}

// Index extracts the index from the register ID.
func (id ID) Index() Index {}

type Register

// Equal reports whether a and b are equal registers.
func Equal(a, b Register) bool {}

type Virtual

// ToVirtual converts r to Virtual if possible, otherwise returns nil.
func ToVirtual(r Register) Virtual {}

type virtual

// NewVirtual builds a Virtual register.
func NewVirtual(idx Index, k Kind, s Spec) Virtual {}

func (v virtual) ID() ID              {}

func (v virtual) VirtualIndex() Index {}

func (v virtual) Kind() Kind          {}

func (v virtual) Asm() string {}

func (v virtual) as(s Spec) Register {}

func (v virtual) spec() Spec {}

func (v virtual) register()  {}

type Info

const None

const Restricted

const BasePointer

type Physical

// ToPhysical converts r to Physical if possible, otherwise returns nil.
func ToPhysical(r Register) Physical {}

type register

func newregister(f *Family, s Spec, idx Index, name string, flags ...Info) register {}

func (r register) ID() ID               {}

func (r register) PhysicalIndex() Index {}

func (r register) Kind() Kind           {}

func (r register) Asm() string          {}

func (r register) Info() Info           {}

func (r register) as(s Spec) Register {}

func (r register) spec() Spec {}

func (r register) register()  {}

type Spec

const S0

const S8L

const S8H

const S8

const S16

const S32

const S64

const S128

const S256

const S512

// Mask returns a mask representing which bytes of an underlying register are
// used by this register. This is almost always the low bytes, except for the
// case of the high-byte registers. If bit n of the mask is set, this means
// bytes 2^(n-1) to 2^n-1 are used.
func (s Spec) Mask() uint16 {}

// Size returns the register width in bytes.
func (s Spec) Size() uint {}

// LookupPhysical returns the physical register with the given parameters, or nil if not found.
func LookupPhysical(k Kind, idx Index, s Spec) Physical {}

// LookupID returns the physical register with the given id and spec, or nil if not found.
func LookupID(id ID, s Spec) Physical {}

type Allocation

// NewEmptyAllocation builds an empty register allocation.
func NewEmptyAllocation() Allocation {}

// Merge allocations from b into a. Errors if there is disagreement on a common
// register.
func (a Allocation) Merge(b Allocation) error {}

// LookupDefault returns the register ID assigned by this allocation, returning
// id if none is found.
func (a Allocation) LookupDefault(id ID) ID {}

// LookupRegister the allocation for register r, or return nil if there is none.
func (a Allocation) LookupRegister(r Register) Physical {}

// LookupRegisterDefault returns the register assigned to r, or r itself if there is none.
func (a Allocation) LookupRegisterDefault(r Register) Register {}