diff options
| author | Jan Philipp Hafer <jan.hafer@rwth-aachen.de> | 2021-12-11 04:26:16 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-14 14:14:31 -0800 |
| commit | c56663dee8b0043eba214562765b973aebfa7185 (patch) | |
| tree | f7ecf57779b5ba37f3744446383bd99529a260f2 /lib/std/special/compiler_rt.zig | |
| parent | 50201e1c30e0d71bafd643e9804d55eceb7b3542 (diff) | |
| download | zig-c56663dee8b0043eba214562765b973aebfa7185.tar.gz zig-c56663dee8b0043eba214562765b973aebfa7185.zip | |
compiler_rt: add __negsi2, __negdi2, __negti2
- use negXi2.zig to prevent confusion with negXf2.zig
- used for size optimized builds and machines without carry instruction
- tests: special cases 0, -INT_MIN
* use divTrunc range and shift with constant offsets
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 95edfee861..e9f422be59 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -382,6 +382,12 @@ comptime { } // Integral arithmetic + const __negsi2 = @import("compiler_rt/negXi2.zig").__negsi2; + @export(__negsi2, .{ .name = "__negsi2", .linkage = linkage }); + const __negdi2 = @import("compiler_rt/negXi2.zig").__negdi2; + @export(__negdi2, .{ .name = "__negdi2", .linkage = linkage }); + const __negti2 = @import("compiler_rt/negXi2.zig").__negti2; + @export(__negti2, .{ .name = "__negti2", .linkage = linkage }); const __mulsi3 = @import("compiler_rt/int.zig").__mulsi3; @export(__mulsi3, .{ .name = "__mulsi3", .linkage = linkage }); const __muldi3 = @import("compiler_rt/muldi3.zig").__muldi3; |
