store32_lane: Wasm SIMD load/store instruction
The store32lane SIMD load/store instruction stores a specified lane of a v128 i32x4 value interpretation at a given memory address.
The store32_lane SIMD load/store instruction stores a specified lane of a v128 i32x4 value interpretation at a given memory address.
tabbed-taller
```wat interactive-example (module (import "console" "log" (func $log (param i32))) (memory $memory 1) (func $main i32.const 0 v128.const i32x4 1000 2500 4000 5500 v128.store32_lane 3
i32.const 0
v128.load
i32x4.extract_lane 0
call $log
) (start $main) )
```js interactive-example
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
Syntax
;; Common usage
v128.store32_lane lane_idx
;; With optional immediate operands
v128.store32_lane mem_idx offset=int align=int lane_idx
v128.store32_lane- : The
v128.store32_laneinstruction. mem_idx- : An integer representing the memory index, in cases where the module uses multiple memories. The default is
0. offset=int- : An integer representing a constant number of bytes to add to the address before storing. The default is
0. align=int- : 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 is4. Analignvalue has to be a power of2. lane_idx- : The index of the lane whose value you want to store.
Type
[memory_address, input] -> []
memory_address- : An integer representing the memory address to store the
inputat. input- : The
v128type from which to extract a lane value to store.
Binary encoding
| Instruction | Binary format | Example text => binary |
|---|---|---|
v128.store32_lane |
0xfd 90:u32 mem_idx:u8 offset:u32 align:u32 l:laneidx |
v128.store32_lane 0 offset=0 align=4 3 => 0xfd 0x5a 0x02 0x00 0x03 |
[!NOTE] While Wasm text format specifies the literal
alignvalue, the binary equivalent represents the exponent of the formula2^xused to calculate the alignment. So for example,align=1is equivalent to0x00(2^0), whilealign=4is equivalent to0x02(2^2).