x86

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Rex  = (1 << 6)
	RexW = Rex | (1 << 3)
	RexR = Rex | (1 << 2)
	RexX = Rex | (1 << 1)
	RexB = Rex | (1 << 0)
)
View Source
const (
	ModMem       = modEnum(0)
	ModMemDisp8  = modEnum((0 << 7) | (1 << 6))
	ModMemDisp32 = modEnum((1 << 7) | (0 << 6))
	ModReg       = modEnum((1 << 7) | (1 << 6))
)
View Source
const (
	MemSIB    = byte((1 << 2))
	MemDisp32 = byte((1 << 2) | (1 << 0))
)
View Source
const (
	NoIndex = reg.R((1 << 2))
	NoBase  = reg.R((1 << 2) | (1 << 0))
)
View Source
const (
	RegResult         = reg.Result // rax or xmm0
	RegShiftCount     = reg.R(1)   // rcx
	RegScratch        = reg.R(2)   // rdx or xmm2
	RegImportArgCount = reg.R(2)   // rdx
	RegImportSigIndex = reg.R(3)   // rbx
	RegStackPtr       = reg.R(4)   // rsp
	RegSuspendFlag    = reg.R(9)   // r9
	RegTextBase       = reg.R(12)  // r12
	RegStackLimit     = reg.R(13)  // r13
	RegMemoryBase     = reg.R(14)  // r14
	RegMemoryLimit    = reg.R(15)  // r15

	RegTrapHandlerMMX     = reg.R(0) // mm0
	RegMemoryGrowLimitMMX = reg.R(1) // mm1
	RegScratchMMX         = reg.R(2) // mm2
)
View Source
const (
	FuncAlignment = 16
	PaddingByte   = 0xcc // int3 instruction
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ISA

type ISA struct{}

func (ISA) AlignFunc

func (ISA) AlignFunc(m *module.M)

func (ISA) AvailRegs

func (ISA) AvailRegs() uint64

func (ISA) BinaryOp

func (ISA) BinaryOp(f *gen.Func, props uint16, a, b val.Operand) val.Operand

func (ISA) ClearInsnCache

func (ISA) ClearInsnCache()

func (ISA) ConversionOp

func (ISA) ConversionOp(f *gen.Func, props uint16, resultType abi.Type, source val.Operand) (result val.Operand)

func (ISA) LoadOp

func (ISA) LoadOp(f *gen.Func, props uint16, index val.Operand, resultType abi.Type, offset uint32) (result val.Operand)

LoadOp makes sure that index gets zero-extended if it's a VarReg operand.

func (ISA) OpAddStackPtrImm

func (ISA) OpAddStackPtrImm(m *module.M, offset int32)

OpAddStackPtrImm must not allocate registers.

func (ISA) OpAddStackPtrUpper32

func (ISA) OpAddStackPtrUpper32(m *module.M, r reg.R)

OpAddStackPtrUpper32 must not allocate registers.

func (ISA) OpBranch

func (ISA) OpBranch(m *module.M, addr int32) int32

func (ISA) OpBranchIf

func (ISA) OpBranchIf(f *gen.Func, x val.Operand, yes bool, addr int32) (sites []int32)

func (ISA) OpBranchIfOutOfBounds

func (ISA) OpBranchIfOutOfBounds(m *module.M, indexReg reg.R, upperBound, addr int32) int32

OpBranchIfOutOfBounds must not allocate registers. indexReg will be zero-extended.

func (ISA) OpBranchIndirect32

func (ISA) OpBranchIndirect32(m *module.M, r reg.R, regZeroExt bool)

OpBranchIndirect32 must not allocate registers. The supplied register is trashed.

func (ISA) OpCall

func (ISA) OpCall(m *module.M, addr int32) (retAddr int32)

func (ISA) OpCallIndirect

func (ISA) OpCallIndirect(f *gen.Func, tableLen, sigIndex int32) int32

OpCallIndirect using table index located in result register.

func (ISA) OpClearIntResultReg

func (ISA) OpClearIntResultReg(m *module.M)

OpClearIntResultReg may update CPU's condition flags.

func (ISA) OpCopyStack

func (ISA) OpCopyStack(m *module.M, targetOffset, sourceOffset int32)

OpCopyStack must not allocate registers.

func (ISA) OpCurrentMemory

func (ISA) OpCurrentMemory(m *module.M) val.Operand

func (ISA) OpEnterExitTrapHandler

func (ISA) OpEnterExitTrapHandler(m *module.M)

func (ISA) OpEnterFunc

func (ISA) OpEnterFunc(f *gen.Func)

func (ISA) OpEnterImportFunc

func (ISA) OpEnterImportFunc(m *module.M, absAddr uint64, variadic bool, argCount, sigIndex int)

func (ISA) OpEnterTrapHandler

func (ISA) OpEnterTrapHandler(m *module.M, id trap.Id)

OpEnterTrapHandler must not generate over 16 bytes of m.Text.

func (ISA) OpGetGlobal

func (ISA) OpGetGlobal(f *gen.Func, t abi.Type, offset int32) val.Operand

OpGetGlobal must not update CPU's condition flags.

func (ISA) OpGrowMemory

func (ISA) OpGrowMemory(f *gen.Func, x val.Operand) val.Operand

func (ISA) OpInit

func (ISA) OpInit(m *module.M)

func (ISA) OpInitCall

func (ISA) OpInitCall(m *module.M) (retAddr int32)

func (ISA) OpLoadIntROData

func (ISA) OpLoadIntROData(f *gen.Func, t abi.Type, r reg.R, scale uint8, addr int32)

OpLoadIntROData must not allocate registers. The register is both the index (source) and the target register. The index must have been zero-extended.

func (ISA) OpMove

func (ISA) OpMove(f *gen.Func, targetReg reg.R, x val.Operand, preserveFlags bool) (zeroExt bool)

OpMove must not update CPU's condition flags if preserveFlags is set.

func (ISA) OpMoveI32Reg

func (ISA) OpMoveI32Reg(m *module.M, target, source reg.R)

OpMoveI32Reg must not allocate registers or update CPU's condition flags. It must zero-extend.

func (ISA) OpMoveIntImm

func (ISA) OpMoveIntImm(m *module.M, r reg.R, value uint64)

OpMoveIntImm may update CPU's condition flags.

func (ISA) OpMoveReg

func (ISA) OpMoveReg(m *module.M, t abi.Type, targetReg, sourceReg reg.R)

OpMoveReg must not allocate registers.

func (ISA) OpPush

func (ISA) OpPush(f *gen.Func, x val.Operand)

OpPush must not allocate registers, and must not update CPU's condition flags unless the operand is the condition flags.

func (ISA) OpReturn

func (ISA) OpReturn(m *module.M)

func (ISA) OpSelect

func (ISA) OpSelect(f *gen.Func, a, b, condOperand val.Operand) val.Operand

func (ISA) OpSetGlobal

func (ISA) OpSetGlobal(f *gen.Func, offset int32, x val.Operand)

OpSetGlobal must not update CPU's condition flags.

func (ISA) OpStoreStack

func (ISA) OpStoreStack(f *gen.Func, offset int32, x val.Operand)

OpStoreStack must not allocate registers.

func (ISA) OpStoreStackReg

func (ISA) OpStoreStackReg(m *module.M, t abi.Type, offset int32, r reg.R)

OpStoreStackReg must not allocate registers.

func (ISA) OpSwap

func (ISA) OpSwap(m *module.M, cat abi.Category, a, b reg.R)

OpSwap must not allocate registers, or update CPU's condition flags.

func (ISA) OpTrapCall

func (ISA) OpTrapCall(f *gen.Func, id trap.Id)

func (ISA) OpTrapIfStackExhausted

func (ISA) OpTrapIfStackExhausted(f *gen.Func) (stackCheckAddr int32)

func (ISA) ParamRegs

func (ISA) ParamRegs() [2][]reg.R

func (ISA) PutUint32

func (ISA) PutUint32(b []byte, val uint32)

func (ISA) StoreOp

func (ISA) StoreOp(f *gen.Func, props uint16, index, x val.Operand, offset uint32)

StoreOp makes sure that index gets zero-extended if it's a VarReg operand.

func (ISA) UnaryOp

func (ISA) UnaryOp(f *gen.Func, props uint16, x val.Operand) val.Operand

func (ISA) UpdateBranches

func (ISA) UpdateBranches(text []byte, l *link.L)

UpdateBranches modifies 32-bit relocations of Jmp and Jcc instructions.

func (ISA) UpdateCalls

func (ISA) UpdateCalls(text []byte, l *link.L)

UpdateCalls modifies CallRel instructions, possibly while they are being executed.

func (ISA) UpdateStackCheck

func (ISA) UpdateStackCheck(text []byte, addr, disp int32)

UpdateStackCheck modifies the 32-bit displacement of a Lea instruction.

Jump to

Keyboard shortcuts

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