mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
The purpose of this branch is to switch to using an object file for each independent function, in order to make linking simpler - instead of relying on `-ffunction-sections` and `--gc-sections`, which involves the linker doing the work of linking everything and then undoing work via garbage collection, this will allow the linker to only include the compilation units that are depended on in the first place. This commit makes progress towards that goal.
21 lines
524 B
Zig
21 lines
524 B
Zig
const common = @import("./common.zig");
|
|
const intToFloat = @import("./int_to_float.zig").intToFloat;
|
|
|
|
pub const panic = common.panic;
|
|
|
|
comptime {
|
|
if (common.want_ppc_abi) {
|
|
@export(__floatdikf, .{ .name = "__floatdikf", .linkage = common.linkage });
|
|
} else {
|
|
@export(__floatditf, .{ .name = "__floatditf", .linkage = common.linkage });
|
|
}
|
|
}
|
|
|
|
fn __floatditf(a: i64) callconv(.C) f128 {
|
|
return intToFloat(f128, a);
|
|
}
|
|
|
|
fn __floatdikf(a: i64) callconv(.C) f128 {
|
|
return intToFloat(f128, a);
|
|
}
|