mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 00:44:32 +01:00
use the "symbol" helper function in all exports move all declarations from common.zig to compiler_rt.zig flatten the tree structure somewhat (move contents of tiny files into parent files) No functional changes.
24 lines
749 B
Zig
24 lines
749 B
Zig
const compiler_rt = @import("../compiler_rt.zig");
|
|
const extendf = @import("./extendf.zig").extendf;
|
|
const symbol = @import("../compiler_rt.zig").symbol;
|
|
|
|
comptime {
|
|
if (compiler_rt.gnu_f16_abi) {
|
|
symbol(&__gnu_h2f_ieee, "__gnu_h2f_ieee");
|
|
} else if (compiler_rt.want_aeabi) {
|
|
symbol(&__aeabi_h2f, "__aeabi_h2f");
|
|
}
|
|
symbol(&__extendhfsf2, "__extendhfsf2");
|
|
}
|
|
|
|
pub fn __extendhfsf2(a: compiler_rt.F16T(f32)) callconv(.c) f32 {
|
|
return extendf(f32, f16, @as(u16, @bitCast(a)));
|
|
}
|
|
|
|
fn __gnu_h2f_ieee(a: compiler_rt.F16T(f32)) callconv(.c) f32 {
|
|
return extendf(f32, f16, @as(u16, @bitCast(a)));
|
|
}
|
|
|
|
fn __aeabi_h2f(a: u16) callconv(.{ .arm_aapcs = .{} }) f32 {
|
|
return extendf(f32, f16, @as(u16, @bitCast(a)));
|
|
}
|