dot_i16x8_s: Wasm SIMD arithmetic instruction
The doti16x8s SIMD arithmetic instruction performs a dot product calculation on two signed v128 i16x8 value interpretations. The corresponding lanes of the input values are multiplied together, then each adjacent pair of products are added together. The four results of these additions are output as an i32x4 value interpretation.
The **`dot_i16x8_s`** [SIMD arithmetic instruction](/docs/WebAssembly/Reference/SIMD/arithmetic) performs a [dot product](https://en.wikipedia.org/wiki/Dot_product) calculation on two signed [`v128`](/docs/WebAssembly/Reference/Value_types/v128) `i16x8` value interpretations. The corresponding lanes of the input values are multiplied together, then each adjacent pair of products are added together. The four results of these additions are output as an `i32x4` value interpretation.
tabbed-taller
```wat interactive-example
(module
(import "console" "log" (func $log (param i32)))
(func $main
v128.const i16x8 4 6 16 8 23 65 82 9
v128.const i16x8 0 25 2 30 2 34 45 80
i32x4.dot_i16x8_s
i32x4.extract_lane 3
call $log ;; log the result
)
(start $main)
)
```
```js interactive-example
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
```
In the above example, the corresponding lanes of each input are multiplied together to create eight intermediate values:
```plain
input1 4 6 16 8 23 65 82 9
input2 0 25 2 30 2 34 45 80
product 0 150 32 240 46 2210 3690 720
```
Each adjacent pair of products is then added, and the result output onto the stack as an `i32x4` containing the following values:
```plain
150 272 2256 4410
```
## Syntax
```plain
i32x4.dot_i16x8_s
```
- `i32x4.dot_i16x8_s`
- : The `i32x4.dot_i16x8_s` instruction.
### Type
```plain
[input1, input2] -> [output]
```
- `input1`
- : The first input `v128` `i16x8` value interpretation.
- `input2`
- : The second input `v128` `i16x8` value interpretation.
- `output`
- : The output `v128` `i32x4` value interpretation.
### Binary encoding
| Instruction | Binary format | Example text => binary |
| ------------------- | -------------- | --------------------------------------- |
| `i32x4.dot_i16x8_s` | `0xfd 186:u32` | `i32x4.dot_i16x8_s` => `0xfd 0xba 0x01` |
## Specifications
## Browser compatibility
Cite this
"dot_i16x8_s: Wasm SIMD arithmetic instruction". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/SIMD/arithmetic/dot_i16x8_s JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy