a5061ecec5
An effort was started some time ago to consolidate all internal documentation in the git tree. However, this was just an accumulation of files in various formats without any strucutre or way to browse it, which results in no one even knowing that we have docs here. This converts most of the files to restructuredtext and uses Sphinx to generate an HTML browsable user manual (with a table of content and a first attempt to put things in a global hierarchy). There are almost no changes to the documentation content in this commit (some obviously obsolete things were removed). The plan is to get the toolchain up and running to make these docs easily available, and only then see about improving the content. We can migrate some things off the wiki and website, and rework the table of contents to have some more hierarchy levels because currently it's a bit messy. Change-Id: I924ac9dc6e753887ab56f18a09bdb0a1e1793bfd Reviewed-on: https://review.haiku-os.org/c/haiku/+/4370 Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
55 lines
1.6 KiB
ReStructuredText
55 lines
1.6 KiB
ReStructuredText
Notes on long double support
|
|
============================
|
|
|
|
The “long double” type is different on each architecture. Depending on
|
|
the available hardware and ABI conventions, performance compromises,
|
|
etc, there may be many implementations of it. Here is a summary for our
|
|
convenience.
|
|
|
|
128-bit IEEE
|
|
------------
|
|
|
|
Platforms: Sparc, ARM64, RISC-V
|
|
|
|
This is the standard long double type from IEEE754. It has 1 sign bit,
|
|
15 exponent bit, and 112 fractional part bits. It is the natural
|
|
extension of the 64bit double.
|
|
|
|
Sparc specifies this type in their ABI but no implementation actually
|
|
has the instructions, they instead trigger a trap which would software
|
|
emulate them. However, gcc short circuits this by default and calls C
|
|
library support functions directly.
|
|
|
|
.. _bit-ieee-1:
|
|
|
|
64-bit IEEE
|
|
-----------
|
|
|
|
Platforms: ARM
|
|
|
|
This is the same representation as plain “double”. ARM uses this for
|
|
simplicity.
|
|
|
|
80-bit
|
|
------
|
|
|
|
Platform: x86, x86_64, m68k
|
|
|
|
This intermediate format is used by x86 CPUs internally. It may end up
|
|
being faster than plain double there. It consists of a 64bit fractional
|
|
part, 15 exponent bits, and 1 sign bit. This is convenient because the
|
|
fractional part is a relatively easy to handle 64bit number.
|
|
|
|
m68k uses a similar format, but padded to 96 bits (the extra 16 bits are
|
|
unused).
|
|
|
|
double double
|
|
-------------
|
|
|
|
Platforms: PowerPC?
|
|
|
|
This is also a 128bit type, but the representation is just two 64bit
|
|
doubles. The value is the sum of the two halves. This format allows
|
|
faster emulation than a “true” 128bit long double, and the precision is
|
|
almost as good.
|