load64_lane: Wasm SIMD load instruction
The load64_lane SIMD load instruction loads a single value from a given memory address into the specified lane of a v128 type i64x2 value interpretation.
Try it
(module
(import "console" "log" (func $log (param i64)))
(memory $memory 1)
(data (i32.const 0) "\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f\00\01\02\03")
(func $main
i32.const 0
v128.const i64x2 90000000 216000
v128.load64_lane 0
i64x2.extract_lane 0
call $log
)
(start $main)
)
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
Syntax
;; Common usage v128.load64_lane laneidx ;; With optional immediates v128.load64_lane memidx offset=int align=int laneidx
v128.load64_lane-
The
v128.load64_laneinstruction. memidxOptional-
An integer representing the memory index, in cases where the module uses multiple memories. The default is
0. offset=intOptional-
An integer representing a constant number of bytes to add to the memory address before loading. The default is
0. align=intOptional-
An integer representing a hint to the Wasm engine about what alignment to expect for the final address. The minimum value is
1and the default and maximum value is8. Analignvalue has to be a power of2. laneidx-
An integer representing the index of the lane to load a value into.
Type
[memory_address, input] -> [output]
memory_address-
An integer representing the memory address to load from.
input-
The input
v128typei64x2value interpretation. output-
The output
v128typei64x2value interpretation.
Binary encoding
| Instruction | Binary format | Example text => binary |
|---|---|---|
v128.load64_lane |
0xFD 87:u32 memidx:u8 offset:u32 align:u32 laneidx:u8 |
v128.load64_lane 0 offset=0 align=8 0 => 0xfd 0x57 0x03 0x00 00x0 |
Note:
While Wasm text format specifies the literal align value, the binary equivalent represents the exponent of the formula 2^x used to calculate the alignment. So for example, align=1 is equivalent to 0x00 (2^0), while align=8 is equivalent to 0x03 (2^3).