Files
WrldBox/.tmp_zig/lib/zig/compiler_rt/subdf3.zig
swim67667 c17dfc94ce
Some checks failed
Build Project / build (ubuntu-latest) (push) Failing after 12m33s
added multi-compiling stuff (only works on my mac for now)
2026-06-28 16:40:20 -04:00

25 lines
623 B
Zig

const compiler_rt = @import("../compiler_rt.zig");
const addf3 = @import("./addf3.zig").addf3;
const symbol = @import("../compiler_rt.zig").symbol;
comptime {
if (compiler_rt.want_aeabi) {
symbol(&__aeabi_dsub, "__aeabi_dsub");
} else {
symbol(&__subdf3, "__subdf3");
}
}
fn __subdf3(a: f64, b: f64) callconv(.c) f64 {
return sub(a, b);
}
fn __aeabi_dsub(a: f64, b: f64) callconv(.{ .arm_aapcs = .{} }) f64 {
return sub(a, b);
}
inline fn sub(a: f64, b: f64) f64 {
const neg_b = @as(f64, @bitCast(@as(u64, @bitCast(b)) ^ (@as(u64, 1) << 63)));
return addf3(f64, a, neg_b);
}