SAOC LLDB D integration: 15th Weekly Update
Iain Buclaw
ibuclaw at gdcproject.org
Fri Dec 31 17:03:15 UTC 2021
On Friday, 31 December 2021 at 03:55:40 UTC, Luís Ferreira wrote:
> Right now, there is no way and it seems there is no intention
> to distiguish
> target-specific floating point formats on DWARF, because
> according to them,
> this should be specified on the target ABI. But what if the ABI
> doesn't specify
> this behaviour? We should at least have a way to distiguish
> IEEE interchangable
> format and non-interchangable formats, like 128-bit x86 SSE
> floating points.
>
> Fortunately, we don't have to worry much about this, since we
> don't use 128-bit
> in any of D implementation, although our spec say:
>
We do support native 128-bit floats in D, unless you meant in the
compiler implementation, in which case, all native floats (not
just real) are banned throughout the compiler.
> real: largest floating point size available
>
> Implementation Defined: The real floating point type has at
> least the range
> and precision of the double type. On x86 CPUs it is often
> implemented as
> the 80 bit Extended Real type supported by the x86 FPU.
>
> This is wrong, because, AFAIK, on x86-64 System V ABI, 128-bit
> floating point
> is the largest available, since AMD64 CPUs are required to have
> at least SSE
> extensions, which have support for 128-bit XMM registers to
> perform
> floating-point operations.
>
> So, LDC and DMD generates binaries with System V as target ABI
> but uses x87 FPU
> instead of SSE for `real`, which means they are out of spec?
>
> Anyway, according to Mathias and as I suggested, the simple way
> to do this is
> to hardcode this according the target triple and the DWARF type
> name, but I
> think this can be problematic for either when we support
> 128-bit floats or when
> the ABI doesn't specify the floating point encoding format.
>
> That said, I would like to have some thoughts on this,
> specially if someone
> knows if there is any special case for certain targets and how
> DMD/LDC/GDC
> interprets the D spec and target ABI spec.
>
Just have that `real` map to C `long double` and be done with it,
even if the hardware may support a bigger float. You don't want
to be incompatible with the system you're running on, else you'll
be locked out of using the C math library.
More information about the Digitalmars-d
mailing list