...

Package arch

import "cmd/asm/internal/arch"
Overview
Index

Overview ▾

Package arch defines architecture-specific information and support functions.

Constants

const (
    RFP = -(iota + 1)
    RSB
    RSP
    RPC
)

Pseudo-registers whose names are the constant name without the leading R.

func ARM64RegisterArrangement

func ARM64RegisterArrangement(reg int16, name, arng string) (int64, error)

ARM64RegisterArrangement parses an ARM64 vector register arrangement.

func ARM64RegisterExtension

func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, isIndex bool) error

ARM64RegisterExtension parses an ARM64 register with extension or arrangement.

func ARM64RegisterListOffset

func ARM64RegisterListOffset(firstReg, regCnt int, arrangement int64) (int64, error)

ARM64RegisterListOffset generates offset encoding according to AArch64 specification.

func ARM64Suffix

func ARM64Suffix(prog *obj.Prog, cond string) bool

ARM64Suffix handles the special suffix for the ARM64. It returns a boolean to indicate success; failure means cond was unrecognized.

func IsARM64CMP

func IsARM64CMP(op obj.As) bool

IsARM64CMP reports whether the op (as defined by an arm.A* constant) is one of the comparison instructions that require special handling.

func IsARM64STLXR

func IsARM64STLXR(op obj.As) bool

IsARM64STLXR reports whether the op (as defined by an arm64.A* constant) is one of the STLXR-like instructions that require special handling.

func IsARM64TBL

func IsARM64TBL(op obj.As) bool

IsARM64TBL reports whether the op (as defined by an arm64.A* constant) is one of the table lookup instructions that require special handling.

func IsMIPSCMP

func IsMIPSCMP(op obj.As) bool

IsMIPSCMP reports whether the op (as defined by an mips.A* constant) is one of the CMP instructions that require special handling.

func IsMIPSMUL

func IsMIPSMUL(op obj.As) bool

IsMIPSMUL reports whether the op (as defined by an mips.A* constant) is one of the MUL/DIV/REM/MADD/MSUB instructions that require special handling.

func IsPPC64CMP

func IsPPC64CMP(op obj.As) bool

IsPPC64CMP reports whether the op (as defined by an ppc64.A* constant) is one of the CMP instructions that require special handling.

func IsPPC64ISEL

func IsPPC64ISEL(op obj.As) bool

func IsPPC64NEG

func IsPPC64NEG(op obj.As) bool

IsPPC64NEG reports whether the op (as defined by an ppc64.A* constant) is one of the NEG-like instructions that require special handling.

func IsPPC64RLD

func IsPPC64RLD(op obj.As) bool

IsPPC64RLD reports whether the op (as defined by an ppc64.A* constant) is one of the RLD-like instructions that require special handling. The FMADD-like instructions behave similarly.

func IsS390xCMP

func IsS390xCMP(op obj.As) bool

IsS390xCMP reports whether the op (as defined by an s390x.A* constant) is one of the CMP instructions that require special handling.

func IsS390xNEG

func IsS390xNEG(op obj.As) bool

IsS390xNEG reports whether the op (as defined by an s390x.A* constant) is one of the NEG-like instructions that require special handling.

type Arch

type Arch struct {
    *obj.LinkArch
    // Map of instruction names to enumeration.
    Instructions map[string]obj.As
    // Map of register names to enumeration.
    Register map[string]int16
    // Table of register prefix names. These are things like R for R(0) and SPR for SPR(268).
    RegisterPrefix map[string]bool
    // RegisterNumber converts R(10) into arm.REG_R10.
    RegisterNumber func(string, int16) (int16, bool)
    // Instruction is a jump.
    IsJump func(word string) bool
}

Arch wraps the link architecture object with more architecture-specific information.

func Set

func Set(GOARCH string) *Arch

Set configures the architecture specified by GOARCH and returns its representation. It returns nil if GOARCH is not recognized.