# fixups for \`@splat\` · gitcafe/zig

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

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

Visibility: public

Requested revision: 005a54a853a77b9c28551490fc08dc37cd7d7715

Requested commit: 005a54a853a77b9c28551490fc08dc37cd7d7715

Commit: 005a54a853a77b9c28551490fc08dc37cd7d7715

Tree: 7f13cd3b88f33f5103a5a539a37abd4f9fd1ceb1

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fixups for `@splat`

 * Fix codegen for splat - instead of giving vectors of length N
   to shufflevector for both of the operands, it gives vectors of length
   1. The mask vector is the only one that needs N elements.
 * Separate Splat into SplatSrc and SplatGen; the `len` is not needed
   once it gets to codegen since it is redundant with the result type.
 * Refactor compile error for wrong vector element type so that the
   compile error message is not duplicated in zig source code
 * Improve implementation to correctly handle comptime values such as
   undefined and lazy values.
 * Improve compile error for bad vector element type to point to the
   correct place.
 * Delete dead code.
 * Modify behavior test to use an array cast instead of vector element
   indexing since I'm merging this splat commit out-of-order from
   Shawn's patch set.

```

## Parents

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

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