Documentation
¶
Index ¶
- Constants
- type ISA
- func (ISA) AlignFunc(m *module.M)
- func (ISA) AvailRegs() uint64
- func (ISA) BinaryOp(f *gen.Func, props uint16, a, b val.Operand) val.Operand
- func (ISA) ClearInsnCache()
- func (ISA) ConversionOp(f *gen.Func, props uint16, resultType abi.Type, source val.Operand) (result val.Operand)
- func (ISA) LoadOp(f *gen.Func, props uint16, index val.Operand, resultType abi.Type, ...) (result val.Operand)
- func (ISA) OpAddStackPtrImm(m *module.M, offset int32)
- func (ISA) OpAddStackPtrUpper32(m *module.M, r reg.R)
- func (ISA) OpBranch(m *module.M, addr int32) int32
- func (ISA) OpBranchIf(f *gen.Func, x val.Operand, yes bool, addr int32) (sites []int32)
- func (ISA) OpBranchIfOutOfBounds(m *module.M, indexReg reg.R, upperBound, addr int32) int32
- func (ISA) OpBranchIndirect32(m *module.M, r reg.R, regZeroExt bool)
- func (ISA) OpCall(m *module.M, addr int32) (retAddr int32)
- func (ISA) OpCallIndirect(f *gen.Func, tableLen, sigIndex int32) int32
- func (ISA) OpClearIntResultReg(m *module.M)
- func (ISA) OpCopyStack(m *module.M, targetOffset, sourceOffset int32)
- func (ISA) OpCurrentMemory(m *module.M) val.Operand
- func (ISA) OpEnterExitTrapHandler(m *module.M)
- func (ISA) OpEnterFunc(f *gen.Func)
- func (ISA) OpEnterImportFunc(m *module.M, absAddr uint64, variadic bool, argCount, sigIndex int)
- func (ISA) OpEnterTrapHandler(m *module.M, id trap.Id)
- func (ISA) OpGetGlobal(f *gen.Func, t abi.Type, offset int32) val.Operand
- func (ISA) OpGrowMemory(f *gen.Func, x val.Operand) val.Operand
- func (ISA) OpInit(m *module.M)
- func (ISA) OpInitCall(m *module.M) (retAddr int32)
- func (ISA) OpLoadIntROData(f *gen.Func, t abi.Type, r reg.R, scale uint8, addr int32)
- func (ISA) OpMove(f *gen.Func, targetReg reg.R, x val.Operand, preserveFlags bool) (zeroExt bool)
- func (ISA) OpMoveI32Reg(m *module.M, target, source reg.R)
- func (ISA) OpMoveIntImm(m *module.M, r reg.R, value uint64)
- func (ISA) OpMoveReg(m *module.M, t abi.Type, targetReg, sourceReg reg.R)
- func (ISA) OpPush(f *gen.Func, x val.Operand)
- func (ISA) OpReturn(m *module.M)
- func (ISA) OpSelect(f *gen.Func, a, b, condOperand val.Operand) val.Operand
- func (ISA) OpSetGlobal(f *gen.Func, offset int32, x val.Operand)
- func (ISA) OpStoreStack(f *gen.Func, offset int32, x val.Operand)
- func (ISA) OpStoreStackReg(m *module.M, t abi.Type, offset int32, r reg.R)
- func (ISA) OpSwap(m *module.M, cat abi.Category, a, b reg.R)
- func (ISA) OpTrapCall(f *gen.Func, id trap.Id)
- func (ISA) OpTrapIfStackExhausted(f *gen.Func) (stackCheckAddr int32)
- func (ISA) ParamRegs() [2][]reg.R
- func (ISA) PutUint32(b []byte, val uint32)
- func (ISA) StoreOp(f *gen.Func, props uint16, index, x val.Operand, offset uint32)
- func (ISA) UnaryOp(f *gen.Func, props uint16, x val.Operand) val.Operand
- func (ISA) UpdateBranches(text []byte, l *link.L)
- func (ISA) UpdateCalls(text []byte, l *link.L)
- func (ISA) UpdateStackCheck(text []byte, addr, disp int32)
Constants ¶
const ( Rex = (1 << 6) RexW = Rex | (1 << 3) RexR = Rex | (1 << 2) RexX = Rex | (1 << 1) RexB = Rex | (1 << 0) )
const ( ModMem = modEnum(0) ModMemDisp8 = modEnum((0 << 7) | (1 << 6)) ModMemDisp32 = modEnum((1 << 7) | (0 << 6)) ModReg = modEnum((1 << 7) | (1 << 6)) )
const ( MemSIB = byte((1 << 2)) MemDisp32 = byte((1 << 2) | (1 << 0)) )
const ( NoIndex = reg.R((1 << 2)) NoBase = reg.R((1 << 2) | (1 << 0)) )
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 )
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) ClearInsnCache ¶
func (ISA) ClearInsnCache()
func (ISA) ConversionOp ¶
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 ¶
OpAddStackPtrImm must not allocate registers.
func (ISA) OpAddStackPtrUpper32 ¶
OpAddStackPtrUpper32 must not allocate registers.
func (ISA) OpBranchIf ¶
func (ISA) OpBranchIfOutOfBounds ¶
OpBranchIfOutOfBounds must not allocate registers. indexReg will be zero-extended.
func (ISA) OpBranchIndirect32 ¶
OpBranchIndirect32 must not allocate registers. The supplied register is trashed.
func (ISA) OpCallIndirect ¶
OpCallIndirect using table index located in result register.
func (ISA) OpClearIntResultReg ¶
OpClearIntResultReg may update CPU's condition flags.
func (ISA) OpCopyStack ¶
OpCopyStack must not allocate registers.
func (ISA) OpEnterExitTrapHandler ¶
func (ISA) OpEnterFunc ¶
func (ISA) OpEnterImportFunc ¶
func (ISA) OpEnterTrapHandler ¶
OpEnterTrapHandler must not generate over 16 bytes of m.Text.
func (ISA) OpGetGlobal ¶
OpGetGlobal must not update CPU's condition flags.
func (ISA) OpLoadIntROData ¶
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) OpMoveI32Reg ¶
OpMoveI32Reg must not allocate registers or update CPU's condition flags. It must zero-extend.
func (ISA) OpMoveIntImm ¶
OpMoveIntImm may update CPU's condition flags.
func (ISA) OpPush ¶
OpPush must not allocate registers, and must not update CPU's condition flags unless the operand is the condition flags.
func (ISA) OpSetGlobal ¶
OpSetGlobal must not update CPU's condition flags.
func (ISA) OpStoreStack ¶
OpStoreStack must not allocate registers.
func (ISA) OpStoreStackReg ¶
OpStoreStackReg must not allocate registers.
func (ISA) OpTrapIfStackExhausted ¶
func (ISA) UpdateBranches ¶
UpdateBranches modifies 32-bit relocations of Jmp and Jcc instructions.
func (ISA) UpdateCalls ¶
UpdateCalls modifies CallRel instructions, possibly while they are being executed.
func (ISA) UpdateStackCheck ¶
UpdateStackCheck modifies the 32-bit displacement of a Lea instruction.