std: export ceil builtins in stage2

This commit is contained in:
Jakub Konka 2022-02-22 14:02:23 +01:00
parent 1bbb886694
commit a94267b290
2 changed files with 19 additions and 13 deletions

View File

@ -46,6 +46,10 @@ 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 });
}
// Avoid dragging in the runtime safety mechanisms into this .o file,
@ -179,3 +183,18 @@ fn log10(a: f64) callconv(.C) f64 {
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);
}

View File

@ -613,19 +613,6 @@ export fn fmod(x: f64, y: f64) f64 {
return generic_fmod(f64, x, y);
}
export fn ceilf(x: f32) f32 {
return math.ceil(x);
}
export fn ceil(x: f64) f64 {
return math.ceil(x);
}
export fn ceill(x: c_longdouble) c_longdouble {
if (!long_double_is_f128) {
@panic("TODO implement this");
}
return math.ceil(x);
}
export fn fmaf(a: f32, b: f32, c: f32) f32 {
return math.fma(f32, a, b, c);
}