authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-04-25 17:49:56-07:00
committergravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-04-25 19:38:59-07:00
log28c05b0a53e451cbe06d321f4e2f92cf3b1a7be4
treee07b0138eab0bba8f4fc91040fe7108c0802449c
parent96d86e346517b1917165b6f817b2147524a9a0b5

compiler_rt: Bypass `fmodx` impl. on stage2

This function is codegen'd incorrectly in stage2, since it fails to generate the correct soft-float operations. This will be fixed once issue #11161 is implemented

1 files changed, 12 insertions(+), 1 deletions(-)

lib/std/special/compiler_rt.zig+12-1
......@@ -731,8 +731,13 @@ comptime {
731731 @export(fmodx, .{ .name = "fmodl", .linkage = linkage });
732732 } else if (long_double_is_f128) {
733733 @export(fmodq, .{ .name = "fmodl", .linkage = linkage });
734 } else {
735 @export(fmodl, .{ .name = "fmodl", .linkage = linkage });
736 }
737 if (long_double_is_f80 or builtin.zig_backend == .stage1) {
738 // TODO: https://github.com/ziglang/zig/issues/11161
739 @export(fmodx, .{ .name = "fmodx", .linkage = linkage });
734740 }
735 @export(fmodx, .{ .name = "fmodx", .linkage = linkage });
736741 @export(fmodq, .{ .name = "fmodq", .linkage = linkage });
737742
738743 @export(floorf, .{ .name = "floorf", .linkage = linkage });
......@@ -889,6 +894,12 @@ fn ceill(x: c_longdouble) callconv(.C) c_longdouble {
889894
890895const fmodq = @import("compiler_rt/fmodq.zig").fmodq;
891896const fmodx = @import("compiler_rt/fmodx.zig").fmodx;
897fn fmodl(x: c_longdouble, y: c_longdouble) callconv(.C) c_longdouble {
898 if (!long_double_is_f128) {
899 @panic("TODO implement this");
900 }
901 return @floatCast(c_longdouble, fmodq(x, y));
902}
892903
893904// Avoid dragging in the runtime safety mechanisms into this .o file,
894905// unless we're trying to test this file.