# spirv: wrap strange its before instead of after operation · gitcafe/zig

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

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

Visibility: public

Requested revision: 54ec9365498635aa127ff13dfbdd3942890b53d0

Requested commit: 54ec9365498635aa127ff13dfbdd3942890b53d0

Commit: 54ec9365498635aa127ff13dfbdd3942890b53d0

Tree: a6df4f0650bc8972746fa4c1636ee55af4143fef

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
spirv: wrap strange its before instead of after operation

Wrapping strange integers before an operation was initially
done as an attempt to minimize the amount of normalizations
required: This way, there would not be a normalization
necessary between two modular operations. This was a
premature optimization, since the resulting logic is more
complicated than naive way of wrapping the result after
the operation.

This commit updates handling of strange integers to do
wrapping after each operation. It also seems slightly
more efficient in terms of size of generated code, as
it reduces the size of the behavior tests binary by
about 1%.

```

## Parents

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

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