# compiler_rt: add \_\_negvsi2, \_\_negvdi2, \_\_negvti2 · gitcafe/zig

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

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

Visibility: public

Requested revision: 17046674a745faaa34cf2646b9cf43455b12aba9

Requested commit: 17046674a745faaa34cf2646b9cf43455b12aba9

Commit: 17046674a745faaa34cf2646b9cf43455b12aba9

Tree: 0826d357cbfedea2e0b5309b1316b2ea731d1dbf

Author: Jan Philipp Hafer

Committer: Andrew Kelley

## Message

```
compiler_rt: add __negvsi2, __negvdi2, __negvti2

- neg can only overflow, if a == MIN
- case `-0` is properly handled by hardware, so overflow check by comparing
  `a == MIN` is sufficient
- tests: MIN, MIN+1, MIN+4, -42, -7, -1, 0, 1, 7..

See #1290

```

## Parents

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

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