narrow_i16x8_s: Wasm SIMD conversion instruction
The narrowi16x8s SIMD conversion instruction converts two signed v128 i16x8 value interpretations into an i8x16 value interpretation.
The **`narrow_i16x8_s`** [SIMD conversion instruction](/docs/WebAssembly/Reference/SIMD/conversion) converts two signed [`v128`](/docs/WebAssembly/Reference/Value_types/v128) `i16x8` value interpretations into an `i8x16` value interpretation.
tabbed-taller
```wat interactive-example
(module
(import "console" "log" (func $log (param i32)))
(func $main
v128.const i16x8 2 4 6 8 10 12 14 16
v128.const i16x8 18 20 22 24 26 28 30 32
i8x16.narrow_i16x8_s
i8x16.extract_lane_s 15
call $log ;; log the result
)
(start $main)
)
```
```js interactive-example
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
```
## Syntax
```plain
i8x16.narrow_i16x8_s
```
- `i8x16.narrow_i16x8_s`
- : The `i8x16.narrow_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` `i8x16` value interpretation.
### Binary encoding
| Instruction | Binary format | Example text => binary |
| ---------------------- | -------------- | ------------------------------------- |
| `i8x16.narrow_i16x8_s` | `0xfd 101:u32` | `i8x16.narrow_i16x8_s` => `0xfd 0x65` |
## Specifications
## Browser compatibility
Cite this
"narrow_i16x8_s: Wasm SIMD conversion instruction". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/SIMD/conversion/narrow_i16x8_s JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy