add compiler_rt ceilf/ceil/ceill

this should fix stage1 build error with msvc 2019
This commit is contained in:
jagt 2022-03-20 20:52:43 +08:00 committed by Andrew Kelley
parent 9f25c8140c
commit b7f4045184

View File

@ -680,6 +680,10 @@ comptime {
@export(floor, .{ .name = "floor", .linkage = linkage });
@export(floorl, .{ .name = "floorl", .linkage = linkage });
@export(ceilf, .{ .name = "ceilf", .linkage = linkage });
@export(ceil, .{ .name = "ceil", .linkage = linkage });
@export(ceill, .{ .name = "ceill", .linkage = linkage });
@export(fma, .{ .name = "fma", .linkage = linkage });
@export(fmaf, .{ .name = "fmaf", .linkage = linkage });
@export(fmal, .{ .name = "fmal", .linkage = linkage });
@ -811,6 +815,19 @@ fn floorl(x: c_longdouble) callconv(.C) c_longdouble {
return math.floor(x);
}
fn ceilf(x: f32) callconv(.C) f32 {
return math.ceil(x);
}
fn ceil(x: f64) callconv(.C) f64 {
return math.ceil(x);
}
fn ceill(x: c_longdouble) callconv(.C) c_longdouble {
if (!long_double_is_f128) {
@panic("TODO implement this");
}
return math.ceil(x);
}
// Avoid dragging in the runtime safety mechanisms into this .o file,
// unless we're trying to test this file.
pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {