The extadd_pairwise_i16x8_u SIMD arithmetic instruction adds each adjacent pair of lanes of an unsigned v128 i16x8 value interpretation, outputting the results into an i32x4 value interpretation.
(module
(import "console" "log" (func $log (param i32)))
(func $main
v128.const i16x8 20 40 20 40 20 40 20 40
i32x4.extadd_pairwise_i16x8_u
i32x4.extract_lane 3
call $log ;; log the result
)
(start $main)
)WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });In the above example, each adjacent pair of lanes contains the values 20 and 40. The extadd_pairwise_i16x8_u instruction adds each pair together, resulting in the 4 lanes of the output i32x4 value all containing the value 60.
i32x4.extadd_pairwise_i16x8_u
i32x4.extadd_pairwise_i16x8_uThe i32x4.extadd_pairwise_i16x8_u instruction.
[input] -> [output]
inputThe input v128 i16x8 value interpretation.
outputThe output v128 i32x4 value interpretation.
| Instruction | Binary format | Example text => binary |
|---|---|---|
i32x4.extadd_pairwise_i16x8_u | 0xfd 127:u32 | i32x4.extadd_pairwise_i16x8_u => 0xfd 0x7f |