2004-07-31 03:40:18 +02:00
|
|
|
|
Long double format
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
Each long double is made up of two IEEE doubles. The value of the
|
|
|
|
|
long double is the sum of the values of the two parts (except for
|
|
|
|
|
-0.0). The most significant part is required to be the value of the
|
|
|
|
|
long double rounded to the nearest double, as specified by IEEE. For
|
|
|
|
|
Inf values, the least significant part is required to be one of +0.0
|
|
|
|
|
or -0.0. No other requirements are made; so, for example, 1.0 may be
|
|
|
|
|
represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN
|
|
|
|
|
is don't-care.
|
|
|
|
|
|
|
|
|
|
Classification
|
|
|
|
|
--------------
|
|
|
|
|
|
|
|
|
|
A long double can represent any value of the form
|
|
|
|
|
s * 2^e * sum(k=0...105: f_k * 2^(-k))
|
|
|
|
|
where 's' is +1 or -1, 'e' is between 1022 and -968 inclusive, f_0 is
|
|
|
|
|
1, and f_k for k>0 is 0 or 1. These are the 'normal' long doubles.
|
|
|
|
|
|
|
|
|
|
A long double can also represent any value of the form
|
|
|
|
|
s * 2^-968 * sum(k=0...105: f_k * 2^(-k))
|
|
|
|
|
where 's' is +1 or -1, f_0 is 0, and f_k for k>0 is 0 or 1. These are
|
|
|
|
|
the 'subnormal' long doubles.
|
|
|
|
|
|
|
|
|
|
There are four long doubles that represent zero, two that represent
|
|
|
|
|
+0.0 and two that represent -0.0. The sign of the high part is the
|
|
|
|
|
sign of the long double, and the sign of the low part is ignored.
|
|
|
|
|
|
|
|
|
|
Likewise, there are four long doubles that represent infinities, two
|
|
|
|
|
for +Inf and two for -Inf.
|
|
|
|
|
|
|
|
|
|
Each NaN, quiet or signalling, that can be represented as a 'double'
|
|
|
|
|
can be represented as a 'long double'. In fact, there are 2^64
|
|
|
|
|
equivalent representations for each one.
|
|
|
|
|
|
|
|
|
|
There are certain other valid long doubles where both parts are
|
|
|
|
|
nonzero but the low part represents a value which has a bit set below
|
|
|
|
|
2^(e-105). These, together with the subnormal long doubles, make up
|
|
|
|
|
the denormal long doubles.
|
|
|
|
|
|
|
|
|
|
Many possible long double bit patterns are not valid long doubles.
|
|
|
|
|
These do not represent any value.
|
|
|
|
|
|
|
|
|
|
Limits
|
|
|
|
|
------
|
|
|
|
|
|
|
|
|
|
The maximum representable long double is 2^1024-2^918. The smallest
|
|
|
|
|
*normal* positive long double is 2^-968. The smallest denormalised
|
|
|
|
|
positive long double is 2^-1074 (this is the same as for 'double').
|
|
|
|
|
|
|
|
|
|
Conversions
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
A double can be converted to a long double by adding a zero low part.
|
|
|
|
|
|
|
|
|
|
A long double can be converted to a double by removing the low part.
|
|
|
|
|
|
|
|
|
|
Comparisons
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
Two long doubles can be compared by comparing the high parts, and if
|
|
|
|
|
those compare equal, comparing the low parts.
|
|
|
|
|
|
|
|
|
|
Arithmetic
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
|
|
The unary negate operation operates by negating the low and high parts.
|
|
|
|
|
|
|
|
|
|
An absolute or absolute-negate operation must be done by comparing
|
|
|
|
|
against zero and negating if necessary.
|
|
|
|
|
|
|
|
|
|
Addition and subtraction are performed using library routines. They
|
|
|
|
|
are not at present performed perfectly accurately, the result produced
|
|
|
|
|
will be within 1ulp of the range generated by adding or subtracting
|
|
|
|
|
1ulp from the input values, where a 'ulp' is 2^(e-106) given the
|
|
|
|
|
exponent 'e'. In the presence of cancellation, this may be
|
|
|
|
|
arbitrarily inaccurate. Subtraction is done by negation and addition.
|
|
|
|
|
|
|
|
|
|
Multiplication is also performed using a library routine. Its result
|
|
|
|
|
will be within 2ulp of the correct result.
|
|
|
|
|
|
|
|
|
|
Division is also performed using a library routine. Its result will
|
|
|
|
|
be within 3ulp of the correct result.
|
ABOUT-GCC-NLS, [...]: Add copyright and license notices.
* ABOUT-GCC-NLS, ChangeLog, ChangeLog-1997, ChangeLog-1998,
ChangeLog-1999, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002,
ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006,
ChangeLog-2007, ChangeLog-2008, ChangeLog.dataflow, ChangeLog.lib,
ChangeLog.ptr, ChangeLog.tree-ssa, ChangeLog.tuples, FSFChangeLog,
FSFChangeLog.10, FSFChangeLog.11, LANGUAGES, ONEWS, acinclude.m4,
config/alpha/gnu.h, config/alpha/libgcc-alpha-ldbl.ver,
config/alpha/t-osf4, config/alpha/t-vms, config/alpha/va_list.h,
config/alpha/x-vms, config/arc/t-arc,
config/arm/README-interworking, config/arm/arm-c.c,
config/arm/gentune.sh, config/arm/libgcc-bpabi.ver,
config/arm/t-arm, config/arm/t-arm-elf, config/arm/t-arm-softfp,
config/arm/t-bpabi, config/arm/t-linux, config/arm/t-linux-eabi,
config/arm/t-netbsd, config/arm/t-pe, config/arm/t-strongarm-elf,
config/arm/t-symbian, config/arm/t-vxworks, config/arm/t-wince-pe,
config/avr/t-avr, config/bfin/elf.h, config/bfin/libgcc-bfin.ver,
config/bfin/linux.h, config/bfin/t-bfin, config/bfin/t-bfin-elf,
config/bfin/t-bfin-linux, config/bfin/t-bfin-uclinux,
config/bfin/uclinux.h, config/cris/mulsi3.asm, config/cris/t-cris,
config/cris/t-elfmulti, config/crx/t-crx,
config/darwin-ppc-ldouble-patch.def, config/darwin-sections.def,
config/divmod.c, config/fr30/t-fr30, config/frv/libgcc-frv.ver,
config/frv/t-frv, config/frv/t-linux, config/h8300/genmova.sh,
config/h8300/t-h8300, config/i386/athlon.md,
config/i386/darwin-libgcc.10.4.ver,
config/i386/darwin-libgcc.10.5.ver, config/i386/libgcc-glibc.ver,
config/i386/mach.h, config/i386/netbsd.h, config/i386/t-crtpc,
config/i386/t-cygming, config/i386/t-cygwin, config/i386/t-i386,
config/i386/t-linux64, config/i386/t-nwld,
config/i386/t-rtems-i386, config/i386/t-sol2-10,
config/i386/x-mingw32, config/ia64/div.md, config/ia64/elf.h,
config/ia64/ia64.opt, config/ia64/libgcc-glibc.ver,
config/ia64/libgcc-ia64.ver, config/ia64/linux.h,
config/ia64/sysv4.h, config/ia64/t-hpux, config/ia64/t-ia64,
config/iq2000/abi, config/iq2000/lib2extra-funcs.c,
config/iq2000/t-iq2000, config/libgcc-glibc.ver,
config/m32r/libgcc-glibc.ver, config/m32r/t-linux,
config/m32r/t-m32r, config/m68hc11/t-m68hc11,
config/m68k/t-floatlib, config/m68k/t-linux, config/m68k/t-mlibs,
config/m68k/t-uclinux, config/mcore/t-mcore,
config/mcore/t-mcore-pe, config/mips/20kc.md, config/mips/4130.md,
config/mips/5400.md, config/mips/5500.md, config/mips/crti.asm,
config/mips/crtn.asm, config/mips/irix-crti.asm,
config/mips/irix-crtn.asm, config/mips/libgcc-mips16.ver,
config/mips/mips-dsp.md, config/mips/mips-dspr2.md,
config/mips/mips-fixed.md, config/mips/sb1.md,
config/mips/sr71k.md, config/mips/t-elf, config/mips/t-gofast,
config/mips/t-iris6, config/mips/t-isa3264,
config/mips/t-libgcc-mips16, config/mips/t-linux64,
config/mips/t-mips, config/mips/t-r3900, config/mips/t-rtems,
config/mips/t-sb1, config/mips/t-sde, config/mips/t-sdemtk,
config/mips/t-slibgcc-irix, config/mips/t-sr71k, config/mips/t-st,
config/mips/t-vr, config/mips/t-vxworks, config/mmix/t-mmix,
config/mn10300/t-linux, config/mn10300/t-mn10300,
config/pa/pa32-regs.h, config/pa/t-hpux-shlib, config/pa/t-linux,
config/pa/t-linux64, config/pa/t-pa64, config/pdp11/t-pdp11,
config/picochip/libgccExtras/clzsi2.asm,
config/picochip/t-picochip, config/rs6000/darwin-ldouble-format,
config/rs6000/darwin-libgcc.10.4.ver,
config/rs6000/darwin-libgcc.10.5.ver,
config/rs6000/libgcc-ppc-glibc.ver, config/rs6000/ppc-asm.h,
config/rs6000/t-aix43, config/rs6000/t-aix52,
config/rs6000/t-darwin, config/rs6000/t-fprules,
config/rs6000/t-fprules-fpbit, config/rs6000/t-linux64,
config/rs6000/t-lynx, config/rs6000/t-netbsd,
config/rs6000/t-ppccomm, config/rs6000/t-ppcendian,
config/rs6000/t-ppcgas, config/rs6000/t-rs6000,
config/rs6000/t-rtems, config/rs6000/t-spe,
config/rs6000/t-vxworks, config/s390/libgcc-glibc.ver,
config/score/t-score-elf, config/sh/divcost-analysis,
config/sh/libgcc-glibc.ver, config/sh/t-netbsd, config/sh/t-sh,
config/sh/t-sh64, config/sh/t-superh, config/sh/t-symbian,
config/sparc/libgcc-sparc-glibc.ver, config/sparc/sol2-bi.h,
config/sparc/sol2-gas.h, config/sparc/sol2-gld-bi.h,
config/sparc/t-elf, config/sparc/t-linux64, config/sparc/t-sol2,
config/stormy16/stormy-abi, config/stormy16/t-stormy16,
config/t-darwin, config/t-libunwind, config/t-libunwind-elf,
config/t-linux, config/t-lynx, config/t-slibgcc-elf-ver,
config/t-slibgcc-sld, config/t-sol2, config/t-vxworks,
config/udivmod.c, config/udivmodsi4.c, config/v850/t-v850,
config/v850/t-v850e, config/xtensa/t-xtensa, diagnostic.def,
gdbinit.in, glimits.h, gstab.h, gsyms.h, java/ChangeLog,
java/ChangeLog.ptr, java/ChangeLog.tree-ssa, libgcc-std.ver,
limitx.h, version.c, xcoff.h: Add copyright and license notices.
* config/h8300/genmova.sh: Include copyright and license notices
in generated output.
* config/h8300/mova.md: Regenerate.
* doc/install.texi2html: Include word "Copyright" in copyright
notice and use name "Free Software Foundation, Inc.".
* ChangeLog, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002,
ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006,
ChangeLog-2007, ChangeLog-2008: Correct dates.
ada:
* ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and
license notices.
cp:
* ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
cfns.gperf: Add copyright and license notices.
* cfns.h: Regenerate.
* ChangeLog, ChangeLog-2004: Correct dates.
fortran:
* ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004,
ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008,
ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add
copyright and license notices.
* ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
ChangeLog-2008: Correct dates.
java:
* ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and
license notices.
objc:
* ChangeLog: Add copyright and license notices.
objcp:
* ChangeLog: Add copyright and license notices.
po:
* ChangeLog, EXCLUDES: Add copyright and license notices.
testsuite:
* ChangeLog, ChangeLog-1993-2007, ChangeLog-2008, ChangeLog.ptr,
ChangeLog.tree-ssa, README, README.QMTEST, README.compat,
README.gcc, g++.dg/README, g++.dg/compat/break/README,
g++.dg/gomp/gomp.exp, g++.old-deja/g++.brendan/README,
g++.old-deja/g++.oliva/ChangeLog, g++.old-deja/g++.robertl/README,
gcc.c-torture/ChangeLog.0,
gcc.c-torture/execute/builtins/builtins.exp, gcc.dg/README,
gcc.dg/gomp/gomp.exp, gcc.target/frv/frv.exp,
gcc.target/i386/math-torture/math-torture.exp,
gcc.target/mips/inter/mips16-inter.exp,
gcc.target/mips/mips-nonpic/README,
gcc.target/x86_64/abi/README.gcc,
gcc.target/xstormy16/xstormy16.exp, gcc.test-framework/README,
gfortran.dg/g77/README, gfortran.dg/gomp/gomp.exp,
gfortran.fortran-torture/ChangeLog.g95: Add copyright and license
notices.
* ChangeLog-1993-2007, ChangeLog: Correct dates.
From-SVN: r146533
2009-04-21 21:03:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2004 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
|
notice and this notice are preserved.
|