Documentation ¶
Overview ¶
Package inst is the avo instruction database.
Index ¶
- Variables
- func ISACombinations(is []Instruction) [][]string
- func ISAs(is []Instruction) []string
- func ImplicitRegisters(is []Instruction) []string
- func OperandTypes(is []Instruction) []string
- func SuffixesClasses(is []Instruction) map[string][]Suffixes
- type Action
- type EncodingType
- type Form
- type Forms
- type ImplicitOperand
- type Instruction
- type Operand
- type Suffix
- type Suffixes
Constants ¶
This section is empty.
Variables ¶
var Instructions = []Instruction{}/* 1308 elements not displayed */
Functions ¶
func ISACombinations ¶
func ISACombinations(is []Instruction) [][]string
ISACombinations returns all the unique combinations of ISAs seen in the given instructions.
func ISAs ¶
func ISAs(is []Instruction) []string
ISAs returns all the unique ISAs seen in the given instructions.
func ImplicitRegisters ¶
func ImplicitRegisters(is []Instruction) []string
ImplicitRegisters returns all the registers that appear as implicit operands in the provided instructions.
func OperandTypes ¶
func OperandTypes(is []Instruction) []string
OperandTypes returns all the operand types that appear in the provided instructions.
func SuffixesClasses ¶
func SuffixesClasses(is []Instruction) map[string][]Suffixes
SuffixesClasses returns all possible classes of suffix combinations.
Types ¶
type Action ¶
type Action uint8
Action specifies the read/write operation of an instruction on an operand.
Possible Action types.
func ActionFromReadWrite ¶
ActionFromReadWrite builds an Action from boolean flags.
func (Action) ContainsAll ¶
ContainsAll reports whether a supports all actions in s.
func (Action) ContainsAny ¶
ContainsAny reports whether a supports any actions in s.
type EncodingType ¶
type EncodingType uint8
EncodingType specifies a category of encoding types.
const ( EncodingTypeLegacy EncodingType = 1 + iota EncodingTypeREX EncodingTypeVEX EncodingTypeEVEX )
Supported encoding types.
type Form ¶
type Form struct { // Instruction sets this instruction form requires. ISA []string // Operands required for this form. Operands []Operand // Registers read or written but not explicitly passed to the instruction. ImplicitOperands []ImplicitOperand // Encoding type required for this instruction form. EncodingType EncodingType // CancellingInputs indicates this instruction form has no dependency on the // input operands when they refer to the same register. The classic example of // this is "XORQ RAX, RAX", in which case the output has no dependence on the // value of RAX. Instruction forms with cancelling inputs have only two input // operands, which have the same register type. CancellingInputs bool // Zeroing indicates whether the instruction form uses AVX-512 zeroing. This // is the .Z suffix in Go, usually indicated with {z} operand suffix in // Intel manuals. Zeroing bool // EmbeddedRounding indicates whether the instruction form uses AVX-512 // embedded rounding. This is the RN_SAE, RZ_SAE, RD_SAE and RU_SAE suffixes // in Go, usually indicated with {er} in Intel manuals. EmbeddedRounding bool // SuppressAllExceptions indicates whether the instruction form uses AVX-512 // "suppress all exceptions". This is the SAE suffix in Go, usually // indicated with {sae} in Intel manuals. SuppressAllExceptions bool // Broadcast indicates whether the instruction form uses AVX-512 // broadcast. This is the BCST suffix in Go, usually indicated by operand // types like "m64bcst" in Intel manuals. Broadcast bool }
Form specifies one accepted set of operands for an instruction.
func (Form) AcceptsSuffixes ¶
AcceptsSuffixes reports whether this form takes any opcode suffixes.
func (Form) SuffixesClass ¶
SuffixesClass returns a key representing the class of instruction suffixes it accepts. All instructions sharing a suffix class accept the same suffixes.
func (Form) SupportedSuffixes ¶
SupportedSuffixes returns the list of all possible suffix combinations supported by this instruction form.
type Forms ¶
type Forms []Form
Forms is a collection of instruction forms.
func (Forms) Arity ¶
Arity is a convenience for returning the unique instruction arity when you know it is not variadic. Panics for a variadic instruction.
func (Forms) IsVariadic ¶
IsVariadic reports whether the instruction has more than one arity.
type ImplicitOperand ¶
ImplicitOperand describes a register that is implicitly read/written by an instruction.
type Instruction ¶
type Instruction struct { Opcode string // Golang assembly mnemonic AliasOf string // Opcode of instruction that this is an alias for Summary string // Description of the instruction Forms // Accepted operand forms }
Instruction represents an x86 instruction.
func Lookup ¶
func Lookup(opcode string) (Instruction, bool)
Lookup returns the instruction with the given opcode. Boolean return value indicates whether the instruction was found.
func (Instruction) IsBranch ¶
func (i Instruction) IsBranch() bool
IsBranch reports whether the instruction is a branch; that is, if it can cause control flow to jump to another location.
func (Instruction) IsConditionalBranch ¶
func (i Instruction) IsConditionalBranch() bool
IsConditionalBranch reports whether the instruction branches dependent on some condition.
func (Instruction) IsTerminal ¶
func (i Instruction) IsTerminal() bool
IsTerminal reports whether the instruction exits a function.
type Operand ¶
Operand is an operand to an instruction, describing the expected type and read/write action.
type Suffix ¶
type Suffix string
Suffix is an opcode suffix.
const ( BCST Suffix = "BCST" RN_SAE Suffix = "RN_SAE" RZ_SAE Suffix = "RZ_SAE" RD_SAE Suffix = "RD_SAE" RU_SAE Suffix = "RU_SAE" SAE Suffix = "SAE" Z Suffix = "Z" )
Supported opcode suffixes in x86 assembly.
func UniqueSuffixes ¶
func UniqueSuffixes(is []Instruction) []Suffix
UniqueSuffixes returns all the non-empty suffixes that appear in the provided instructions.