compiler-rt: Add missing _Qp_sqrt export for sparc64.

https://github.com/ziglang/zig/issues/23716
This commit is contained in:
Alex Rønne Petersen 2025-04-28 12:02:15 +02:00
parent fc55c1b7a1
commit 2c5f54c898
No known key found for this signature in database

View file

@ -13,6 +13,8 @@ comptime {
@export(&__sqrtx, .{ .name = "__sqrtx", .linkage = common.linkage, .visibility = common.visibility });
if (common.want_ppc_abi) {
@export(&sqrtq, .{ .name = "sqrtf128", .linkage = common.linkage, .visibility = common.visibility });
} else if (common.want_sparc_abi) {
@export(&_Qp_sqrt, .{ .name = "_Qp_sqrt", .linkage = common.linkage, .visibility = common.visibility });
}
@export(&sqrtq, .{ .name = "sqrtq", .linkage = common.linkage, .visibility = common.visibility });
@export(&sqrtl, .{ .name = "sqrtl", .linkage = common.linkage, .visibility = common.visibility });
@ -242,6 +244,10 @@ pub fn sqrtq(x: f128) callconv(.c) f128 {
return sqrt(@floatCast(x));
}
fn _Qp_sqrt(c: *f128, a: *f128) callconv(.c) void {
c.* = sqrt(@floatCast(a.*));
}
pub fn sqrtl(x: c_longdouble) callconv(.c) c_longdouble {
switch (@typeInfo(c_longdouble).float.bits) {
16 => return __sqrth(x),