# compiler_rt: add \_\_bswapsi2, \_\_bswapdi2 and \_\_bswapti2 · gitcafe/zig

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

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

Visibility: public

Requested revision: efdb94486b78fa143f8d684609cb4c5d3de10124

Requested commit: efdb94486b78fa143f8d684609cb4c5d3de10124

Commit: efdb94486b78fa143f8d684609cb4c5d3de10124

Tree: 23aa9a69b88c421ac03e94f1e6184a99abaeac50

Author: Jan Philipp Hafer

Committer: Andrew Kelley

## Message

```
compiler_rt: add __bswapsi2, __bswapdi2 and __bswapti2

- each byte gets masked, shifted and combined
- use boring masks instead of comptime for readability
- tests: bit patterns with reverse operation, if applicable

See #1290

```

## Parents

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

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