Documentation
¶
Index ¶
- Constants
- type ISA
- func (ISA) AlignFunction(code gen.Buffer)
- func (ISA) AvailRegs() uint64
- func (ISA) BinaryOp(code gen.RegCoder, oper uint16, a, b values.Operand) values.Operand
- func (ISA) ClearInsnCache()
- func (ISA) ConversionOp(code gen.RegCoder, oper uint16, resultType wasm.Type, source values.Operand) (result values.Operand)
- func (ISA) LoadOp(code gen.RegCoder, oper uint16, index values.Operand, resultType wasm.Type, ...) (result values.Operand)
- func (ISA) OpAddImmToStackPtr(code gen.Buffer, offset int32)
- func (ISA) OpAddToStackPtr(code gen.Buffer, source regs.R)
- func (ISA) OpBranch(code gen.Buffer, addr int32) int32
- func (ISA) OpBranchIf(code gen.Coder, x values.Operand, yes bool, addr int32) (sites []int32)
- func (ISA) OpBranchIfOutOfBounds(code gen.Buffer, indexReg regs.R, upperBound, addr int32) int32
- func (ISA) OpBranchIndirect32(code gen.Buffer, reg regs.R, regZeroExt bool)
- func (ISA) OpCall(code gen.Buffer, addr int32) (retAddr int32)
- func (ISA) OpCallIndirect(code gen.Coder, tableLen, sigIndex int32) int32
- func (ISA) OpClearIntResultReg(code gen.Buffer)
- func (ISA) OpCopyStack(code gen.Buffer, targetOffset, sourceOffset int32)
- func (ISA) OpCurrentMemory(code gen.Buffer) values.Operand
- func (ISA) OpEnterExitTrapHandler(code gen.Buffer)
- func (ISA) OpEnterFunction(code gen.Coder)
- func (ISA) OpEnterImportFunction(code gen.Buffer, absAddr uint64, variadic bool, argCount, sigIndex int)
- func (ISA) OpEnterTrapHandler(code gen.Buffer, id trap.Id)
- func (ISA) OpGetGlobal(code gen.RegCoder, t wasm.Type, offset int32) values.Operand
- func (ISA) OpGrowMemory(code gen.RegCoder, x values.Operand) values.Operand
- func (ISA) OpInit(code gen.Buffer)
- func (ISA) OpInitCall(code gen.Buffer) (retAddr int32)
- func (ISA) OpLoadROIntIndex32ScaleDisp(code gen.Coder, t wasm.Type, reg regs.R, regZeroExt bool, scale uint8, ...) (resultZeroExt bool)
- func (ISA) OpMove(code gen.Coder, targetReg regs.R, x values.Operand, preserveFlags bool) (zeroExt bool)
- func (ISA) OpMoveIntImm(code gen.Buffer, reg regs.R, value uint64)
- func (ISA) OpMoveReg(code gen.Buffer, t wasm.Type, targetReg, sourceReg regs.R)
- func (ISA) OpPush(code gen.Coder, x values.Operand)
- func (ISA) OpReturn(code gen.Buffer)
- func (ISA) OpSelect(code gen.RegCoder, a, b, condOperand values.Operand) values.Operand
- func (ISA) OpSetGlobal(code gen.Coder, offset int32, x values.Operand)
- func (ISA) OpShiftRightLogical32Bits(code gen.Buffer, subject regs.R)
- func (ISA) OpStoreStack(code gen.Coder, offset int32, x values.Operand)
- func (ISA) OpStoreStackReg(code gen.Buffer, t wasm.Type, offset int32, reg regs.R)
- func (ISA) OpSwap(code gen.Buffer, cat gen.RegCategory, a, b regs.R)
- func (ISA) OpTrapIfStackExhausted(code gen.Coder) (stackCheckAddr int32)
- func (ISA) ParamRegs() [2][]regs.R
- func (ISA) PutUint32(b []byte, val uint32)
- func (ISA) StoreOp(code gen.RegCoder, oper uint16, index, x values.Operand, offset uint32)
- func (ISA) UnaryOp(code gen.RegCoder, oper uint16, x values.Operand) values.Operand
- func (ISA) UpdateBranches(text []byte, l *links.L)
- func (ISA) UpdateCalls(text []byte, l *links.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 = mod(0) ModMemDisp8 = mod((0 << 7) | (1 << 6)) ModMemDisp32 = mod((1 << 7) | (0 << 6)) ModReg = mod((1 << 7) | (1 << 6)) )
const ( MemSIB = byte((1 << 2)) MemDisp32 = byte((1 << 2) | (1 << 0)) )
const ( NoIndex = regs.R((1 << 2)) NoBase = regs.R((1 << 2) | (1 << 0)) )
const ( RegResult = regs.Result // rax or xmm0 RegShiftCount = regs.R(1) // rcx RegScratch = regs.R(2) // rdx or xmm2 RegImportArgCount = regs.R(2) // rdx RegImportSigIndex = regs.R(3) // rbx RegStackPtr = regs.R(4) // rsp RegSuspendFlag = regs.R(9) // r9 RegTextBase = regs.R(12) // r12 RegStackLimit = regs.R(13) // r13 RegMemoryBase = regs.R(14) // r14 RegMemoryLimit = regs.R(15) // r15 RegTrapHandlerMMX = regs.R(0) // mm0 RegMemoryGrowLimitMMX = regs.R(1) // mm1 RegScratchMMX = regs.R(2) // mm2 )
const ( FunctionAlignment = 16 PaddingByte = 0xcc // int3 instruction )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISA ¶ added in v0.3.0
type ISA struct{}
func (ISA) AlignFunction ¶ added in v0.3.0
func (ISA) ClearInsnCache ¶ added in v0.3.0
func (ISA) ClearInsnCache()
func (ISA) ConversionOp ¶ added in v0.3.0
func (ISA) LoadOp ¶ added in v0.3.0
func (ISA) LoadOp(code gen.RegCoder, oper uint16, index values.Operand, resultType wasm.Type, offset uint32) (result values.Operand)
LoadOp makes sure that index gets zero-extended if it's a VarReg operand.
func (ISA) OpAddImmToStackPtr ¶ added in v0.3.0
func (ISA) OpAddToStackPtr ¶ added in v0.3.0
func (ISA) OpBranchIf ¶ added in v0.3.0
func (ISA) OpBranchIfOutOfBounds ¶ added in v0.3.0
OpBranchIfOutOfBounds must not allocate registers. indexReg will be zero-extended.
func (ISA) OpBranchIndirect32 ¶ added in v0.3.0
OpBranchIndirect32 must not allocate registers. The supplied register is trashed.
func (ISA) OpCallIndirect ¶ added in v0.3.0
OpCallIndirect using table index located in result register.
func (ISA) OpClearIntResultReg ¶ added in v0.3.0
OpClearIntResultReg may update CPU's condition flags.
func (ISA) OpCopyStack ¶ added in v0.3.0
OpCopyStack must not allocate registers.
func (ISA) OpCurrentMemory ¶ added in v0.3.0
func (ISA) OpEnterExitTrapHandler ¶ added in v0.3.0
func (ISA) OpEnterFunction ¶ added in v0.3.0
func (ISA) OpEnterImportFunction ¶ added in v0.3.0
func (ISA) OpEnterTrapHandler ¶ added in v0.3.0
OpEnterTrapHandler must not generate over 16 bytes of code.
func (ISA) OpGetGlobal ¶ added in v0.3.0
OpGetGlobal must not update CPU's condition flags.
func (ISA) OpGrowMemory ¶ added in v0.3.0
func (ISA) OpLoadROIntIndex32ScaleDisp ¶ added in v0.3.0
func (ISA) OpLoadROIntIndex32ScaleDisp(code gen.Coder, t wasm.Type, reg regs.R, regZeroExt bool, scale uint8, addr int32) (resultZeroExt bool)
OpLoadROIntIndex32ScaleDisp must not allocate registers.
func (ISA) OpMove ¶ added in v0.3.0
func (ISA) OpMove(code gen.Coder, targetReg regs.R, x values.Operand, preserveFlags bool) (zeroExt bool)
OpMove must not update CPU's condition flags if preserveFlags is set.
func (ISA) OpMoveIntImm ¶ added in v0.3.0
OpMoveIntImm may update CPU's condition flags.
func (ISA) OpPush ¶ added in v0.3.0
OpPush must not allocate registers, and must not update CPU's condition flags unless the operand is the condition flags.
func (ISA) OpSetGlobal ¶ added in v0.3.0
OpSetGlobal must not update CPU's condition flags.
func (ISA) OpShiftRightLogical32Bits ¶ added in v0.3.0
OpShiftRightLogical32Bits must not allocate registers.
func (ISA) OpStoreStack ¶ added in v0.3.0
OpStoreStack must not allocate registers.
func (ISA) OpStoreStackReg ¶ added in v0.3.0
OpStoreStackReg must not allocate registers.
func (ISA) OpSwap ¶ added in v0.3.0
OpSwap must not allocate registers, or update CPU's condition flags.
func (ISA) OpTrapIfStackExhausted ¶ added in v0.3.0
func (ISA) StoreOp ¶ added in v0.3.0
StoreOp makes sure that index gets zero-extended if it's a VarReg operand.
func (ISA) UpdateBranches ¶ added in v0.3.0
UpdateBranches modifies 32-bit relocations of Jmp and Jcc instructions.
func (ISA) UpdateCalls ¶ added in v0.3.0
UpdateCalls modifies CallRel instructions, possibly while they are being executed.
func (ISA) UpdateStackCheck ¶ added in v0.3.0
UpdateStackCheck modifies the 32-bit displacement of a Lea instruction.