package operand
import "github.com/mmcloughlin/avo/operand"
Package operand provides types for instruction operands.
Index ¶
- func Is1(op Op) bool
- func Is3(op Op) bool
- func IsAL(op Op) bool
- func IsAX(op Op) bool
- func IsCL(op Op) bool
- func IsEAX(op Op) bool
- func IsGP(op Op, n uint) bool
- func IsIMM16(op Op) bool
- func IsIMM2U(op Op) bool
- func IsIMM32(op Op) bool
- func IsIMM64(op Op) bool
- func IsIMM8(op Op) bool
- func IsK(op Op) bool
- func IsM(op Op) bool
- func IsM128(op Op) bool
- func IsM16(op Op) bool
- func IsM256(op Op) bool
- func IsM32(op Op) bool
- func IsM512(op Op) bool
- func IsM64(op Op) bool
- func IsM8(op Op) bool
- func IsMReg(op Op) bool
- func IsMSize(op Op, n uint) bool
- func IsMem(op Op) bool
- func IsPseudo(op Op) bool
- func IsR16(op Op) bool
- func IsR32(op Op) bool
- func IsR64(op Op) bool
- func IsR8(op Op) bool
- func IsRAX(op Op) bool
- func IsREL32(op Op) bool
- func IsREL8(op Op) bool
- func IsRegister(op Op) bool
- func IsRegisterKind(op Op, k reg.Kind) bool
- func IsRegisterKindSize(op Op, k reg.Kind, n uint) bool
- func IsRel(op Op) bool
- func IsVM32X(op Op) bool
- func IsVM32Y(op Op) bool
- func IsVM32Z(op Op) bool
- func IsVM64X(op Op) bool
- func IsVM64Y(op Op) bool
- func IsVM64Z(op Op) bool
- func IsVmx(op Op) bool
- func IsVmy(op Op) bool
- func IsVmz(op Op) bool
- func IsXMM(op Op) bool
- func IsXMM0(op Op) bool
- func IsYMM(op Op) bool
- func IsZMM(op Op) bool
- func Registers(op Op) []reg.Register
- type Constant
- type F32
- type F64
- type I16
- type I32
- type I64
- type I8
- type LabelRef
- type Mem
- func NewDataAddr(sym Symbol, offset int) Mem
- func NewParamAddr(name string, offset int) Mem
- func NewStackAddr(offset int) Mem
- func (m Mem) Asm() string
- func (m Mem) Idx(r reg.Register, s uint8) Mem
- func (m Mem) Offset(idx int) Mem
- type Op
- type Rel
- type String
- type Symbol
- type U16
- type U32
- type U64
- type U8
Functions ¶
func Is1 ¶
Is1 returns true if op is the immediate constant 1.
func Is3 ¶
Is3 returns true if op is the immediate constant 3.
func IsAL ¶
IsAL returns true if op is the AL register.
func IsAX ¶
IsAX returns true if op is the 16-bit AX register.
func IsCL ¶
IsCL returns true if op is the CL register.
func IsEAX ¶
IsEAX returns true if op is the 32-bit EAX register.
func IsGP ¶
IsGP returns true if op is a general-purpose register of size n bytes.
func IsIMM16 ¶
IsIMM16 returns true is op is a 16-bit immediate.
func IsIMM2U ¶
IsIMM2U returns true if op is a 2-bit unsigned immediate (less than 4).
func IsIMM32 ¶
IsIMM32 returns true is op is a 32-bit immediate.
func IsIMM64 ¶
IsIMM64 returns true is op is a 64-bit immediate.
func IsIMM8 ¶
IsIMM8 returns true is op is an 8-bit immediate.
func IsK ¶
IsK returns true if op is an Opmask register.
func IsM ¶
IsM returns true if op is a 16-, 32- or 64-bit memory operand.
func IsM128 ¶
IsM128 returns true if op is a 128-bit memory operand.
func IsM16 ¶
IsM16 returns true if op is a 16-bit memory operand.
func IsM256 ¶
IsM256 returns true if op is a 256-bit memory operand.
func IsM32 ¶
IsM32 returns true if op is a 16-bit memory operand.
func IsM512 ¶
IsM512 returns true if op is a 512-bit memory operand.
func IsM64 ¶
IsM64 returns true if op is a 64-bit memory operand.
func IsM8 ¶
IsM8 returns true if op is an 8-bit memory operand.
func IsMReg ¶
IsMReg returns true if op is a register that can be used in a memory operand.
func IsMSize ¶
IsMSize returns true if op is a memory operand using general-purpose address registers of the given size in bytes.
func IsMem ¶
IsMem returns whether op has type Mem.
func IsPseudo ¶
IsPseudo returns true if op is a pseudo register.
func IsR16 ¶
IsR16 returns true if op is a 16-bit general-purpose register.
func IsR32 ¶
IsR32 returns true if op is a 32-bit general-purpose register.
func IsR64 ¶
IsR64 returns true if op is a 64-bit general-purpose register.
func IsR8 ¶
IsR8 returns true if op is an 8-bit general-purpose register.
func IsRAX ¶
IsRAX returns true if op is the 64-bit RAX register.
func IsREL32 ¶
IsREL32 returns true if op is an offset relative to instruction pointer, or a label reference.
func IsREL8 ¶
IsREL8 returns true if op is an 8-bit offset relative to instruction pointer.
func IsRegister ¶
IsRegister returns whether op has type reg.Register.
func IsRegisterKind ¶
IsRegisterKind returns true if op is a register of the given kind.
func IsRegisterKindSize ¶
IsRegisterKindSize returns true if op is a register of the given kind and size in bytes.
func IsRel ¶
IsRel returns whether op has type Rel.
func IsVM32X ¶
IsVM32X returns true if op is a vector memory operand with 32-bit XMM index.
func IsVM32Y ¶
IsVM32Y returns true if op is a vector memory operand with 32-bit YMM index.
func IsVM32Z ¶
IsVM32Z returns true if op is a vector memory operand with 32-bit ZMM index.
func IsVM64X ¶
IsVM64X returns true if op is a vector memory operand with 64-bit XMM index.
func IsVM64Y ¶
IsVM64Y returns true if op is a vector memory operand with 64-bit YMM index.
func IsVM64Z ¶
IsVM64Z returns true if op is a vector memory operand with 64-bit ZMM index.
func IsVmx ¶
IsVmx returns true if op is a vector memory operand with XMM index.
func IsVmy ¶
IsVmy returns true if op is a vector memory operand with YMM index.
func IsVmz ¶
IsVmz returns true if op is a vector memory operand with ZMM index.
func IsXMM ¶
IsXMM returns true if op is a 128-bit XMM register.
func IsXMM0 ¶
IsXMM0 returns true if op is the X0 register.
func IsYMM ¶
IsYMM returns true if op is a 256-bit YMM register.
func IsZMM ¶
IsZMM returns true if op is a 512-bit ZMM register.
func Registers ¶
Registers returns the list of all operands involved in the given operand.
Types ¶
type Constant ¶
Constant represents a constant literal.
func Imm ¶
Imm returns an unsigned integer constant with size guessed from x.
type F32 ¶
type F32 float32
F32 is a 32-bit floating point constant.
func (F32) Asm ¶
func (F32) Bytes ¶
func (F32) String ¶
String returns a representation the 32-bit float which is guaranteed to be parsed as a floating point constant by the Go assembler.
type F64 ¶
type F64 float64
F64 is a 64-bit floating point constant.
func (F64) Asm ¶
func (F64) Bytes ¶
func (F64) String ¶
String returns a representation the 64-bit float which is guaranteed to be parsed as a floating point constant by the Go assembler.
type I16 ¶
type I16 int16
I16 is a 16-bit signed integer constant.
func (I16) Asm ¶
func (I16) Bytes ¶
type I32 ¶
type I32 int32
I32 is a 32-bit signed integer constant.
func (I32) Asm ¶
func (I32) Bytes ¶
type I64 ¶
type I64 int64
I64 is a 64-bit signed integer constant.
func (I64) Asm ¶
func (I64) Bytes ¶
type I8 ¶
type I8 int8
I8 is a 8-bit signed integer constant.
func (I8) Asm ¶
func (I8) Bytes ¶
type LabelRef ¶
type LabelRef string
LabelRef is a reference to a label.
func (LabelRef) Asm ¶
Asm returns an assembly syntax representation of l.
type Mem ¶
Mem represents a memory reference.
func NewDataAddr ¶
NewDataAddr returns a memory reference relative to the named data symbol.
func NewParamAddr ¶
NewParamAddr is a convenience to build a Mem operand pointing to a function parameter, which is a named offset from the frame pointer pseudo register.
func NewStackAddr ¶
NewStackAddr returns a memory reference relative to the stack pointer.
func (Mem) Asm ¶
Asm returns an assembly syntax representation of m.
func (Mem) Idx ¶
Idx returns a new memory reference with (Index, Scale) set to (r, s).
func (Mem) Offset ¶
Offset returns a reference to m plus idx bytes.
type Op ¶
type Op interface { Asm() string }
Op is an operand.
func ApplyAllocation ¶
func ApplyAllocation(op Op, a reg.Allocation) Op
ApplyAllocation returns an operand with allocated registers replaced. Registers missing from the allocation are left alone.
type Rel ¶
type Rel int32
Rel is an offset relative to the instruction pointer.
func (Rel) Asm ¶
Asm returns an assembly syntax representation of r.
type String ¶
type String string
String is a string constant.
func (String) Asm ¶
Asm returns an assembly syntax representation of the string s.
func (String) Bytes ¶
Bytes returns the length of s.
type Symbol ¶
Symbol represents a symbol name.
func NewStaticSymbol ¶
NewStaticSymbol builds a static Symbol. Static symbols are only visible in the current source file.
func (Symbol) String ¶
type U16 ¶
type U16 uint16
U16 is a 16-bit unsigned integer constant.
func (U16) Asm ¶
func (U16) Bytes ¶
type U32 ¶
type U32 uint32
U32 is a 32-bit unsigned integer constant.
func (U32) Asm ¶
func (U32) Bytes ¶
type U64 ¶
type U64 uint64
U64 is a 64-bit unsigned integer constant.
func (U64) Asm ¶
func (U64) Bytes ¶
type U8 ¶
type U8 uint8
U8 is a 8-bit unsigned integer constant.
func (U8) Asm ¶
func (U8) Bytes ¶
Source Files ¶
checks.go const.go doc.go types.go zconst.go
- Version
- v0.6.0 (latest)
- Published
- Jan 7, 2024
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 3 weeks ago –
Tools for package owners.