# saturating arithmetic builtins: add, sub, mul, shl \(\#9619\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 21a5769afefb47553391ae1ef801f64a58253c33

Requested commit: 21a5769afefb47553391ae1ef801f64a58253c33

Commit: 21a5769afefb47553391ae1ef801f64a58253c33

Tree: 8f6d1a219c881c1fc34f839421fc000c1fe8d527

Author: travisstaloch

Committer: GitHub

## Message

```
saturating arithmetic builtins: add, sub, mul, shl (#9619)

- adds 1 simple behavior tests for each
  which does integer and vector ops at
  runtime and comptime
- adds bigint_*_sat() methods for each

- use CreateIntrinsic() which accepts a
  variable number of arguments to pass
  the scale parameter

* update langref
- added case to test/compile_errors.zig given floats

- explain upstream bug in llvm.smul.fix.sat and link to #9643 in langref and commented out test cases

* sat-arithmetic: skip mul tests if arch == .wasm32 because ci is erroring with 'LLVM ERROR: Unable to expand fixed point multiplication' when compiling for wasm32
```

## Parents

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

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