extmul_high_i8x16_s: Wasm SIMD Arithmetikinstruktion
Die extmul_high_i8x16_s SIMD-Arithmetikinstruktion nimmt die Bahnen 8–15 von zwei signierten 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_high_i8x16_s
i16x8.extract_lane_s 7
call $log ;; log the result
)
(start $main)
)
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });
Im obigen Beispiel werden die Bahnen 8–15 der beiden i8x16 Eingabewerte miteinander multipliziert und die Produkte als i16x8 ausgegeben. Die Bahn 8 des ersten Eingangs wird mit der Bahn 8 des zweiten Eingangs multipliziert, und das Produkt wird zu Bahn 0 der Ausgabe, und so weiter. Dadurch enthält jede Bahn der Ausgabe den Wert 15 (3 * 5).
Die extmul_high_i8x16_s-Instruktion ist eine leistungsfähigere Alternative zum Übergeben der Ergebnisse von zwei extend_high_i8x16_s Instruktionen in eine mul Instruktion.
Mit anderen Worten:
(i16x8.extmul_high_i8x16_s
(input1)
(input2)
)
ist gleichwertig zu
(i16x8.mul
(i16x8.extend_high_i8x16_s
(input1)
)
(i16x8.extend_high_i8x16_s
(input2)
)
)
Syntax
i16x8.extmul_high_i8x16_s
i16x8.extmul_high_i8x16_s-
Die
i16x8.extmul_high_i8x16_sInstruktion.
Typ
[input1, input2] -> [output]
Binärcodierung
| Instruktion | Binärformat | Beispiel Text => Binär |
|---|---|---|
i16x8.extmul_high_i8x16_s |
0xfd 157:u32 |
i16x8.extmul_high_i8x16_s => 0xfd 0x9d 0x01 |
Spezifikationen
| Spezifikation |
|---|
| WebAssembly Core Specification> # vector-instructions%E2%91%A8> |