# wasm: \`splat\` for vector elements divisible by 8 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/355b5929b2c49422b92e7aa7374c7e4f0008f400)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 355b5929b2c49422b92e7aa7374c7e4f0008f400

Requested commit: 355b5929b2c49422b92e7aa7374c7e4f0008f400

Commit: 355b5929b2c49422b92e7aa7374c7e4f0008f400

Tree: 3a191aa6206f967e497e256dd7562c6b5ac985dc

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: `splat` for vector elements divisible by 8

This implements `@splat` for vectors where the element type is
divisible by 8 and a power of two. This is fairly simple as we can
store the values directly within the virtual stack. But for
all other sizes, we must first shift and bitwise-or the values
before we can store them to fit them like a packed-struct, rather
than an array.

```

## Parents

- [c6d654f73bbe80ed3653be6a31ddcaa4772a4fe2](https://git.cafe/gitcafe/zig/commit/c6d654f73bbe80ed3653be6a31ddcaa4772a4fe2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/355b5929b2c49422b92e7aa7374c7e4f0008f400?format=markdown)
