extmul_low_i8x16_u: Wasm SIMD Arithmetikinstruktion
Die extmul_low_i8x16_u SIMD Arithmetikinstruktion nimmt die Bahnen 0–7 von zwei unsignierten v128 i8x16-Wertinterpretationen, multipliziert die Werte in den entsprechenden Bahnen und gibt das Ergebnis dieser Operationen in einer 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_low_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 Bahnen 0–7 der beiden i8x16-Eingangswerte miteinander multipliziert und die Produkte als i16x8 ausgegeben. Bahn 0 des ersten Eingangs wird mit Bahn 0 des zweiten Eingangs multipliziert, und das Produkt wird zu Bahn 0 der Ausgabe, und so weiter. Als Ergebnis enthält jede Bahn der Ausgabe den Wert 8 (2 * 4).
Die extmul_low_i8x16_u-Instruktion ist eine leistungsfähigere Entsprechung zum Durchreichen der Ergebnisse von zwei extend_low_i8x16_u Instruktionen in eine mul Instruktion.
Mit anderen Worten:
(i16x8.extmul_low_i8x16_u
(input1)
(input2)
)
entspricht
(i16x8.mul
(i16x8.extend_low_i8x16_u
(input1)
)
(i16x8.extend_low_i8x16_u
(input2)
)
)
Syntax
i16x8.extmul_low_i8x16_u
i16x8.extmul_low_i8x16_u-
Die
i16x8.extmul_low_i8x16_u-Instruktion.
Typ
[input1, input2] -> [output]
Binärcodierung
| Instruktion | Binärformat | Beispieltext => binär |
|---|---|---|
i16x8.extmul_low_i8x16_u |
0xfd 158:u32 |
i16x8.extmul_low_i8x16_u => 0xfd 0x9e 0x01 |
Spezifikationen
| Spezifikation |
|---|
| WebAssembly Core Specification> # vector-instructions%E2%91%A8> |