Documentation ¶
Overview ¶
Package wazeroir is a pkg to compile down the standard Wasm binary to wazero's specific IR (wazeroir). The wazeroir is inspired by microwasm format (a.k.a. LightbeamIR), previously used in the lightbeam compiler in Wasmtime, though it is not specified and only exists in the previous codebase of wasmtime e.g. https://github.com/bytecodealliance/wasmtime/blob/v0.29.0/crates/lightbeam/src/microwasm.rs
See RATIONALE.md for detail.
Index ¶
- Constants
- func Format(ops []Operation) string
- type BranchTarget
- type BranchTargetDrop
- type CompilationResult
- type Float
- type InclusiveRange
- type Label
- type LabelKind
- type MemoryArg
- type Operation
- type OperationAbs
- type OperationAdd
- type OperationAnd
- type OperationBr
- type OperationBrIf
- type OperationBrTable
- type OperationCall
- type OperationCallIndirect
- type OperationCeil
- type OperationClz
- type OperationConstF32
- type OperationConstF64
- type OperationConstI32
- type OperationConstI64
- type OperationCopysign
- type OperationCtz
- type OperationDataDrop
- type OperationDiv
- type OperationDrop
- type OperationElemDrop
- type OperationEq
- type OperationEqz
- type OperationExtend
- type OperationF32DemoteFromF64
- type OperationF32ReinterpretFromI32
- type OperationF64PromoteFromF32
- type OperationF64ReinterpretFromI64
- type OperationFConvertFromI
- type OperationFloor
- type OperationGe
- type OperationGlobalGet
- type OperationGlobalSet
- type OperationGt
- type OperationI32ReinterpretFromF32
- type OperationI32WrapFromI64
- type OperationI64ReinterpretFromF64
- type OperationITruncFromF
- type OperationKind
- type OperationLabel
- type OperationLe
- type OperationLoad
- type OperationLoad16
- type OperationLoad32
- type OperationLoad8
- type OperationLt
- type OperationMax
- type OperationMemoryCopy
- type OperationMemoryFill
- type OperationMemoryGrow
- type OperationMemoryInit
- type OperationMemorySize
- type OperationMin
- type OperationMul
- type OperationNe
- type OperationNearest
- type OperationNeg
- type OperationOr
- type OperationPick
- type OperationPopcnt
- type OperationRefFunc
- type OperationRem
- type OperationRotl
- type OperationRotr
- type OperationSelect
- type OperationSet
- type OperationShl
- type OperationShr
- type OperationSignExtend32From16
- type OperationSignExtend32From8
- type OperationSignExtend64From16
- type OperationSignExtend64From32
- type OperationSignExtend64From8
- type OperationSqrt
- type OperationStore
- type OperationStore16
- type OperationStore32
- type OperationStore8
- type OperationSub
- type OperationTableCopy
- type OperationTableFill
- type OperationTableGet
- type OperationTableGrow
- type OperationTableInit
- type OperationTableSet
- type OperationTableSize
- type OperationTrunc
- type OperationUnreachable
- type OperationV128Abs
- type OperationV128Add
- type OperationV128AddSat
- type OperationV128AllTrue
- type OperationV128And
- type OperationV128AndNot
- type OperationV128AnyTrue
- type OperationV128AvgrU
- type OperationV128BitMask
- type OperationV128Bitselect
- type OperationV128Ceil
- type OperationV128Cmp
- type OperationV128Const
- type OperationV128Div
- type OperationV128Dot
- type OperationV128ExtAddPairwise
- type OperationV128ExtMul
- type OperationV128Extend
- type OperationV128ExtractLane
- type OperationV128FConvertFromI
- type OperationV128FloatDemote
- type OperationV128FloatPromote
- type OperationV128Floor
- type OperationV128ITruncSatFromF
- type OperationV128Load
- type OperationV128LoadLane
- type OperationV128Max
- type OperationV128Min
- type OperationV128Mul
- type OperationV128Narrow
- type OperationV128Nearest
- type OperationV128Neg
- type OperationV128Not
- type OperationV128Or
- type OperationV128Pmax
- type OperationV128Pmin
- type OperationV128Popcnt
- type OperationV128Q15mulrSatS
- type OperationV128ReplaceLane
- type OperationV128Shl
- type OperationV128Shr
- type OperationV128Shuffle
- type OperationV128Splat
- type OperationV128Sqrt
- type OperationV128Store
- type OperationV128StoreLane
- type OperationV128Sub
- type OperationV128SubSat
- type OperationV128Swizzle
- type OperationV128Trunc
- type OperationV128Xor
- type OperationXor
- type Shape
- type SignedInt
- type SignedType
- type UnsignedInt
- type UnsignedType
- type V128CmpType
- type V128LoadType
Constants ¶
const EntrypointLabel = ".entrypoint"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BranchTarget ¶
type BranchTarget struct { // Label holds the target label. Note that this is nullable and in that case // the branch target is the "return" of the function. Label *Label }
BranchTarget represents the branch operation's target such as OperationBr of OperationBrIf.
func (*BranchTarget) IsReturnTarget ¶
func (b *BranchTarget) IsReturnTarget() bool
IsReturnTarget returns true if the branch target is the function return, false otherwise.
func (*BranchTarget) String ¶
func (b *BranchTarget) String() (ret string)
String implements fmt.Stringer.
type BranchTargetDrop ¶
type BranchTargetDrop struct { Target *BranchTarget ToDrop *InclusiveRange }
BranchTargetDrop represents the branch target and the drop range which must be dropped before give the control over to the target label.
func (*BranchTargetDrop) String ¶
func (b *BranchTargetDrop) String() (ret string)
String implements fmt.Stringer.
type CompilationResult ¶
type CompilationResult struct { // IsHostFunction is the data returned by the same field documented on // wasm.Code. IsHostFunction bool // GoFunc is the data returned by the same field documented on wasm.Code. // In this case, IsHostFunction is true and other fields can be ignored. GoFunc interface{} // Operations holds wazeroir operations compiled from Wasm instructions in a Wasm function. Operations []Operation // LabelCallers maps Label.String() to the number of callers to that label. // Here "callers" means that the call-sites which jumps to the label with br, br_if or br_table // instructions. // // Note: zero possible and allowed in wasm. e.g. // // (block // (br 0) // (block i32.const 1111) // ) // // This example the label corresponding to `(block i32.const 1111)` is never be reached at runtime because `br 0` exits the function before we reach there LabelCallers map[string]uint32 // Signature is the function type of the compilation target function. Signature *wasm.FunctionType // Globals holds all the declarations of globals in the module from which this function is compiled. Globals []*wasm.GlobalType // Functions holds all the declarations of function in the module from which this function is compiled, including itself. Functions []wasm.Index // Types holds all the types in the module from which this function is compiled. Types []*wasm.FunctionType // TableTypes holds all the reference types of all tables declared in the module. TableTypes []wasm.ValueType // HasMemory is true if the module from which this function is compiled has memory declaration. HasMemory bool // UsesMemory is true if this function might use memory. UsesMemory bool // HasTable is true if the module from which this function is compiled has table declaration. HasTable bool // HasDataInstances is true if the module has data instances which might be used by memory.init or data.drop instructions. HasDataInstances bool // HasDataInstances is true if the module has element instances which might be used by table.init or elem.drop instructions. HasElementInstances bool }
func CompileFunctions ¶
func CompileFunctions(_ context.Context, enabledFeatures api.CoreFeatures, callFrameStackSizeInUint64 int, module *wasm.Module) ([]*CompilationResult, error)
type Float ¶
type Float byte
Float represents the scalar double or single precision floating points.
type InclusiveRange ¶
type InclusiveRange struct {
Start, End int
}
InclusiveRange is the range which spans across the value stack starting from the top to the bottom, and both boundary are included in the range.
type Label ¶
Label is the label of each block in wazeroir where "block" consists of multiple operations, and must end with branching operations (e.g. OperationBr or OperationBrIf).
type LabelKind ¶
type LabelKind = byte
LabelKind is the kind of the label.
const ( // LabelKindHeader is the header for various blocks. For example, the "then" block of // wasm.OpcodeIfName in Wasm has the label of this kind. LabelKindHeader LabelKind = iota // LabelKindElse is the kind of label for "else" block of wasm.OpcodeIfName in Wasm. LabelKindElse // LabelKindContinuation is the kind of label which is the continuation of blocks. // For example, for wasm text like // (func // .... // (if (local.get 0) (then (nop)) (else (nop))) // return // ) // we have the continuation block (of if-block) corresponding to "return" opcode. LabelKindContinuation )
type MemoryArg ¶
type MemoryArg struct { // Alignment the expected alignment (expressed as the exponent of a power of 2). Default to the natural alignment. // // "Natural alignment" is defined here as the smallest power of two that can hold the size of the value type. Ex // wasm.ValueTypeI64 is encoded in 8 little-endian bytes. 2^3 = 8, so the natural alignment is three. Alignment uint32 // Offset is the address offset added to the instruction's dynamic address operand, yielding a 33-bit effective // address that is the zero-based index at which the memory is accessed. Default to zero. Offset uint32 }
MemoryArg is the "memarg" to all memory instructions.
See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instructions%E2%91%A0
type Operation ¶
type Operation interface { // Kind returns the kind of the implementation. Kind() OperationKind }
Operation is the interface implemented by each individual operation.
type OperationAbs ¶
type OperationAbs struct{ Type Float }
OperationAbs implements Operation.
This corresponds to wasm.OpcodeF32Abs wasm.OpcodeF64Abs
type OperationAdd ¶
type OperationAdd struct{ Type UnsignedType }
OperationAdd implements Operation.
This corresponds to wasm.OpcodeI32AddName wasm.OpcodeI64AddName wasm.OpcodeF32AddName wasm.OpcodeF64AddName.
type OperationAnd ¶
type OperationAnd struct{ Type UnsignedInt }
OperationAnd implements Operation.
This corresponds to wasm.OpcodeI32AndName wasm.OpcodeI64AndName ¶
The engines are expected to perform "And" operation on top two values on the stack, and pushes the result.
type OperationBr ¶
type OperationBr struct {
Target *BranchTarget
}
OperationBr implements Operation.
The engines are expected to branch into OperationBr.Target label.
type OperationBrIf ¶
type OperationBrIf struct {
Then, Else *BranchTargetDrop
}
OperationBrIf implements Operation.
The engines are expected to pop a value and branch into OperationBrIf.Then label if the value equals 1. Otherwise, the code branches into OperationBrIf.Else label.
func (*OperationBrIf) Kind ¶
func (*OperationBrIf) Kind() OperationKind
Kind implements Operation.Kind
type OperationBrTable ¶
type OperationBrTable struct { Targets []*BranchTargetDrop Default *BranchTargetDrop }
OperationBrTable implements Operation.
This corresponds to wasm.OpcodeBrTableName except that the label here means the wazeroir level, not the ones of Wasm.
The engines are expected to do the br_table operation base on the OperationBrTable.Default and OperationBrTable.Targets. More precisely, this pops a value from the stack (called "index") and decide which branch we go into next based on the value.
For example, assume we have operations like {default: L_DEFAULT, targets: [L0, L1, L2]}. If "index" >= len(defaults), then branch into the L_DEFAULT label. Otherwise, we enter label of targets[index].
func (*OperationBrTable) Kind ¶
func (*OperationBrTable) Kind() OperationKind
Kind implements Operation.Kind
type OperationCall ¶
type OperationCall struct {
FunctionIndex uint32
}
OperationCall implements Operation.
This corresponds to wasm.OpcodeCallName, and engines are expected to enter into a function whose index equals OperationCall.FunctionIndex.
func (*OperationCall) Kind ¶
func (*OperationCall) Kind() OperationKind
Kind implements Operation.Kind
type OperationCallIndirect ¶
type OperationCallIndirect struct {
TypeIndex, TableIndex uint32
}
OperationCallIndirect implements Operation.
This corresponds to wasm.OpcodeCallIndirectName, and engines are expected to consume the one value from the top of stack (called "offset"), and make a function call against the function whose function address equals Tables[OperationCallIndirect.TableIndex][offset].
Note: This is called indirect function call in the sense that the target function is indirectly determined by the current state (top value) of the stack. Therefore, two checks are performed at runtime before entering the target function: 1) whether "offset" exceeds the length of table Tables[OperationCallIndirect.TableIndex]. 2) whether the type of the function table[offset] matches the function type specified by OperationCallIndirect.TypeIndex.
func (*OperationCallIndirect) Kind ¶
func (*OperationCallIndirect) Kind() OperationKind
Kind implements Operation.Kind
type OperationCeil ¶
type OperationCeil struct{ Type Float }
OperationCeil implements Operation.
This corresponds to wasm.OpcodeF32CeilName wasm.OpcodeF64CeilName
func (OperationCeil) Kind ¶
func (OperationCeil) Kind() OperationKind
Kind implements Operation.Kind.
type OperationClz ¶
type OperationClz struct{ Type UnsignedInt }
OperationClz implements Operation.
This corresponds to wasm.OpcodeI32ClzName wasm.OpcodeI64ClzName.
The engines are expected to count up the leading zeros in the current top of the stack, and push the count result. For example, stack of [..., 0x00_ff_ff_ff] results in [..., 8]. See wasm.OpcodeI32Clz wasm.OpcodeI64Clz
type OperationConstF32 ¶
type OperationConstF32 struct{ Value float32 }
OperationConstF32 implements Operation.
This corresponds to wasm.OpcodeF32Const.
func (OperationConstF32) Kind ¶
func (OperationConstF32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationConstF64 ¶
type OperationConstF64 struct{ Value float64 }
OperationConstF64 implements Operation.
This corresponds to wasm.OpcodeF64Const.
func (OperationConstF64) Kind ¶
func (OperationConstF64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationConstI32 ¶
type OperationConstI32 struct{ Value uint32 }
OperationConstI32 implements Operation.
This corresponds to wasm.OpcodeI32Const.
func (OperationConstI32) Kind ¶
func (OperationConstI32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationConstI64 ¶
type OperationConstI64 struct{ Value uint64 }
OperationConstI64 implements Operation.
This corresponds to wasm.OpcodeI64Const.
func (OperationConstI64) Kind ¶
func (OperationConstI64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationCopysign ¶
type OperationCopysign struct{ Type Float }
OperationCopysign implements Operation.
This corresponds to wasm.OpcodeF32CopysignName wasm.OpcodeF64CopysignName ¶
The engines are expected to pop two float values from the stack, and copy the signbit of the first-popped value to the last one. For example, stack [..., 1.213, -5.0] results in [..., -1.213].
func (OperationCopysign) Kind ¶
func (OperationCopysign) Kind() OperationKind
Kind implements Operation.Kind.
type OperationCtz ¶
type OperationCtz struct{ Type UnsignedInt }
OperationCtz implements Operation.
This corresponds to wasm.OpcodeI32CtzName wasm.OpcodeI64CtzName.
The engines are expected to count up the trailing zeros in the current top of the stack, and push the count result. For example, stack of [..., 0xff_ff_ff_00] results in [..., 8].
type OperationDataDrop ¶
type OperationDataDrop struct { // DataIndex is the index of the data instance in ModuleInstance.DataInstances // which this operation drops. DataIndex uint32 }
OperationDataDrop implements Operation.
This corresponds to wasm.OpcodeDataDropName.
func (OperationDataDrop) Kind ¶
func (OperationDataDrop) Kind() OperationKind
Kind implements Operation.Kind.
type OperationDiv ¶
type OperationDiv struct{ Type SignedType }
OperationDiv implements Operation.
This corresponds to wasm.OpcodeI32DivS wasm.OpcodeI32DivU wasm.OpcodeI64DivS
wasm.OpcodeI64DivU wasm.OpcodeF32Div wasm.OpcodeF64Div.
type OperationDrop ¶
type OperationDrop struct { // Depths spans across the uint64 value stack at runtime to be dropped by this operation. Depth *InclusiveRange }
OperationDrop implements Operation.
The engines are expected to discard the values selected by OperationDrop.Depth which starts from the top of the stack to the bottom.
func (*OperationDrop) Kind ¶
func (*OperationDrop) Kind() OperationKind
Kind implements Operation.Kind
type OperationElemDrop ¶
type OperationElemDrop struct { // ElemIndex is the index of the element which this operation drops. ElemIndex uint32 }
OperationElemDrop implements Operation.
This corresponds to wasm.OpcodeElemDropName.
func (OperationElemDrop) Kind ¶
func (OperationElemDrop) Kind() OperationKind
Kind implements Operation.Kind.
type OperationEq ¶
type OperationEq struct{ Type UnsignedType }
OperationEq implements Operation.
This corresponds to wasm.OpcodeI32EqName wasm.OpcodeI64EqName wasm.OpcodeF32EqName wasm.OpcodeF64EqName
type OperationEqz ¶
type OperationEqz struct{ Type UnsignedInt }
OperationEqz implements Operation.
This corresponds to wasm.OpcodeI32EqzName wasm.OpcodeI64EqzName
type OperationExtend ¶
type OperationExtend struct{ Signed bool }
OperationExtend implements Operation.
This corresponds to wasm.OpcodeI64ExtendI32SName wasm.OpcodeI64ExtendI32UName ¶
The engines are expected to extend the 32-bit signed or unsigned int on top of the stack as a 64-bit integer of corresponding signedness. For unsigned case, this is just reinterpreting the underlying bit pattern as 64-bit integer. For signed case, this is sign-extension which preserves the original integer's sign.
func (OperationExtend) Kind ¶
func (OperationExtend) Kind() OperationKind
Kind implements Operation.Kind.
type OperationF32DemoteFromF64 ¶
type OperationF32DemoteFromF64 struct{}
OperationF32DemoteFromF64 implements Operation.
This corresponds to wasm.OpcodeF32DemoteF64 and is equivalent float32(float64(v)).
func (OperationF32DemoteFromF64) Kind ¶
func (OperationF32DemoteFromF64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationF32ReinterpretFromI32 ¶
type OperationF32ReinterpretFromI32 struct{}
OperationF32ReinterpretFromI32 implements Operation.
This corresponds to wasm.OpcodeF32ReinterpretI32Name.
func (OperationF32ReinterpretFromI32) Kind ¶
func (OperationF32ReinterpretFromI32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationF64PromoteFromF32 ¶
type OperationF64PromoteFromF32 struct{}
OperationF64PromoteFromF32 implements Operation.
This corresponds to wasm.OpcodeF64PromoteF32 and is equivalent float64(float32(v)).
func (OperationF64PromoteFromF32) Kind ¶
func (OperationF64PromoteFromF32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationF64ReinterpretFromI64 ¶
type OperationF64ReinterpretFromI64 struct{}
OperationF64ReinterpretFromI64 implements Operation.
This corresponds to wasm.OpcodeF64ReinterpretI64Name.
func (OperationF64ReinterpretFromI64) Kind ¶
func (OperationF64ReinterpretFromI64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationFConvertFromI ¶
OperationFConvertFromI implements Operation.
This corresponds to
wasm.OpcodeF32ConvertI32SName wasm.OpcodeF32ConvertI32UName wasm.OpcodeF32ConvertI64SName wasm.OpcodeF32ConvertI64UName wasm.OpcodeF64ConvertI32SName wasm.OpcodeF64ConvertI32UName wasm.OpcodeF64ConvertI64SName wasm.OpcodeF64ConvertI64UName
and equivalent to float32(uint32(x)), float32(int32(x)), etc in Go.
func (OperationFConvertFromI) Kind ¶
func (OperationFConvertFromI) Kind() OperationKind
Kind implements Operation.Kind.
type OperationFloor ¶
type OperationFloor struct{ Type Float }
OperationFloor implements Operation.
This corresponds to wasm.OpcodeF32FloorName wasm.OpcodeF64FloorName
func (OperationFloor) Kind ¶
func (OperationFloor) Kind() OperationKind
Kind implements Operation.Kind.
type OperationGe ¶
type OperationGe struct{ Type SignedType }
OperationGe implements Operation.
This corresponds to wasm.OpcodeI32GeS wasm.OpcodeI32GeU wasm.OpcodeI64GeS wasm.OpcodeI64GeU wasm.OpcodeF32Ge wasm.OpcodeF64Ge
type OperationGlobalGet ¶
type OperationGlobalGet struct{ Index uint32 }
OperationGlobalGet implements Operation.
The engines are expected to read the global value specified by OperationGlobalGet.Index, and push the copy of the value onto the stack.
See wasm.OpcodeGlobalGet.
func (*OperationGlobalGet) Kind ¶
func (*OperationGlobalGet) Kind() OperationKind
Kind implements Operation.Kind
type OperationGlobalSet ¶
type OperationGlobalSet struct{ Index uint32 }
OperationGlobalSet implements Operation.
The engines are expected to consume the value from the top of the stack, and write the value into the global specified by OperationGlobalSet.Index.
See wasm.OpcodeGlobalSet.
func (*OperationGlobalSet) Kind ¶
func (*OperationGlobalSet) Kind() OperationKind
Kind implements Operation.Kind
type OperationGt ¶
type OperationGt struct{ Type SignedType }
OperationGt implements Operation.
This corresponds to wasm.OpcodeI32GtS wasm.OpcodeI32GtU wasm.OpcodeI64GtS wasm.OpcodeI64GtU wasm.OpcodeF32Gt wasm.OpcodeF64Gt
type OperationI32ReinterpretFromF32 ¶
type OperationI32ReinterpretFromF32 struct{}
OperationI32ReinterpretFromF32 implements Operation.
This corresponds to wasm.OpcodeI32ReinterpretF32Name.
func (OperationI32ReinterpretFromF32) Kind ¶
func (OperationI32ReinterpretFromF32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationI32WrapFromI64 ¶
type OperationI32WrapFromI64 struct{}
OperationI32WrapFromI64 implements Operation.
This corresponds to wasm.OpcodeI32WrapI64 and equivalent to uint64(uint32(v)) in Go.
The engines are expected to replace the 64-bit int on top of the stack with the corresponding 32-bit integer.
func (OperationI32WrapFromI64) Kind ¶
func (OperationI32WrapFromI64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationI64ReinterpretFromF64 ¶
type OperationI64ReinterpretFromF64 struct{}
OperationI64ReinterpretFromF64 implements Operation.
This corresponds to wasm.OpcodeI64ReinterpretF64Name.
func (OperationI64ReinterpretFromF64) Kind ¶
func (OperationI64ReinterpretFromF64) Kind() OperationKind
Kind implements Operation.Kind.
type OperationITruncFromF ¶
type OperationITruncFromF struct { InputType Float OutputType SignedInt // NonTrapping true if this conversion is "nontrapping" in the sense of the // https://github.com/WebAssembly/spec/blob/ce4b6c4d47eb06098cc7ab2e81f24748da822f20/proposals/nontrapping-float-to-int-conversion/Overview.md NonTrapping bool }
OperationITruncFromF implements Operation.
This corresponds to
wasm.OpcodeI32TruncF32SName wasm.OpcodeI32TruncF32UName wasm.OpcodeI32TruncF64SName wasm.OpcodeI32TruncF64UName wasm.OpcodeI64TruncF32SName wasm.OpcodeI64TruncF32UName wasm.OpcodeI64TruncF64SName wasm.OpcodeI64TruncF64UName. wasm.OpcodeI32TruncSatF32SName wasm.OpcodeI32TruncSatF32UName wasm.OpcodeI32TruncSatF64SName wasm.OpcodeI32TruncSatF64UName wasm.OpcodeI64TruncSatF32SName wasm.OpcodeI64TruncSatF32UName wasm.OpcodeI64TruncSatF64SName wasm.OpcodeI64TruncSatF64UName
See [1] and [2] for when we encounter undefined behavior in the WebAssembly specification if OperationITruncFromF.NonTrapping == false. To summarize, if the source float value is NaN or doesn't fit in the destination range of integers (incl. +=Inf), then the runtime behavior is undefined. In wazero, the engines are expected to exit the execution in these undefined cases with wasmruntime.ErrRuntimeInvalidConversionToInteger error.
[1] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-umathrmtruncmathsfu_m-n-z for unsigned integers. [2] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-smathrmtruncmathsfs_m-n-z for signed integers.
func (OperationITruncFromF) Kind ¶
func (OperationITruncFromF) Kind() OperationKind
Kind implements Operation.Kind.
type OperationKind ¶
type OperationKind uint16
OperationKind is the kind of each implementation of Operation interface.
const ( // OperationKindUnreachable is the kind for OperationUnreachable. OperationKindUnreachable OperationKind = iota // OperationKindLabel is the kind for OperationLabel. OperationKindLabel // OperationKindBr is the kind for OperationBr. OperationKindBr // OperationKindBrIf is the kind for OperationBrIf. OperationKindBrIf // OperationKindBrTable is the kind for OperationBrTable. OperationKindBrTable // OperationKindCall is the kind for OperationCall. OperationKindCall // OperationKindCallIndirect is the kind for OperationCallIndirect. OperationKindCallIndirect // OperationKindDrop is the kind for OperationDrop. OperationKindDrop // OperationKindSelect is the kind for OperationSelect. OperationKindSelect // OperationKindPick is the kind for OperationPick. OperationKindPick // OperationKindSet is the kind for OperationSet. OperationKindSet // OperationKindGlobalGet is the kind for OperationGlobalGet. OperationKindGlobalGet // OperationKindGlobalSet is the kind for OperationGlobalSet. OperationKindGlobalSet // OperationKindLoad is the kind for OperationLoad. OperationKindLoad // OperationKindLoad8 is the kind for OperationLoad8. OperationKindLoad8 // OperationKindLoad16 is the kind for OperationLoad16. OperationKindLoad16 // OperationKindLoad32 is the kind for OperationLoad32. OperationKindLoad32 // OperationKindStore is the kind for OperationStore. OperationKindStore // OperationKindStore8 is the kind for OperationStore8. OperationKindStore8 // OperationKindStore16 is the kind for OperationStore16. OperationKindStore16 // OperationKindStore32 is the kind for OperationStore32. OperationKindStore32 // OperationKindMemorySize is the kind for OperationMemorySize. OperationKindMemorySize // OperationKindMemoryGrow is the kind for OperationMemoryGrow. OperationKindMemoryGrow // OperationKindConstI32 is the kind for OperationConstI32. OperationKindConstI32 // OperationKindConstI64 is the kind for OperationConstI64. OperationKindConstI64 // OperationKindConstF32 is the kind for OperationConstF32. OperationKindConstF32 // OperationKindConstF64 is the kind for OperationConstF64. OperationKindConstF64 // OperationKindEq is the kind for OperationEq. OperationKindEq // OperationKindNe is the kind for OperationNe. OperationKindNe // OperationKindEqz is the kind for OperationEqz. OperationKindEqz // OperationKindLt is the kind for OperationLt. OperationKindLt // OperationKindGt is the kind for OperationGt. OperationKindGt // OperationKindLe is the kind for OperationLe. OperationKindLe // OperationKindGe is the kind for OperationGe. OperationKindGe // OperationKindAdd is the kind for OperationAdd. OperationKindAdd // OperationKindSub is the kind for OperationSub. OperationKindSub // OperationKindMul is the kind for OperationMul. OperationKindMul // OperationKindClz is the kind for OperationClz. OperationKindClz // OperationKindCtz is the kind for OperationCtz. OperationKindCtz // OperationKindPopcnt is the kind for OperationPopcnt. OperationKindPopcnt // OperationKindDiv is the kind for OperationDiv. OperationKindDiv // OperationKindRem is the kind for OperationRem. OperationKindRem // OperationKindAnd is the kind for OperationAnd. OperationKindAnd // OperationKindOr is the kind for OperationOr. OperationKindOr // OperationKindXor is the kind for OperationXor. OperationKindXor // OperationKindShl is the kind for OperationShl. OperationKindShl // OperationKindShr is the kind for OperationShr. OperationKindShr // OperationKindRotl is the kind for OperationRotl. OperationKindRotl // OperationKindRotr is the kind for OperationRotr. OperationKindRotr // OperationKindAbs is the kind for OperationAbs. OperationKindAbs // OperationKindNeg is the kind for OperationNeg. OperationKindNeg // OperationKindCeil is the kind for OperationCeil. OperationKindCeil // OperationKindFloor is the kind for OperationFloor. OperationKindFloor // OperationKindTrunc is the kind for OperationTrunc. OperationKindTrunc // OperationKindNearest is the kind for OperationNearest. OperationKindNearest // OperationKindSqrt is the kind for OperationSqrt. OperationKindSqrt // OperationKindMin is the kind for OperationMin. OperationKindMin // OperationKindMax is the kind for OperationMax. OperationKindMax // OperationKindCopysign is the kind for OperationCopysign. OperationKindCopysign // OperationKindI32WrapFromI64 is the kind for OperationI32WrapFromI64. OperationKindI32WrapFromI64 // OperationKindITruncFromF is the kind for OperationITruncFromF. OperationKindITruncFromF // OperationKindFConvertFromI is the kind for OperationFConvertFromI. OperationKindFConvertFromI // OperationKindF32DemoteFromF64 is the kind for OperationF32DemoteFromF64. OperationKindF32DemoteFromF64 // OperationKindF64PromoteFromF32 is the kind for OperationF64PromoteFromF32. OperationKindF64PromoteFromF32 // OperationKindI32ReinterpretFromF32 is the kind for OperationI32ReinterpretFromF32. OperationKindI32ReinterpretFromF32 // OperationKindI64ReinterpretFromF64 is the kind for OperationI64ReinterpretFromF64. OperationKindI64ReinterpretFromF64 // OperationKindF32ReinterpretFromI32 is the kind for OperationF32ReinterpretFromI32. OperationKindF32ReinterpretFromI32 // OperationKindF64ReinterpretFromI64 is the kind for OperationF64ReinterpretFromI64. OperationKindF64ReinterpretFromI64 // OperationKindExtend is the kind for OperationExtend. OperationKindExtend // OperationKindSignExtend32From8 is the kind for OperationSignExtend32From8. OperationKindSignExtend32From8 // OperationKindSignExtend32From16 is the kind for OperationSignExtend32From16. OperationKindSignExtend32From16 // OperationKindSignExtend64From8 is the kind for OperationSignExtend64From8. OperationKindSignExtend64From8 // OperationKindSignExtend64From16 is the kind for OperationSignExtend64From16. OperationKindSignExtend64From16 // OperationKindSignExtend64From32 is the kind for OperationSignExtend64From32. OperationKindSignExtend64From32 // OperationKindMemoryInit is the kind for OperationMemoryInit. OperationKindMemoryInit // OperationKindDataDrop is the kind for OperationDataDrop. OperationKindDataDrop // OperationKindMemoryCopy is the kind for OperationMemoryCopy. OperationKindMemoryCopy // OperationKindMemoryFill is the kind for OperationMemoryFill. OperationKindMemoryFill // OperationKindTableInit is the kind for OperationTableInit. OperationKindTableInit // OperationKindElemDrop is the kind for OperationElemDrop. OperationKindElemDrop // OperationKindTableCopy is the kind for OperationTableCopy. OperationKindTableCopy // OperationKindRefFunc is the kind for OperationRefFunc. OperationKindRefFunc // OperationKindTableGet is the kind for OperationTableGet. OperationKindTableGet // OperationKindTableSet is the kind for OperationTableSet. OperationKindTableSet // OperationKindTableSize is the kind for OperationTableSize. OperationKindTableSize // OperationKindTableGrow is the kind for OperationTableGrow. OperationKindTableGrow // OperationKindTableFill is the kind for OperationTableFill. OperationKindTableFill // OperationKindV128Const is the kind for OperationV128Const. OperationKindV128Const // OperationKindV128Add is the kind for OperationV128Add. OperationKindV128Add // OperationKindV128Sub is the kind for OperationV128Sub. OperationKindV128Sub // OperationKindV128Load is the kind for OperationV128Load. OperationKindV128Load // OperationKindV128LoadLane is the kind for OperationV128LoadLane. OperationKindV128LoadLane // OperationKindV128Store is the kind for OperationV128Store. OperationKindV128Store // OperationKindV128StoreLane is the kind for OperationV128StoreLane. OperationKindV128StoreLane // OperationKindV128ExtractLane is the kind for OperationV128ExtractLane. OperationKindV128ExtractLane // OperationKindV128ReplaceLane is the kind for OperationV128ReplaceLane. OperationKindV128ReplaceLane // OperationKindV128Splat is the kind for OperationV128Splat. OperationKindV128Splat // OperationKindV128Shuffle is the kind for OperationV128Shuffle. OperationKindV128Shuffle // OperationKindV128Swizzle is the kind for OperationV128Swizzle. OperationKindV128Swizzle // OperationKindV128AnyTrue is the kind for OperationV128AnyTrue. OperationKindV128AnyTrue // OperationKindV128AllTrue is the kind for OperationV128AllTrue. OperationKindV128AllTrue // OperationKindV128BitMask is the kind for OperationV128BitMask. OperationKindV128BitMask // OperationKindV128And is the kind for OperationV128And. OperationKindV128And // OperationKindV128Not is the kind for OperationV128Not. OperationKindV128Not // OperationKindV128Or is the kind for OperationV128Or. OperationKindV128Or // OperationKindV128Xor is the kind for OperationV128Xor. OperationKindV128Xor // OperationKindV128Bitselect is the kind for OperationV128Bitselect. OperationKindV128Bitselect // OperationKindV128AndNot is the kind for OperationV128AndNot. OperationKindV128AndNot // OperationKindV128Shl is the kind for OperationV128Shl. OperationKindV128Shl // OperationKindV128Shr is the kind for OperationV128Shr. OperationKindV128Shr // OperationKindV128Cmp is the kind for OperationV128Cmp. OperationKindV128Cmp // OperationKindV128AddSat is the kind for OperationV128AddSat. OperationKindV128AddSat // OperationKindV128SubSat is the kind for OperationV128SubSat. OperationKindV128SubSat // OperationKindV128Mul is the kind for OperationV128Mul. OperationKindV128Mul // OperationKindV128Div is the kind for OperationV128Div. OperationKindV128Div // OperationKindV128Neg is the kind for OperationV128Neg. OperationKindV128Neg // OperationKindV128Sqrt is the kind for OperationV128Sqrt. OperationKindV128Sqrt // OperationKindV128Abs is the kind for OperationV128Abs. OperationKindV128Abs // OperationKindV128Popcnt is the kind for OperationV128Popcnt. OperationKindV128Popcnt // OperationKindV128Min is the kind for OperationV128Min. OperationKindV128Min // OperationKindV128Max is the kind for OperationV128Max. OperationKindV128Max // OperationKindV128AvgrU is the kind for OperationV128AvgrU. OperationKindV128AvgrU // OperationKindV128Pmin is the kind for OperationV128Pmin. OperationKindV128Pmin // OperationKindV128Pmax is the kind for OperationV128Pmax. OperationKindV128Pmax // OperationKindV128Ceil is the kind for OperationV128Ceil. OperationKindV128Ceil // OperationKindV128Floor is the kind for OperationV128Floor. OperationKindV128Floor // OperationKindV128Trunc is the kind for OperationV128Trunc. OperationKindV128Trunc // OperationKindV128Nearest is the kind for OperationV128Nearest. OperationKindV128Nearest // OperationKindV128Extend is the kind for OperationV128Extend. OperationKindV128Extend // OperationKindV128ExtMul is the kind for OperationV128ExtMul. OperationKindV128ExtMul // OperationKindV128Q15mulrSatS is the kind for OperationV128Q15mulrSatS. OperationKindV128Q15mulrSatS // OperationKindV128ExtAddPairwise is the kind for OperationV128ExtAddPairwise. OperationKindV128ExtAddPairwise // OperationKindV128FloatPromote is the kind for OperationV128FloatPromote. OperationKindV128FloatPromote // OperationKindV128FloatDemote is the kind for OperationV128FloatDemote. OperationKindV128FloatDemote // OperationKindV128FConvertFromI is the kind for OperationV128FConvertFromI. OperationKindV128FConvertFromI // OperationKindV128Dot is the kind for OperationV128Dot. OperationKindV128Dot // OperationKindV128Narrow is the kind for OperationV128Narrow. OperationKindV128Narrow // OperationKindV128ITruncSatFromF is the kind for OperationV128ITruncSatFromF. OperationKindV128ITruncSatFromF )
func (OperationKind) String ¶
func (o OperationKind) String() (ret string)
String implements fmt.Stringer.
type OperationLabel ¶
type OperationLabel struct {
Label *Label
}
OperationLabel implements Operation.
This is used to inform the engines of the beginning of a label.
func (*OperationLabel) Kind ¶
func (*OperationLabel) Kind() OperationKind
Kind implements Operation.Kind
type OperationLe ¶
type OperationLe struct{ Type SignedType }
OperationLe implements Operation.
This corresponds to wasm.OpcodeI32LeS wasm.OpcodeI32LeU wasm.OpcodeI64LeS wasm.OpcodeI64LeU wasm.OpcodeF32Le wasm.OpcodeF64Le
type OperationLoad ¶
type OperationLoad struct { Type UnsignedType Arg *MemoryArg }
OperationLoad implements Operation.
This corresponds to wasm.OpcodeI32LoadName wasm.OpcodeI64LoadName wasm.OpcodeF32LoadName and wasm.OpcodeF64LoadName.
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (*OperationLoad) Kind ¶
func (*OperationLoad) Kind() OperationKind
Kind implements Operation.Kind
type OperationLoad16 ¶
OperationLoad16 implements Operation.
This corresponds to wasm.OpcodeI32Load16SName wasm.OpcodeI32Load16UName wasm.OpcodeI64Load16SName wasm.OpcodeI64Load16UName.
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationLoad16) Kind ¶
func (OperationLoad16) Kind() OperationKind
Kind implements Operation.Kind
type OperationLoad32 ¶
OperationLoad32 implements Operation.
This corresponds to wasm.OpcodeI64Load32SName wasm.OpcodeI64Load32UName.
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationLoad32) Kind ¶
func (OperationLoad32) Kind() OperationKind
Kind implements Operation.Kind
type OperationLoad8 ¶
OperationLoad8 implements Operation.
This corresponds to wasm.OpcodeI32Load8SName wasm.OpcodeI32Load8UName wasm.OpcodeI64Load8SName wasm.OpcodeI64Load8UName.
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationLoad8) Kind ¶
func (OperationLoad8) Kind() OperationKind
Kind implements Operation.Kind
type OperationLt ¶
type OperationLt struct{ Type SignedType }
OperationLt implements Operation.
This corresponds to wasm.OpcodeI32LtS wasm.OpcodeI32LtU wasm.OpcodeI64LtS wasm.OpcodeI64LtU wasm.OpcodeF32Lt wasm.OpcodeF64Lt
type OperationMax ¶
type OperationMax struct{ Type Float }
OperationMax implements Operation.
This corresponds to wasm.OpcodeF32MaxName wasm.OpcodeF64MaxName ¶
The engines are expected to pop two values from the stack, and push back the maximum of these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 100.1].
Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN, which is a different behavior different from math.Max.
type OperationMemoryCopy ¶
type OperationMemoryCopy struct{}
OperationMemoryCopy implements Operation.
This corresponds to wasm.OpcodeMemoryCopyName.
func (OperationMemoryCopy) Kind ¶
func (OperationMemoryCopy) Kind() OperationKind
Kind implements Operation.Kind.
type OperationMemoryFill ¶
type OperationMemoryFill struct{}
OperationMemoryFill implements Operation.
This corresponds to wasm.OpcodeMemoryFillName.
func (OperationMemoryFill) Kind ¶
func (OperationMemoryFill) Kind() OperationKind
Kind implements Operation.Kind.
type OperationMemoryGrow ¶
type OperationMemoryGrow struct{ Alignment uint64 }
OperationMemoryGrow implements Operation.
func (OperationMemoryGrow) Kind ¶
func (OperationMemoryGrow) Kind() OperationKind
Kind implements Operation.Kind.
This corresponds to wasm.OpcodeMemoryGrow.
The engines are expected to pop one value from the top of the stack, then execute wasm.MemoryInstance Grow with the value, and push the previous page size of the memory onto the stack.
type OperationMemoryInit ¶
type OperationMemoryInit struct { // DataIndex is the index of the data instance in ModuleInstance.DataInstances // by which this operation instantiates a part of the memory. DataIndex uint32 }
OperationMemoryInit implements Operation.
This corresponds to wasm.OpcodeMemoryInitName.
func (OperationMemoryInit) Kind ¶
func (OperationMemoryInit) Kind() OperationKind
Kind implements Operation.Kind.
type OperationMemorySize ¶
type OperationMemorySize struct{}
OperationMemorySize implements Operation.
This corresponds to wasm.OpcodeMemorySize.
The engines are expected to push the current page size of the memory onto the stack.
func (OperationMemorySize) Kind ¶
func (OperationMemorySize) Kind() OperationKind
Kind implements Operation.Kind.
type OperationMin ¶
type OperationMin struct{ Type Float }
OperationMin implements Operation.
This corresponds to wasm.OpcodeF32MinName wasm.OpcodeF64MinName ¶
The engines are expected to pop two values from the stack, and push back the maximum of these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 1.9].
Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN, which is a different behavior different from math.Min.
type OperationMul ¶
type OperationMul struct{ Type UnsignedType }
OperationMul implements Operation.
This corresponds to wasm.OpcodeI32MulName wasm.OpcodeI64MulName wasm.OpcodeF32MulName wasm.OpcodeF64MulName.
type OperationNe ¶
type OperationNe struct{ Type UnsignedType }
OperationNe implements Operation.
This corresponds to wasm.OpcodeI32NeName wasm.OpcodeI64NeName wasm.OpcodeF32NeName wasm.OpcodeF64NeName
type OperationNearest ¶
type OperationNearest struct{ Type Float }
OperationNearest implements Operation.
This corresponds to wasm.OpcodeF32NearestName wasm.OpcodeF64NearestName ¶
Note: this is *not* equivalent to math.Round and instead has the same the semantics of LLVM's rint intrinsic. See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic. For example, math.Round(-4.5) produces -5 while we want to produce -4.
func (OperationNearest) Kind ¶
func (OperationNearest) Kind() OperationKind
Kind implements Operation.Kind.
type OperationNeg ¶
type OperationNeg struct{ Type Float }
OperationNeg implements Operation.
This corresponds to wasm.OpcodeF32Neg wasm.OpcodeF64Neg
type OperationOr ¶
type OperationOr struct{ Type UnsignedInt }
OperationOr implements Operation.
This corresponds to wasm.OpcodeI32OrName wasm.OpcodeI64OrName ¶
The engines are expected to perform "Or" operation on top two values on the stack, and pushes the result.
type OperationPick ¶
type OperationPick struct { // Depth is the location of the pick target in the uint64 value stack at runtime. // If IsTargetVector=true, this points to the location of the lower 64-bits of the vector. Depth int IsTargetVector bool }
OperationPick implements Operation.
The engines are expected to copy a value pointed by OperationPick.Depth, and push the copied value onto the top of the stack.
func (*OperationPick) Kind ¶
func (*OperationPick) Kind() OperationKind
Kind implements Operation.Kind
type OperationPopcnt ¶
type OperationPopcnt struct{ Type UnsignedInt }
OperationPopcnt implements Operation.
This corresponds to wasm.OpcodeI32PopcntName wasm.OpcodeI64PopcntName.
The engines are expected to count up the number of set bits in the current top of the stack, and push the count result. For example, stack of [..., 0b00_00_00_11] results in [..., 2].
func (OperationPopcnt) Kind ¶
func (OperationPopcnt) Kind() OperationKind
Kind implements Operation.Kind.
type OperationRefFunc ¶
type OperationRefFunc struct {
FunctionIndex uint32
}
OperationRefFunc implements Operation.
This corresponds to wasm.OpcodeRefFuncName, and engines are expected to push the opaque pointer value of engine specific func for the given FunctionIndex.
Note: in wazero, we express any reference types (funcref or externref) as opaque pointers which is uint64. Therefore, the engine implementations emit instructions to push the address of *function onto the stack.
func (OperationRefFunc) Kind ¶
func (OperationRefFunc) Kind() OperationKind
Kind implements Operation.Kind.
type OperationRem ¶
type OperationRem struct{ Type SignedInt }
OperationRem implements Operation.
This corresponds to wasm.OpcodeI32RemS wasm.OpcodeI32RemU wasm.OpcodeI64RemS wasm.OpcodeI64RemU.
The engines are expected to perform division on the top two values of integer type on the stack and puts the remainder of the result onto the stack. For example, stack [..., 10, 3] results in [..., 1] where the quotient is discarded.
type OperationRotl ¶
type OperationRotl struct{ Type UnsignedInt }
OperationRotl implements Operation.
This corresponds to wasm.OpcodeI32RotlName wasm.OpcodeI64RotlName ¶
The engines are expected to perform "Rotl" operation on top two values on the stack, and pushes the result.
func (OperationRotl) Kind ¶
func (OperationRotl) Kind() OperationKind
Kind implements Operation.Kind.
type OperationRotr ¶
type OperationRotr struct{ Type UnsignedInt }
OperationRotr implements Operation.
This corresponds to wasm.OpcodeI32RotrName wasm.OpcodeI64RotrName ¶
The engines are expected to perform "Rotr" operation on top two values on the stack, and pushes the result.
func (OperationRotr) Kind ¶
func (OperationRotr) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSelect ¶
type OperationSelect struct { // IsTargetVector true if the selection target value's type is wasm.ValueTypeV128. IsTargetVector bool }
OperationSelect implements Operation.
This corresponds to wasm.OpcodeSelect.
The engines are expected to pop three values, say [..., x2, x1, c], then if the value "c" equals zero, "x1" is pushed back onto the stack and, otherwise "x2" is pushed back.
func (*OperationSelect) Kind ¶
func (*OperationSelect) Kind() OperationKind
Kind implements Operation.Kind
type OperationSet ¶
type OperationSet struct { // Depth is the location of the set target in the uint64 value stack at runtime. // If IsTargetVector=true, this points the location of the lower 64-bits of the vector. Depth int IsTargetVector bool }
OperationSet implements Operation.
The engines are expected to set the top value of the stack to the location specified by OperationSet.Depth.
func (*OperationSet) Kind ¶
func (*OperationSet) Kind() OperationKind
Kind implements Operation.Kind
type OperationShl ¶
type OperationShl struct{ Type UnsignedInt }
OperationShl implements Operation.
This corresponds to wasm.OpcodeI32ShlName wasm.OpcodeI64ShlName ¶
The engines are expected to perform "Shl" operation on top two values on the stack, and pushes the result.
type OperationShr ¶
type OperationShr struct{ Type SignedInt }
OperationShr implements Operation.
This corresponds to wasm.OpcodeI32ShrSName wasm.OpcodeI32ShrUName wasm.OpcodeI64ShrSName wasm.OpcodeI64ShrUName ¶
If OperationShr.Type is signed integer, then, the engines are expected to perform arithmetic right shift on the two top values on the stack, otherwise do the logical right shift.
type OperationSignExtend32From16 ¶
type OperationSignExtend32From16 struct{}
OperationSignExtend32From16 implements Operation.
This corresponds to wasm.OpcodeI32Extend16SName.
The engines are expected to sign-extend the first 16-bits of 32-bit in as signed 32-bit int.
func (OperationSignExtend32From16) Kind ¶
func (OperationSignExtend32From16) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSignExtend32From8 ¶
type OperationSignExtend32From8 struct{}
OperationSignExtend32From8 implements Operation.
This corresponds to wasm.OpcodeI32Extend8SName.
The engines are expected to sign-extend the first 8-bits of 32-bit in as signed 32-bit int.
func (OperationSignExtend32From8) Kind ¶
func (OperationSignExtend32From8) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSignExtend64From16 ¶
type OperationSignExtend64From16 struct{}
OperationSignExtend64From16 implements Operation.
This corresponds to wasm.OpcodeI64Extend16SName.
The engines are expected to sign-extend the first 16-bits of 64-bit in as signed 32-bit int.
func (OperationSignExtend64From16) Kind ¶
func (OperationSignExtend64From16) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSignExtend64From32 ¶
type OperationSignExtend64From32 struct{}
OperationSignExtend64From32 implements Operation.
This corresponds to wasm.OpcodeI64Extend32SName.
The engines are expected to sign-extend the first 32-bits of 64-bit in as signed 32-bit int.
func (OperationSignExtend64From32) Kind ¶
func (OperationSignExtend64From32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSignExtend64From8 ¶
type OperationSignExtend64From8 struct{}
OperationSignExtend64From8 implements Operation.
This corresponds to wasm.OpcodeI64Extend8SName.
The engines are expected to sign-extend the first 8-bits of 64-bit in as signed 32-bit int.
func (OperationSignExtend64From8) Kind ¶
func (OperationSignExtend64From8) Kind() OperationKind
Kind implements Operation.Kind.
type OperationSqrt ¶
type OperationSqrt struct{ Type Float }
OperationSqrt implements Operation.
This corresponds to wasm.OpcodeF32SqrtName wasm.OpcodeF64SqrtName
func (OperationSqrt) Kind ¶
func (OperationSqrt) Kind() OperationKind
Kind implements Operation.Kind.
type OperationStore ¶
type OperationStore struct { Type UnsignedType Arg *MemoryArg }
OperationStore implements Operation.
This corresponds to wasm.OpcodeI32StoreName wasm.OpcodeI64StoreName wasm.OpcodeF32StoreName wasm.OpcodeF64StoreName ¶
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (*OperationStore) Kind ¶
func (*OperationStore) Kind() OperationKind
Kind implements Operation.Kind
type OperationStore16 ¶
type OperationStore16 struct {
Arg *MemoryArg
}
OperationStore16 implements Operation.
This corresponds to wasm.OpcodeI32Store16Name wasm.OpcodeI64Store16Name ¶
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationStore16) Kind ¶
func (OperationStore16) Kind() OperationKind
Kind implements Operation.Kind
type OperationStore32 ¶
type OperationStore32 struct {
Arg *MemoryArg
}
OperationStore32 implements Operation.
This corresponds to wasm.OpcodeI64Store32Name ¶
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationStore32) Kind ¶
func (OperationStore32) Kind() OperationKind
Kind implements Operation.Kind.
type OperationStore8 ¶
type OperationStore8 struct {
Arg *MemoryArg
}
OperationStore8 implements Operation.
This corresponds to wasm.OpcodeI32Store8Name wasm.OpcodeI64Store8Name ¶
The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
func (OperationStore8) Kind ¶
func (OperationStore8) Kind() OperationKind
Kind implements Operation.Kind
type OperationSub ¶
type OperationSub struct{ Type UnsignedType }
OperationSub implements Operation.
This corresponds to wasm.OpcodeI32SubName wasm.OpcodeI64SubName wasm.OpcodeF32SubName wasm.OpcodeF64SubName.
type OperationTableCopy ¶
type OperationTableCopy struct {
SrcTableIndex, DstTableIndex uint32
}
OperationTableCopy implements Operation.
This corresponds to wasm.OpcodeTableCopyName.
func (OperationTableCopy) Kind ¶
func (OperationTableCopy) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableFill ¶
type OperationTableFill struct {
TableIndex uint32
}
OperationTableFill implements Operation.
This corresponds to wasm.OpcodeTableFillName.
func (OperationTableFill) Kind ¶
func (OperationTableFill) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableGet ¶
type OperationTableGet struct {
TableIndex uint32
}
OperationTableGet implements Operation.
This corresponds to wasm.OpcodeTableGetName.
func (OperationTableGet) Kind ¶
func (OperationTableGet) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableGrow ¶
type OperationTableGrow struct {
TableIndex uint32
}
OperationTableGrow implements Operation.
This corresponds to wasm.OpcodeTableGrowName.
func (OperationTableGrow) Kind ¶
func (OperationTableGrow) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableInit ¶
type OperationTableInit struct { // ElemIndex is the index of the element by which this operation initializes a part of the table. ElemIndex uint32 // TableIndex is the index of the table on which this operation initialize by the target element. TableIndex uint32 }
OperationTableInit implements Operation.
This corresponds to wasm.OpcodeTableInitName.
func (OperationTableInit) Kind ¶
func (OperationTableInit) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableSet ¶
type OperationTableSet struct {
TableIndex uint32
}
OperationTableSet implements Operation.
This corresponds to wasm.OpcodeTableSetName.
func (OperationTableSet) Kind ¶
func (OperationTableSet) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTableSize ¶
type OperationTableSize struct {
TableIndex uint32
}
OperationTableSize implements Operation.
This corresponds to wasm.OpcodeTableSizeName.
func (OperationTableSize) Kind ¶
func (OperationTableSize) Kind() OperationKind
Kind implements Operation.Kind.
type OperationTrunc ¶
type OperationTrunc struct{ Type Float }
OperationTrunc implements Operation.
This corresponds to wasm.OpcodeF32TruncName wasm.OpcodeF64TruncName
func (OperationTrunc) Kind ¶
func (OperationTrunc) Kind() OperationKind
Kind implements Operation.Kind.
type OperationUnreachable ¶
type OperationUnreachable struct{}
OperationUnreachable implements Operation.
This corresponds to wasm.OpcodeUnreachable.
The engines are expected to exit the execution with wasmruntime.ErrRuntimeUnreachable error.
func (*OperationUnreachable) Kind ¶
func (*OperationUnreachable) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Abs ¶
type OperationV128Abs struct {
Shape Shape
}
OperationV128Abs implements Operation.
This corresponds to wasm.OpcodeVecI8x16AbsName wasm.OpcodeVecI16x8AbsName wasm.OpcodeVecI32x4AbsName
wasm.OpcodeVecI64x2AbsName wasm.OpcodeVecF32x4AbsName wasm.OpcodeVecF64x2AbsName.
func (OperationV128Abs) Kind ¶
func (OperationV128Abs) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Add ¶
type OperationV128Add struct {
Shape Shape
}
OperationV128Add implements Operation.
This corresponds to wasm.OpcodeVecI8x16AddName wasm.OpcodeVecI16x8AddName wasm.OpcodeVecI32x4AddName
wasm.OpcodeVecI64x2AddName wasm.OpcodeVecF32x4AddName wasm.OpcodeVecF64x2AddName
func (OperationV128Add) Kind ¶
func (OperationV128Add) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128AddSat ¶
type OperationV128AddSat struct { // Shape is either ShapeI8x16 or ShapeI16x8. Shape Shape Signed bool }
OperationV128AddSat implements Operation.
This corresponds to wasm.OpcodeVecI8x16AddSatUName wasm.OpcodeVecI8x16AddSatSName
wasm.OpcodeVecI16x8AddSatUName wasm.OpcodeVecI16x8AddSatSName
func (OperationV128AddSat) Kind ¶
func (OperationV128AddSat) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128AllTrue ¶
type OperationV128AllTrue struct {
Shape Shape
}
OperationV128AllTrue implements Operation.
This corresponds to
wasm.OpcodeVecI8x16AllTrueName wasm.OpcodeVecI16x8AllTrueName wasm.OpcodeVecI32x4AllTrueName wasm.OpcodeVecI64x2AllTrueName.
func (OperationV128AllTrue) Kind ¶
func (OperationV128AllTrue) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128And ¶
type OperationV128And struct{}
OperationV128And implements Operation.
This corresponds to wasm.OpcodeVecV128And.
func (OperationV128And) Kind ¶
func (OperationV128And) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128AndNot ¶
type OperationV128AndNot struct{}
OperationV128AndNot implements Operation.
This corresponds to wasm.OpcodeVecV128AndNot.
func (OperationV128AndNot) Kind ¶
func (OperationV128AndNot) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128AnyTrue ¶
type OperationV128AnyTrue struct{}
OperationV128AnyTrue implements Operation.
This corresponds to wasm.OpcodeVecV128AnyTrueName.
func (OperationV128AnyTrue) Kind ¶
func (OperationV128AnyTrue) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128AvgrU ¶
type OperationV128AvgrU struct {
Shape Shape
}
OperationV128AvgrU implements Operation.
This corresponds to wasm.OpcodeVecI8x16AvgrUName.
func (OperationV128AvgrU) Kind ¶
func (OperationV128AvgrU) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128BitMask ¶
type OperationV128BitMask struct {
Shape Shape
}
OperationV128BitMask implements Operation.
This corresponds to
wasm.OpcodeVecI8x16BitMaskName wasm.OpcodeVecI16x8BitMaskName wasm.OpcodeVecI32x4BitMaskName wasm.OpcodeVecI64x2BitMaskName.
func (OperationV128BitMask) Kind ¶
func (OperationV128BitMask) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Bitselect ¶
type OperationV128Bitselect struct{}
OperationV128Bitselect implements Operation.
This corresponds to wasm.OpcodeVecV128Bitselect.
func (OperationV128Bitselect) Kind ¶
func (OperationV128Bitselect) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Ceil ¶
type OperationV128Ceil struct{ Shape Shape }
OperationV128Ceil implements Operation.
This corresponds to wasm.OpcodeVecF32x4CeilName wasm.OpcodeVecF64x2CeilName
func (OperationV128Ceil) Kind ¶
func (OperationV128Ceil) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Cmp ¶
type OperationV128Cmp struct {
Type V128CmpType
}
OperationV128Cmp implements Operation.
This corresponds to
wasm.OpcodeVecI8x16EqName, wasm.OpcodeVecI8x16NeName, wasm.OpcodeVecI8x16LtSName, wasm.OpcodeVecI8x16LtUName, wasm.OpcodeVecI8x16GtSName, wasm.OpcodeVecI8x16GtUName, wasm.OpcodeVecI8x16LeSName, wasm.OpcodeVecI8x16LeUName, wasm.OpcodeVecI8x16GeSName, wasm.OpcodeVecI8x16GeUName, wasm.OpcodeVecI16x8EqName, wasm.OpcodeVecI16x8NeName, wasm.OpcodeVecI16x8LtSName, wasm.OpcodeVecI16x8LtUName, wasm.OpcodeVecI16x8GtSName, wasm.OpcodeVecI16x8GtUName, wasm.OpcodeVecI16x8LeSName, wasm.OpcodeVecI16x8LeUName, wasm.OpcodeVecI16x8GeSName, wasm.OpcodeVecI16x8GeUName, wasm.OpcodeVecI32x4EqName, wasm.OpcodeVecI32x4NeName, wasm.OpcodeVecI32x4LtSName, wasm.OpcodeVecI32x4LtUName, wasm.OpcodeVecI32x4GtSName, wasm.OpcodeVecI32x4GtUName, wasm.OpcodeVecI32x4LeSName, wasm.OpcodeVecI32x4LeUName, wasm.OpcodeVecI32x4GeSName, wasm.OpcodeVecI32x4GeUName, wasm.OpcodeVecI64x2EqName, wasm.OpcodeVecI64x2NeName, wasm.OpcodeVecI64x2LtSName, wasm.OpcodeVecI64x2GtSName, wasm.OpcodeVecI64x2LeSName, wasm.OpcodeVecI64x2GeSName, wasm.OpcodeVecF32x4EqName, wasm.OpcodeVecF32x4NeName, wasm.OpcodeVecF32x4LtName, wasm.OpcodeVecF32x4GtName, wasm.OpcodeVecF32x4LeName, wasm.OpcodeVecF32x4GeName, wasm.OpcodeVecF64x2EqName, wasm.OpcodeVecF64x2NeName, wasm.OpcodeVecF64x2LtName, wasm.OpcodeVecF64x2GtName, wasm.OpcodeVecF64x2LeName, wasm.OpcodeVecF64x2GeName
func (OperationV128Cmp) Kind ¶
func (OperationV128Cmp) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Const ¶
type OperationV128Const struct {
Lo, Hi uint64
}
OperationV128Const implements Operation.
func (OperationV128Const) Kind ¶
func (OperationV128Const) Kind() OperationKind
Kind implements Operation.Kind.
This corresponds to wasm.OpcodeVecV128Const.
type OperationV128Div ¶
type OperationV128Div struct { // Shape is either ShapeF32x4 or ShapeF64x2. Shape Shape }
OperationV128Div implements Operation.
This corresponds to wasm.OpcodeVecF32x4DivName wasm.OpcodeVecF64x2DivName.
func (OperationV128Div) Kind ¶
func (OperationV128Div) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Dot ¶
type OperationV128Dot struct{}
OperationV128Dot implements Operation.
This corresponds to wasm.OpcodeVecI32x4DotI16x8SName
func (OperationV128Dot) Kind ¶
func (OperationV128Dot) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128ExtAddPairwise ¶
type OperationV128ExtAddPairwise struct { // OriginShape is the shape of the original lanes for extension which is // either ShapeI8x16, or ShapeI16x8. OriginShape Shape Signed bool }
OperationV128ExtAddPairwise implements Operation.
This corresponds to
wasm.OpcodeVecI16x8ExtaddPairwiseI8x16SName wasm.OpcodeVecI16x8ExtaddPairwiseI8x16UName wasm.OpcodeVecI32x4ExtaddPairwiseI16x8SName wasm.OpcodeVecI32x4ExtaddPairwiseI16x8UName.
func (OperationV128ExtAddPairwise) Kind ¶
func (OperationV128ExtAddPairwise) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128ExtMul ¶
type OperationV128ExtMul struct { // OriginShape is the shape of the original lanes for extension which is // either ShapeI8x16, ShapeI16x8, or ShapeI32x4. OriginShape Shape Signed bool // UseLow true if it uses the lower half of vector for extension. UseLow bool }
OperationV128ExtMul implements Operation
This corresponds to
wasm.OpcodeVecI16x8ExtMulLowI8x16SName wasm.OpcodeVecI16x8ExtMulLowI8x16UName wasm.OpcodeVecI16x8ExtMulHighI8x16SName wasm.OpcodeVecI16x8ExtMulHighI8x16UName wasm.OpcodeVecI32x4ExtMulLowI16x8SName wasm.OpcodeVecI32x4ExtMulLowI16x8UName wasm.OpcodeVecI32x4ExtMulHighI16x8SName wasm.OpcodeVecI32x4ExtMulHighI16x8UName wasm.OpcodeVecI64x2ExtMulLowI32x4SName wasm.OpcodeVecI64x2ExtMulLowI32x4UName wasm.OpcodeVecI64x2ExtMulHighI32x4SName wasm.OpcodeVecI64x2ExtMulHighI32x4UName.
func (OperationV128ExtMul) Kind ¶
func (OperationV128ExtMul) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Extend ¶
type OperationV128Extend struct { // OriginShape is the shape of the original lanes for extension which is // either ShapeI8x16, ShapeI16x8, or ShapeI32x4. OriginShape Shape Signed bool // UseLow true if it uses the lower half of vector for extension. UseLow bool }
OperationV128Extend implements Operation
This corresponds to
wasm.OpcodeVecI16x8ExtendLowI8x16SName wasm.OpcodeVecI16x8ExtendHighI8x16SName wasm.OpcodeVecI16x8ExtendLowI8x16UName wasm.OpcodeVecI16x8ExtendHighI8x16UName wasm.OpcodeVecI32x4ExtendLowI16x8SName wasm.OpcodeVecI32x4ExtendHighI16x8SName wasm.OpcodeVecI32x4ExtendLowI16x8UName wasm.OpcodeVecI32x4ExtendHighI16x8UName wasm.OpcodeVecI64x2ExtendLowI32x4SName wasm.OpcodeVecI64x2ExtendHighI32x4SName wasm.OpcodeVecI64x2ExtendLowI32x4UName wasm.OpcodeVecI64x2ExtendHighI32x4UName
func (OperationV128Extend) Kind ¶
func (OperationV128Extend) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128ExtractLane ¶
type OperationV128ExtractLane struct { // LaneIndex is >=0 && <M where shape = NxM. LaneIndex byte // Signed is used when shape is either i8x16 or i16x2 to specify whether to sign-extend or not. Signed bool Shape Shape }
OperationV128ExtractLane implements Operation.
This corresponds to
wasm.OpcodeVecI8x16ExtractLaneSName wasm.OpcodeVecI8x16ExtractLaneUName wasm.OpcodeVecI16x8ExtractLaneSName wasm.OpcodeVecI16x8ExtractLaneUName wasm.OpcodeVecI32x4ExtractLaneName wasm.OpcodeVecI64x2ExtractLaneName wasm.OpcodeVecF32x4ExtractLaneName wasm.OpcodeVecF64x2ExtractLaneName.
func (OperationV128ExtractLane) Kind ¶
func (OperationV128ExtractLane) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128FConvertFromI ¶
type OperationV128FConvertFromI struct { // DestinationShape is the shape of the destination lanes for conversion which is // either ShapeF32x4, or ShapeF64x2. DestinationShape Shape Signed bool }
OperationV128FConvertFromI implements Operation.
This corresponds to
wasm.OpcodeVecF32x4ConvertI32x4SName wasm.OpcodeVecF32x4ConvertI32x4UName wasm.OpcodeVecF64x2ConvertLowI32x4SName wasm.OpcodeVecF64x2ConvertLowI32x4UName.
func (OperationV128FConvertFromI) Kind ¶
func (OperationV128FConvertFromI) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128FloatDemote ¶
type OperationV128FloatDemote struct{}
OperationV128FloatDemote implements Operation.
This corresponds to wasm.OpcodeVecF32x4DemoteF64x2ZeroName.
func (OperationV128FloatDemote) Kind ¶
func (OperationV128FloatDemote) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128FloatPromote ¶
type OperationV128FloatPromote struct{}
OperationV128FloatPromote implements Operation.
This corresponds to wasm.OpcodeVecF64x2PromoteLowF32x4ZeroName This discards the higher 64-bit of a vector, and promotes two 32-bit floats in the lower 64-bit as two 64-bit floats.
func (OperationV128FloatPromote) Kind ¶
func (OperationV128FloatPromote) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Floor ¶
type OperationV128Floor struct{ Shape Shape }
OperationV128Floor implements Operation.
This corresponds to wasm.OpcodeVecF32x4FloorName wasm.OpcodeVecF64x2FloorName
func (OperationV128Floor) Kind ¶
func (OperationV128Floor) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128ITruncSatFromF ¶
type OperationV128ITruncSatFromF struct { // OriginShape is the shape of the original lanes for truncation which is // either ShapeF32x4, or ShapeF64x2. OriginShape Shape Signed bool }
OperationV128ITruncSatFromF implements Operation.
This corresponds to
wasm.OpcodeVecI32x4TruncSatF64x2UZeroName wasm.OpcodeVecI32x4TruncSatF64x2SZeroName wasm.OpcodeVecI32x4TruncSatF32x4UName wasm.OpcodeVecI32x4TruncSatF32x4SName.
func (OperationV128ITruncSatFromF) Kind ¶
func (OperationV128ITruncSatFromF) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Load ¶
type OperationV128Load struct { Type V128LoadType Arg *MemoryArg }
OperationV128Load implements Operation.
This corresponds to
wasm.OpcodeVecV128LoadName wasm.OpcodeVecV128Load8x8SName wasm.OpcodeVecV128Load8x8UName wasm.OpcodeVecV128Load16x4SName wasm.OpcodeVecV128Load16x4UName wasm.OpcodeVecV128Load32x2SName wasm.OpcodeVecV128Load32x2UName wasm.OpcodeVecV128Load8SplatName wasm.OpcodeVecV128Load16SplatName wasm.OpcodeVecV128Load32SplatName wasm.OpcodeVecV128Load64SplatName wasm.OpcodeVecV128Load32zeroName wasm.OpcodeVecV128Load64zeroName
func (OperationV128Load) Kind ¶
func (OperationV128Load) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128LoadLane ¶
type OperationV128LoadLane struct { // LaneIndex is >=0 && <(128/LaneSize). LaneIndex byte // LaneSize is either 8, 16, 32, or 64. LaneSize byte Arg *MemoryArg }
OperationV128LoadLane implements Operation.
This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
func (OperationV128LoadLane) Kind ¶
func (OperationV128LoadLane) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Max ¶
OperationV128Max implements Operation.
This corresponds to
wasm.OpcodeVecI8x16MaxSName wasm.OpcodeVecI8x16MaxUName wasm.OpcodeVecI16x8MaxSName wasm.OpcodeVecI16x8MaxUName wasm.OpcodeVecI32x4MaxSName wasm.OpcodeVecI32x4MaxUName wasm.OpcodeVecI16x8MaxSName wasm.OpcodeVecI16x8MaxUName wasm.OpcodeVecF32x4MaxName wasm.OpcodeVecF64x2MaxName.
func (OperationV128Max) Kind ¶
func (OperationV128Max) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Min ¶
OperationV128Min implements Operation.
This corresponds to
wasm.OpcodeVecI8x16MinSName wasm.OpcodeVecI8x16MinUName wasm.OpcodeVecI16x8MinSName wasm.OpcodeVecI16x8MinUName wasm.OpcodeVecI32x4MinSName wasm.OpcodeVecI32x4MinUName wasm.OpcodeVecI16x8MinSName wasm.OpcodeVecI16x8MinUName wasm.OpcodeVecF32x4MinName wasm.OpcodeVecF64x2MinName
func (OperationV128Min) Kind ¶
func (OperationV128Min) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Mul ¶
type OperationV128Mul struct { // Shape is either ShapeI16x8, ShapeI32x4, ShapeI64x2, ShapeF32x4 or ShapeF64x2. Shape Shape }
OperationV128Mul implements Operation.
This corresponds to wasm.OpcodeVecF32x4MulName wasm.OpcodeVecF64x2MulName
wasm.OpcodeVecI16x8MulName wasm.OpcodeVecI32x4MulName wasm.OpcodeVecI64x2MulName.
func (OperationV128Mul) Kind ¶
func (OperationV128Mul) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Narrow ¶
type OperationV128Narrow struct { // OriginShape is the shape of the original lanes for narrowing which is // either ShapeI16x8, or ShapeI32x4. OriginShape Shape Signed bool }
OperationV128Narrow implements Operation.
This corresponds to
wasm.OpcodeVecI8x16NarrowI16x8SName wasm.OpcodeVecI8x16NarrowI16x8UName wasm.OpcodeVecI16x8NarrowI32x4SName wasm.OpcodeVecI16x8NarrowI32x4UName.
func (OperationV128Narrow) Kind ¶
func (OperationV128Narrow) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Nearest ¶
type OperationV128Nearest struct{ Shape Shape }
OperationV128Nearest implements Operation.
This corresponds to wasm.OpcodeVecF32x4NearestName wasm.OpcodeVecF64x2NearestName
func (OperationV128Nearest) Kind ¶
func (OperationV128Nearest) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Neg ¶
type OperationV128Neg struct {
Shape Shape
}
OperationV128Neg implements Operation.
This corresponds to wasm.OpcodeVecI8x16NegName wasm.OpcodeVecI16x8NegName wasm.OpcodeVecI32x4NegName
wasm.OpcodeVecI64x2NegName wasm.OpcodeVecF32x4NegName wasm.OpcodeVecF64x2NegName.
func (OperationV128Neg) Kind ¶
func (OperationV128Neg) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Not ¶
type OperationV128Not struct{}
OperationV128Not implements Operation.
This corresponds to wasm.OpcodeVecV128Not.
func (OperationV128Not) Kind ¶
func (OperationV128Not) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Or ¶
type OperationV128Or struct{}
OperationV128Or implements Operation.
This corresponds to wasm.OpcodeVecV128Or.
func (OperationV128Or) Kind ¶
func (OperationV128Or) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Pmax ¶
type OperationV128Pmax struct{ Shape Shape }
OperationV128Pmax implements Operation.
This corresponds to wasm.OpcodeVecF32x4PmaxName wasm.OpcodeVecF64x2PmaxName.
func (OperationV128Pmax) Kind ¶
func (OperationV128Pmax) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Pmin ¶
type OperationV128Pmin struct{ Shape Shape }
OperationV128Pmin implements Operation.
This corresponds to wasm.OpcodeVecF32x4PminName wasm.OpcodeVecF64x2PminName.
func (OperationV128Pmin) Kind ¶
func (OperationV128Pmin) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Popcnt ¶
type OperationV128Popcnt struct {
Shape Shape
}
OperationV128Popcnt implements Operation.
This corresponds to wasm.OpcodeVecI8x16PopcntName.
func (OperationV128Popcnt) Kind ¶
func (OperationV128Popcnt) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Q15mulrSatS ¶
type OperationV128Q15mulrSatS struct{}
OperationV128Q15mulrSatS implements Operation
This corresponds to wasm.OpcodeVecI16x8Q15mulrSatSName
func (OperationV128Q15mulrSatS) Kind ¶
func (OperationV128Q15mulrSatS) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128ReplaceLane ¶
type OperationV128ReplaceLane struct { // LaneIndex is >=0 && <M where shape = NxM. LaneIndex byte Shape Shape }
OperationV128ReplaceLane implements Operation.
This corresponds to
wasm.OpcodeVecI8x16ReplaceLaneName wasm.OpcodeVecI16x8ReplaceLaneName wasm.OpcodeVecI32x4ReplaceLaneName wasm.OpcodeVecI64x2ReplaceLaneName wasm.OpcodeVecF32x4ReplaceLaneName wasm.OpcodeVecF64x2ReplaceLaneName.
func (OperationV128ReplaceLane) Kind ¶
func (OperationV128ReplaceLane) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Shl ¶
type OperationV128Shl struct {
Shape Shape
}
OperationV128Shl implements Operation.
This corresponds to
wasm.OpcodeVecI8x16ShlName wasm.OpcodeVecI16x8ShlName wasm.OpcodeVecI32x4ShlName wasm.OpcodeVecI64x2ShlName
func (OperationV128Shl) Kind ¶
func (OperationV128Shl) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Shr ¶
OperationV128Shr implements Operation.
This corresponds to
wasm.OpcodeVecI8x16ShrSName wasm.OpcodeVecI8x16ShrUName wasm.OpcodeVecI16x8ShrSName wasm.OpcodeVecI16x8ShrUName wasm.OpcodeVecI32x4ShrSName wasm.OpcodeVecI32x4ShrUName. wasm.OpcodeVecI64x2ShrSName wasm.OpcodeVecI64x2ShrUName.
func (OperationV128Shr) Kind ¶
func (OperationV128Shr) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Shuffle ¶
type OperationV128Shuffle struct {
Lanes [16]byte
}
OperationV128Shuffle implements Operation.
func (OperationV128Shuffle) Kind ¶
func (OperationV128Shuffle) Kind() OperationKind
Kind implements Operation.Kind.
This corresponds to wasm.OpcodeVecV128i8x16ShuffleName.
type OperationV128Splat ¶
type OperationV128Splat struct {
Shape Shape
}
OperationV128Splat implements Operation.
This corresponds to
wasm.OpcodeVecI8x16SplatName wasm.OpcodeVecI16x8SplatName wasm.OpcodeVecI32x4SplatName wasm.OpcodeVecI64x2SplatName wasm.OpcodeVecF32x4SplatName wasm.OpcodeVecF64x2SplatName.
func (OperationV128Splat) Kind ¶
func (OperationV128Splat) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Sqrt ¶
type OperationV128Sqrt struct { // Shape is either ShapeF32x4 or ShapeF64x2. Shape Shape }
OperationV128Sqrt implements Operation.
This corresponds to wasm.OpcodeVecF32x4SqrtName wasm.OpcodeVecF64x2SqrtName.
func (OperationV128Sqrt) Kind ¶
func (OperationV128Sqrt) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Store ¶
type OperationV128Store struct {
Arg *MemoryArg
}
OperationV128Store implements Operation.
This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
func (OperationV128Store) Kind ¶
func (OperationV128Store) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128StoreLane ¶
type OperationV128StoreLane struct { // LaneIndex is >=0 && <(128/LaneSize). LaneIndex byte // LaneSize is either 8, 16, 32, or 64. LaneSize byte Arg *MemoryArg }
OperationV128StoreLane implements Operation.
This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
func (OperationV128StoreLane) Kind ¶
func (OperationV128StoreLane) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Sub ¶
type OperationV128Sub struct {
Shape Shape
}
OperationV128Sub implements Operation.
This corresponds to wasm.OpcodeVecI8x16SubName wasm.OpcodeVecI16x8SubName wasm.OpcodeVecI32x4SubName
wasm.OpcodeVecI64x2SubName wasm.OpcodeVecF32x4SubName wasm.OpcodeVecF64x2SubName
func (OperationV128Sub) Kind ¶
func (OperationV128Sub) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128SubSat ¶
type OperationV128SubSat struct { // Shape is either ShapeI8x16 or ShapeI16x8. Shape Shape Signed bool }
OperationV128SubSat implements Operation.
This corresponds to wasm.OpcodeVecI8x16SubSatUName wasm.OpcodeVecI8x16SubSatSName
wasm.OpcodeVecI16x8SubSatUName wasm.OpcodeVecI16x8SubSatSName
func (OperationV128SubSat) Kind ¶
func (OperationV128SubSat) Kind() OperationKind
Kind implements Operation.Kind.
type OperationV128Swizzle ¶
type OperationV128Swizzle struct{}
OperationV128Swizzle implements Operation.
func (OperationV128Swizzle) Kind ¶
func (OperationV128Swizzle) Kind() OperationKind
Kind implements Operation.Kind.
This corresponds to wasm.OpcodeVecI8x16SwizzleName.
type OperationV128Trunc ¶
type OperationV128Trunc struct{ Shape Shape }
OperationV128Trunc implements Operation.
This corresponds to wasm.OpcodeVecF32x4TruncName wasm.OpcodeVecF64x2TruncName
func (OperationV128Trunc) Kind ¶
func (OperationV128Trunc) Kind() OperationKind
Kind implements Operation.Kind
type OperationV128Xor ¶
type OperationV128Xor struct{}
OperationV128Xor implements Operation.
This corresponds to wasm.OpcodeVecV128Xor.
func (OperationV128Xor) Kind ¶
func (OperationV128Xor) Kind() OperationKind
Kind implements Operation.Kind.
type OperationXor ¶
type OperationXor struct{ Type UnsignedInt }
OperationXor implements Operation.
This corresponds to wasm.OpcodeI32XorName wasm.OpcodeI64XorName ¶
The engines are expected to perform "Xor" operation on top two values on the stack, and pushes the result.
type Shape ¶
type Shape = byte
Shape corresponds to a shape of v128 values. https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-shape
type SignedType ¶
type SignedType byte
SignedType is the union of SignedInt and Float types.
const ( SignedTypeInt32 SignedType = iota SignedTypeUint32 SignedTypeInt64 SignedTypeUint64 SignedTypeFloat32 SignedTypeFloat64 )
func (SignedType) String ¶
func (s SignedType) String() (ret string)
String implements fmt.Stringer.
type UnsignedInt ¶
type UnsignedInt byte
UnsignedInt represents unsigned 32-bit or 64-bit integers.
const ( UnsignedInt32 UnsignedInt = iota UnsignedInt64 )
func (UnsignedInt) String ¶
func (s UnsignedInt) String() (ret string)
String implements fmt.Stringer.
type UnsignedType ¶
type UnsignedType byte
UnsignedType is the union of UnsignedInt, Float and V128 vector type.
const ( UnsignedTypeI32 UnsignedType = iota UnsignedTypeI64 UnsignedTypeF32 UnsignedTypeF64 UnsignedTypeV128 UnsignedTypeUnknown )
func (UnsignedType) String ¶
func (s UnsignedType) String() (ret string)
String implements fmt.Stringer.
type V128CmpType ¶
type V128CmpType = byte
V128CmpType represents a type of vector comparison operation.
const ( // V128CmpTypeI8x16Eq corresponds to wasm.OpcodeVecI8x16EqName. V128CmpTypeI8x16Eq V128CmpType = iota // V128CmpTypeI8x16Ne corresponds to wasm.OpcodeVecI8x16NeName. V128CmpTypeI8x16Ne // V128CmpTypeI8x16LtS corresponds to wasm.OpcodeVecI8x16LtSName. V128CmpTypeI8x16LtS // V128CmpTypeI8x16LtU corresponds to wasm.OpcodeVecI8x16LtUName. V128CmpTypeI8x16LtU // V128CmpTypeI8x16GtS corresponds to wasm.OpcodeVecI8x16GtSName. V128CmpTypeI8x16GtS // V128CmpTypeI8x16GtU corresponds to wasm.OpcodeVecI8x16GtUName. V128CmpTypeI8x16GtU // V128CmpTypeI8x16LeS corresponds to wasm.OpcodeVecI8x16LeSName. V128CmpTypeI8x16LeS // V128CmpTypeI8x16LeU corresponds to wasm.OpcodeVecI8x16LeUName. V128CmpTypeI8x16LeU // V128CmpTypeI8x16GeS corresponds to wasm.OpcodeVecI8x16GeSName. V128CmpTypeI8x16GeS // V128CmpTypeI8x16GeU corresponds to wasm.OpcodeVecI8x16GeUName. V128CmpTypeI8x16GeU // V128CmpTypeI16x8Eq corresponds to wasm.OpcodeVecI16x8EqName. V128CmpTypeI16x8Eq // V128CmpTypeI16x8Ne corresponds to wasm.OpcodeVecI16x8NeName. V128CmpTypeI16x8Ne // V128CmpTypeI16x8LtS corresponds to wasm.OpcodeVecI16x8LtSName. V128CmpTypeI16x8LtS // V128CmpTypeI16x8LtU corresponds to wasm.OpcodeVecI16x8LtUName. V128CmpTypeI16x8LtU // V128CmpTypeI16x8GtS corresponds to wasm.OpcodeVecI16x8GtSName. V128CmpTypeI16x8GtS // V128CmpTypeI16x8GtU corresponds to wasm.OpcodeVecI16x8GtUName. V128CmpTypeI16x8GtU // V128CmpTypeI16x8LeS corresponds to wasm.OpcodeVecI16x8LeSName. V128CmpTypeI16x8LeS // V128CmpTypeI16x8LeU corresponds to wasm.OpcodeVecI16x8LeUName. V128CmpTypeI16x8LeU // V128CmpTypeI16x8GeS corresponds to wasm.OpcodeVecI16x8GeSName. V128CmpTypeI16x8GeS // V128CmpTypeI16x8GeU corresponds to wasm.OpcodeVecI16x8GeUName. V128CmpTypeI16x8GeU // V128CmpTypeI32x4Eq corresponds to wasm.OpcodeVecI32x4EqName. V128CmpTypeI32x4Eq // V128CmpTypeI32x4Ne corresponds to wasm.OpcodeVecI32x4NeName. V128CmpTypeI32x4Ne // V128CmpTypeI32x4LtS corresponds to wasm.OpcodeVecI32x4LtSName. V128CmpTypeI32x4LtS // V128CmpTypeI32x4LtU corresponds to wasm.OpcodeVecI32x4LtUName. V128CmpTypeI32x4LtU // V128CmpTypeI32x4GtS corresponds to wasm.OpcodeVecI32x4GtSName. V128CmpTypeI32x4GtS // V128CmpTypeI32x4GtU corresponds to wasm.OpcodeVecI32x4GtUName. V128CmpTypeI32x4GtU // V128CmpTypeI32x4LeS corresponds to wasm.OpcodeVecI32x4LeSName. V128CmpTypeI32x4LeS // V128CmpTypeI32x4LeU corresponds to wasm.OpcodeVecI32x4LeUName. V128CmpTypeI32x4LeU // V128CmpTypeI32x4GeS corresponds to wasm.OpcodeVecI32x4GeSName. V128CmpTypeI32x4GeS // V128CmpTypeI32x4GeU corresponds to wasm.OpcodeVecI32x4GeUName. V128CmpTypeI32x4GeU // V128CmpTypeI64x2Eq corresponds to wasm.OpcodeVecI64x2EqName. V128CmpTypeI64x2Eq // V128CmpTypeI64x2Ne corresponds to wasm.OpcodeVecI64x2NeName. V128CmpTypeI64x2Ne // V128CmpTypeI64x2LtS corresponds to wasm.OpcodeVecI64x2LtSName. V128CmpTypeI64x2LtS // V128CmpTypeI64x2GtS corresponds to wasm.OpcodeVecI64x2GtSName. V128CmpTypeI64x2GtS // V128CmpTypeI64x2LeS corresponds to wasm.OpcodeVecI64x2LeSName. V128CmpTypeI64x2LeS // V128CmpTypeI64x2GeS corresponds to wasm.OpcodeVecI64x2GeSName. V128CmpTypeI64x2GeS // V128CmpTypeF32x4Eq corresponds to wasm.OpcodeVecF32x4EqName. V128CmpTypeF32x4Eq // V128CmpTypeF32x4Ne corresponds to wasm.OpcodeVecF32x4NeName. V128CmpTypeF32x4Ne // V128CmpTypeF32x4Lt corresponds to wasm.OpcodeVecF32x4LtName. V128CmpTypeF32x4Lt // V128CmpTypeF32x4Gt corresponds to wasm.OpcodeVecF32x4GtName. V128CmpTypeF32x4Gt // V128CmpTypeF32x4Le corresponds to wasm.OpcodeVecF32x4LeName. V128CmpTypeF32x4Le // V128CmpTypeF32x4Ge corresponds to wasm.OpcodeVecF32x4GeName. V128CmpTypeF32x4Ge // V128CmpTypeF64x2Eq corresponds to wasm.OpcodeVecF64x2EqName. V128CmpTypeF64x2Eq // V128CmpTypeF64x2Ne corresponds to wasm.OpcodeVecF64x2NeName. V128CmpTypeF64x2Ne // V128CmpTypeF64x2Lt corresponds to wasm.OpcodeVecF64x2LtName. V128CmpTypeF64x2Lt // V128CmpTypeF64x2Gt corresponds to wasm.OpcodeVecF64x2GtName. V128CmpTypeF64x2Gt // V128CmpTypeF64x2Le corresponds to wasm.OpcodeVecF64x2LeName. V128CmpTypeF64x2Le // V128CmpTypeF64x2Ge corresponds to wasm.OpcodeVecF64x2GeName. V128CmpTypeF64x2Ge )
type V128LoadType ¶
type V128LoadType = byte
V128LoadType represents a type of wasm.OpcodeVecV128Load* instructions.
const ( // V128LoadType128 corresponds to wasm.OpcodeVecV128LoadName. V128LoadType128 V128LoadType = iota // V128LoadType8x8s corresponds to wasm.OpcodeVecV128Load8x8SName. V128LoadType8x8s // V128LoadType8x8u corresponds to wasm.OpcodeVecV128Load8x8UName. V128LoadType8x8u // V128LoadType16x4s corresponds to wasm.OpcodeVecV128Load16x4SName V128LoadType16x4s // V128LoadType16x4u corresponds to wasm.OpcodeVecV128Load16x4UName V128LoadType16x4u // V128LoadType32x2s corresponds to wasm.OpcodeVecV128Load32x2SName V128LoadType32x2s // V128LoadType32x2u corresponds to wasm.OpcodeVecV128Load32x2UName V128LoadType32x2u // V128LoadType8Splat corresponds to wasm.OpcodeVecV128Load8SplatName V128LoadType8Splat // V128LoadType16Splat corresponds to wasm.OpcodeVecV128Load16SplatName V128LoadType16Splat // V128LoadType32Splat corresponds to wasm.OpcodeVecV128Load32SplatName V128LoadType32Splat // V128LoadType64Splat corresponds to wasm.OpcodeVecV128Load64SplatName V128LoadType64Splat // V128LoadType32zero corresponds to wasm.OpcodeVecV128Load32zeroName V128LoadType32zero // V128LoadType64zero corresponds to wasm.OpcodeVecV128Load64zeroName V128LoadType64zero )