Files
zig/lib/compiler_rt/fixdfsi.zig
T
Andrew Kelley 04c180c8e5 compiler_rt: partial cleanup
introduce `symbol` helper function and partially migrate to using it
2026-02-09 20:04:17 +01:00

20 lines
488 B
Zig

const common = @import("./common.zig");
const intFromFloat = @import("./int_from_float.zig").intFromFloat;
const symbol = @import("../compiler_rt.zig").symbol;
comptime {
if (common.want_aeabi) {
symbol(&__aeabi_d2iz, "__aeabi_d2iz");
} else {
symbol(&__fixdfsi, "__fixdfsi");
}
}
pub fn __fixdfsi(a: f64) callconv(.c) i32 {
return intFromFloat(i32, a);
}
fn __aeabi_d2iz(a: f64) callconv(.{ .arm_aapcs = .{} }) i32 {
return intFromFloat(i32, a);
}