# compiler_rt: add \_\_paritysi2, \_\_paritydi2, \_\_parityti2 · gitcafe/zig

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

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

Visibility: public

Requested revision: e4c053f04737d852766b6577e7b1fbfb4a8a3096

Requested commit: e4c053f04737d852766b6577e7b1fbfb4a8a3096

Commit: e4c053f04737d852766b6577e7b1fbfb4a8a3096

Tree: 9bef4ca4a82acdd0336808617fa0033b76420967

Author: Jan Philipp Hafer

Committer: Andrew Kelley

## Message

```
compiler_rt: add __paritysi2, __paritydi2, __parityti2

- use Bit Twiddling Hacks: Compute parity in parallel
- test cases derived from popcount.zig
- tests: compare naive approach 10_000 times with random numbers created
  from naive seed 42
- compiler_rt.zig: sort by LLVM builtin order and add comments to improve structure

See #1290

```

## Parents

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

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