diff options
| author | Jan Philipp Hafer <jan.hafer@rwth-aachen.de> | 2021-09-07 23:20:13 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-11 01:43:37 -0800 |
| commit | efdb94486b78fa143f8d684609cb4c5d3de10124 (patch) | |
| tree | 23aa9a69b88c421ac03e94f1e6184a99abaeac50 /lib/std/special/compiler_rt.zig | |
| parent | 97c0373fa7ee125d2d4e73f9b1dc8ea0e2c2e86a (diff) | |
| download | zig-efdb94486b78fa143f8d684609cb4c5d3de10124.tar.gz zig-efdb94486b78fa143f8d684609cb4c5d3de10124.zip | |
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
Diffstat (limited to 'lib/std/special/compiler_rt.zig')
| -rw-r--r-- | lib/std/special/compiler_rt.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index d49157ff32..95edfee861 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -263,6 +263,12 @@ comptime { @export(__popcountdi2, .{ .name = "__popcountdi2", .linkage = linkage }); const __popcountti2 = @import("compiler_rt/popcount.zig").__popcountti2; @export(__popcountti2, .{ .name = "__popcountti2", .linkage = linkage }); + const __bswapsi2 = @import("compiler_rt/bswap.zig").__bswapsi2; + @export(__bswapsi2, .{ .name = "__bswapsi2", .linkage = linkage }); + const __bswapdi2 = @import("compiler_rt/bswap.zig").__bswapdi2; + @export(__bswapdi2, .{ .name = "__bswapdi2", .linkage = linkage }); + const __bswapti2 = @import("compiler_rt/bswap.zig").__bswapti2; + @export(__bswapti2, .{ .name = "__bswapti2", .linkage = linkage }); // Integral / floating point conversion (part 1/2) const __floatsidf = @import("compiler_rt/floatsiXf.zig").__floatsidf; |
