You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for PowerPC's "double-double" format for long double #20579
arch-powerpc32-bit Power ISAarch-powerpc6464-bit Power ISAproposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.
Per #10639, f80 was added partially for C long double compatibility and partially to aid the development of Aro.
We need to consider whether Zig should also have language support for the "double-double" format seen on PowerPC systems for long double. Much like f80, this is a legacy format that only really sees use for compatibility reasons. There has been an effort to migrate PowerPC systems to use IEEE binary128 for long double, but to date, this seems to have only manifested on powerpc64le (being a relatively recent target where breaking the world wasn't a huge concern) and for musl (musl requires that long double is IEEE binary64 on all PowerPC targets). In other words, I believe that any big-endian PowerPC system that isn't using musl is still using the "double-double" format.
The Zig type name for this obviously can't be f128 as that's already an IEEE type. f128_ppc? f64_64? f128p (for "paired")?
Note that I'm not aware of a complete and correct soft float implementation for this format that is liberally licensed. There is a soft float implementation for it in libgcc, but I have no idea how complete or correct it is, and again, there's the license issue to consider. Also, LLVM's APFloat is known to produce wrong results for this format in quite a few ways, despite nominally supporting it.
It's interesting to note that GCC just categorically refuses to constant-fold long double values when targeting PowerPC systems with the "double-double" format, to the point of violating the C/C++ standards. Clang, on the other hand, will happily do it but sometimes get wrong results due to the incomplete APFloat support.
cc @Vexu because I imagine this would also affect Aro on PowerPC in the same way that f80 did.
Correction to what I wrote: Apparently only Fedora has made the transition to binary128 long double by default on powerpc64le. Debian/Ubuntu seem to still be using the old format. So, it's unfortunately not quite as "legacy" as one might have hoped.
arch-powerpc32-bit Power ISAarch-powerpc6464-bit Power ISAproposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.
Activity
alexrp commentedon Jul 15, 2024
Correction to what I wrote: Apparently only Fedora has made the transition to binary128
long doubleby default onpowerpc64le. Debian/Ubuntu seem to still be using the old format. So, it's unfortunately not quite as "legacy" as one might have hoped.alexrp commentedon Jan 23, 2026
https://codeberg.org/ziglang/zig/issues/30976