Commit 2c5f54c898

Alex Rønne Petersen <alex@alexrp.com>
2025-04-28 12:02:15
compiler-rt: Add missing _Qp_sqrt export for sparc64.
https://github.com/ziglang/zig/issues/23716
1 parent fc55c1b
Changed files (1)
lib
compiler_rt
lib/compiler_rt/sqrt.zig
@@ -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),