The narrow_i32x4_u SIMD conversion instruction converts two signed v128 i32x4 value interpretations into an i16x8 value interpretation using unsigned saturation (clamping to the range between 0 to 65,535).
(module
(import "console" "log" (func $log (param i32)))
(func $main
v128.const i32x4 200 210 220 230
v128.const i32x4 300 310 320 330
i16x8.narrow_i32x4_u
i16x8.extract_lane_s 7
call $log ;; log the result
)
(start $main)
)WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });i16x8.narrow_i32x4_u
i16x8.narrow_i32x4_uThe i16x8.narrow_i32x4_u instruction.
[input1, input2] -> [output]
input1The first input v128 i32x4 value interpretation.
input2The second input v128 i32x4 value interpretation.
outputThe output v128 i16x8 value interpretation.
| Instruction | Binary format | Example text => binary |
|---|---|---|
i16x8.narrow_i32x4_u | 0xfd 134:u32 | i16x8.narrow_i32x4_u => 0xfd 0x86 0x01 |