Support for PowerPC's "double-double" format for long double
#20579
Labels
arch-powerpc
32-bit and 64-bit Power ISA
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Per #10639,
f80
was added partially for Clong 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 likef80
, 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 forlong double
, but to date, this seems to have only manifested onpowerpc64le
(being a relatively recent target where breaking the world wasn't a huge concern) and for musl (musl requires thatlong 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
? Might also be worth considering renamingf80
while we're at it.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. Clang, on the other hand, will happily do it but sometimes get wrong results due to the incompleteAPFloat
support.cc @Vexu because I imagine this would also affect Aro on PowerPC in the same way that
f80
did.The text was updated successfully, but these errors were encountered: