authorgravatar for jagt@live.comjagt <jagt@live.com> 2022-03-20 20:52:43+08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-20 13:29:23-07:00
logb7f40451844caa81f8ecb233c68777f06232d94c
treee29fbbf2e7a95f265b732e7dc8274c988f57fbc4
parent9f25c8140cb859fcea7023362afcb29b1e4df41f

add compiler_rt ceilf/ceil/ceill

this should fix stage1 build error with msvc 2019

1 files changed, 17 insertions(+), 0 deletions(-)

lib/std/special/compiler_rt.zig+17
...@@ -680,6 +680,10 @@ comptime {...@@ -680,6 +680,10 @@ comptime {
680 @export(floor, .{ .name = "floor", .linkage = linkage });680 @export(floor, .{ .name = "floor", .linkage = linkage });
681 @export(floorl, .{ .name = "floorl", .linkage = linkage });681 @export(floorl, .{ .name = "floorl", .linkage = linkage });
682682
683 @export(ceilf, .{ .name = "ceilf", .linkage = linkage });
684 @export(ceil, .{ .name = "ceil", .linkage = linkage });
685 @export(ceill, .{ .name = "ceill", .linkage = linkage });
686
683 @export(fma, .{ .name = "fma", .linkage = linkage });687 @export(fma, .{ .name = "fma", .linkage = linkage });
684 @export(fmaf, .{ .name = "fmaf", .linkage = linkage });688 @export(fmaf, .{ .name = "fmaf", .linkage = linkage });
685 @export(fmal, .{ .name = "fmal", .linkage = linkage });689 @export(fmal, .{ .name = "fmal", .linkage = linkage });
...@@ -811,6 +815,19 @@ fn floorl(x: c_longdouble) callconv(.C) c_longdouble {...@@ -811,6 +815,19 @@ fn floorl(x: c_longdouble) callconv(.C) c_longdouble {
811 return math.floor(x);815 return math.floor(x);
812}816}
813817
818fn ceilf(x: f32) callconv(.C) f32 {
819 return math.ceil(x);
820}
821fn ceil(x: f64) callconv(.C) f64 {
822 return math.ceil(x);
823}
824fn ceill(x: c_longdouble) callconv(.C) c_longdouble {
825 if (!long_double_is_f128) {
826 @panic("TODO implement this");
827 }
828 return math.ceil(x);
829}
830
814// Avoid dragging in the runtime safety mechanisms into this .o file,831// Avoid dragging in the runtime safety mechanisms into this .o file,
815// unless we're trying to test this file.832// unless we're trying to test this file.
816pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {833pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {