Creates a new vector by repeating the given operand value for each lane and places the new vector on the stack 1
There are 6 opcodes, to indicate the size of the operand and shape of the resulting vector
Opcode | Instruction | Stack Arity |
---|---|---|
0xFD 15 |
i8x16.splat |
|
0xFD 16 |
i16x8.splat |
|
0xFD 17 |
i32x4.splat |
|
0xFD 18 |
i64x2.splat |
|
0xFD 19 |
f32x4.splat |
|
0xFD 20 |
f64x2.splat |
;; Place a value (10) on the stack to be the repeated operand
i32.const 10
i8x16.splat
;; Resulting vector contains the operand value (10) repeated in
;; each lane, i.e.
;; [ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 ]
Footnotes
-
WebAssembly Core Specification, Execution, Vector Instructions, shape.splat - https://webassembly.github.io/spec/core/bikeshed/#-hrefsyntax-shapemathitshapemathsfhrefsyntax-instr-vecmathsfsplat%E2%91%A0 ↩