GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

load32x2_s: Wasm SIMD load/store instruction

The load32x2s SIMD load/store instruction loads two 32-bit integers from a given memory address and sign extends each one to a 64-bit lane, outputting a v128 type i64x2 value interpretation.

The **`load32x2_s`** [SIMD load/store instruction](/docs/WebAssembly/Reference/SIMD/load_store) loads two 32-bit integers from a given memory address and sign extends each one to a 64-bit lane, outputting a [`v128`](/docs/WebAssembly/Reference/Value_types/v128) type `i64x2` value interpretation.

tabbed-taller

```wat interactive-example
(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.load32x2_s
i64x2.extract_lane 1
call $log
)
(start $main)
)
```

```js interactive-example
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
```

## Syntax

```plain
;; Common usage
v128.load32x2_s

;; With optional immediate operands
v128.load32x2_s mem_idx offset=int align=int
```

- `v128.load32x2_s`
- : The `v128.load32x2_s` instruction.
- `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 memory address before loading. 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 `1` and the default and maximum value is `8`. An `align` value has to be a power of `2`.

### Type

```plain
[memory_address] -> [output]
```

- `memory_address`
- : An integer representing the memory address to load from.
- `output`
- : The output `v128` type `i64x2` value interpretation.

### Binary encoding

| Instruction | Binary format | Example text => binary |
| ----------------- | -------------------------------------------- | ------------------------------------------------------------- |
| `v128.load32x2_s` | `0xFD 5:u32 mem_idx:u8 offset:u32 align:u32` | `v128.load32x2_s 0 offset=0 align=8` => `0xfd 0x05 0x03 0x00` |

> [!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`).

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"load32x2_s: Wasm SIMD load/store instruction". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/SIMD/load_store/load32x2_s

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·