# wasm: Improve overflow add/sub for ints \<= 64bits · gitcafe/zig

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

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

Visibility: public

Requested revision: 0a2d3d41556a3bbe836dafa5321439fa6da9b464

Requested commit: 0a2d3d41556a3bbe836dafa5321439fa6da9b464

Commit: 0a2d3d41556a3bbe836dafa5321439fa6da9b464

Tree: a9b8ee5dfd6bd4d9d32c5b8a8ec36c0c0a4d6f03

Author: Luuk de Gram

Committer: Andrew Kelley

## Message

```
wasm: Improve overflow add/sub for ints <= 64bits

The implementation for add_with_overflow and sub_with_overflow is now a lot
more robust and takes account for signed integers and arbitrary integer bitsizes.
The final output is equal to that of the LLVM backend.

```

## Parents

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

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