Merge pull request #11241 from jagt/master

add compiler_rt ceilf/ceil/ceill
This commit is contained in:
Andrew Kelley
2022-03-21 02:22:07 -04:00
committed by GitHub
2 changed files with 17 additions and 19 deletions

View File

@@ -83,10 +83,6 @@ comptime {
@export(log10, .{ .name = "log10", .linkage = .Strong });
@export(log10f, .{ .name = "log10f", .linkage = .Strong });
@export(ceil, .{ .name = "ceil", .linkage = .Strong });
@export(ceilf, .{ .name = "ceilf", .linkage = .Strong });
@export(ceill, .{ .name = "ceill", .linkage = .Strong });
@export(fmod, .{ .name = "fmod", .linkage = .Strong });
@export(fmodf, .{ .name = "fmodf", .linkage = .Strong });
@@ -429,21 +425,6 @@ fn log10f(a: f32) callconv(.C) f32 {
return math.log10(a);
}
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);
}
fn fmodf(x: f32, y: f32) callconv(.C) f32 {
return generic_fmod(f32, x, y);
}

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 {