extmul_high_i8x16_u: Wasm SIMD Arithmetikinstruktion
Die extmul_high_i8x16_u SIMD Arithmetikinstruktion nimmt die Lanes 8–15 von zwei unsigned v128 i8x16-Wertinterpretationen, multipliziert die Werte in den entsprechenden Lanes und gibt das Ergebnis dieser Operationen als i16x8-Wertinterpretation aus.
Probieren Sie es aus
(module
(import "console" "log" (func $log (param i32)))
(func $main
v128.const i8x16 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3
v128.const i8x16 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5
i16x8.extmul_high_i8x16_u
i16x8.extract_lane_s 7
call $log ;; log the result
)
(start $main)
)
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
Im obigen Beispiel werden die Lanes 8–15 der beiden i8x16-Eingabewerte miteinander multipliziert und die Produkte als i16x8 ausgegeben. Lane 8 des ersten Eingangs wird mit Lane 8 des zweiten Eingangs multipliziert, und das Produkt wird zu Lane 0 des Ausgangs und so weiter. Dadurch enthält jede Lane des Ausgangs den Wert 15 (3 * 5).
Die extmul_high_i8x16_u-Instruktion ist eine performantere Entsprechung zur Übergabe der Ergebnisse von zwei extend_high_i8x16_u-Instruktionen in eine mul-Instruktion.
Mit anderen Worten:
(i16x8.extmul_high_i8x16_u
(input1)
(input2)
)
entspricht
(i16x8.mul
(i16x8.extend_high_i8x16_u
(input1)
)
(i16x8.extend_high_i8x16_u
(input2)
)
)
Syntax
i16x8.extmul_high_i8x16_u
i16x8.extmul_high_i8x16_u-
Die
i16x8.extmul_high_i8x16_u-Instruktion.
Typ
[input1, input2] -> [output]
Binärcodierung
| Instruktion | Binärformat | Beispiels-Text => Binär |
|---|---|---|
i16x8.extmul_high_i8x16_u |
0xfd 159:u32 |
i16x8.extmul_high_i8x16_u => 0xfd 0x9f 0x01 |
Spezifikationen
| Spezifikation |
|---|
| WebAssembly Core Specification> # vector-instructions%E2%91%A8> |