arch

package
v0.0.0-...-04e615e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2015 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

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

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

Variables

View Source
var Pseudos = map[string]int{
	"DATA":     obj.ADATA,
	"FUNCDATA": obj.AFUNCDATA,
	"GLOBL":    obj.AGLOBL,
	"PCDATA":   obj.APCDATA,
	"TEXT":     obj.ATEXT,
}

Functions

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 ARMConditionCodes

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

ARMConditionCodes handles the special condition code situation for the ARM. It returns a boolean to indicate success; failure means cond was unrecognized.

func ARMMRCOffset

func ARMMRCOffset(op int, cond string, x0, x1, x2, x3, x4, x5 int64) (offset int64, op0 int16, ok bool)

ARMMRCOffset implements the peculiar encoding of the MRC and MCR instructions. The difference between MRC and MCR is represented by a bit high in the word, not in the usual way by the opcode itself. Asm must use AMRC for both instructions, so we return the opcode for MRC so that asm doesn't need to import obj/arm.

func IsARM64CMP

func IsARM64CMP(op int) 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 int) 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 IsARMCMP

func IsARMCMP(op int) bool

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

func IsARMFloatCmp

func IsARMFloatCmp(op int) bool

IsARMFloatCmp reports whether the op is a floating comparison instruction.

func IsARMMRC

func IsARMMRC(op int) bool

IsARMMRC reports whether the op (as defined by an arm.A* constant) is MRC or MCR

func IsARMMULA

func IsARMMULA(op int) bool

IsARMMULA reports whether the op (as defined by an arm.A* constant) is MULA, MULAWT or MULAWB, the 4-operand instructions.

func IsARMSTREX

func IsARMSTREX(op int) bool

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

func IsPPC64CMP

func IsPPC64CMP(op int) bool

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

func IsPPC64NEG

func IsPPC64NEG(op int) 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 int) 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 ParseARM64Suffix

func ParseARM64Suffix(cond string) (uint8, bool)

ParseARM64Suffix parses the suffix attached to an ARM64 instruction. The input is a single string consisting of period-separated condition codes, such as ".P.W". An initial period is ignored.

func ParseARMCondition

func ParseARMCondition(cond string) (uint8, bool)

ParseARMCondition parses the conditions attached to an ARM instruction. The input is a single string consisting of period-separated condition codes, such as ".P.W". An initial period is ignored.

Types

type Arch

type Arch struct {
	*obj.LinkArch
	// Map of instruction names to enumeration.
	Instructions map[string]int
	// 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL