# compiler_rt: add \_\_absvsi2, \_\_absvdi2, \_\_absvti2 · gitcafe/zig

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

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

Visibility: public

Requested revision: 405ff911dae3ca10af380e5dd8e2dfda4a570191

Requested commit: 405ff911dae3ca10af380e5dd8e2dfda4a570191

Commit: 405ff911dae3ca10af380e5dd8e2dfda4a570191

Tree: db2c12426ecfd16a8b8511b3f9d0482a7b721386

Author: Jan Philipp Hafer

Committer: Andrew Kelley

## Message

```
compiler_rt: add __absvsi2, __absvdi2, __absvti2

- abs can only overflow, if a == MIN
- comparing the sign change from wrapping addition is branchless
- tests: MIN, MIN+1,..MIN+4, -42, -7, -1, 0, 1, 7..

See #1290

```

## Parents

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

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