This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Minimum floating-point requirements


I propose the following as minimum requirements on the underlying 
floating-point arithmetic used in glibc (libc and libm) (this is about 
float / double / long double rather than any other types; in particular, 
complex multiplication / division in libgcc follows lower standards and is 
generally avoided in glibc):

* No support for new formats not following IEEE semantics should be added.

* glibc code may always assume that floating-point arithmetic follows, at 
least, similar standards to those applied to most libm functions, 
regarding results being within a few ulps and exceptions other than maybe 
"inexact" (and underflow for tiny exact results) being accurate.

* For IEEE formats, glibc code may assume that results are correctly 
rounded with correct exceptions, subject to (a) processors not necessarily 
supporting all rounding modes and exceptions, (b) GCC, kernel and 
processor bugs, where the decision about whether to work around such a bug 
is made on a case-by-case basis.  GCC should be used in a mode providing 
this (bearing in mind that most glibc functions do not need "inexact"), 
and the default FPU mode should be set similarly (to provide correct 
results using kernel helpers, where necessary, for example).  (If "fast" 
versions of functions are provided in future, or versions that require 
round-to-nearest, etc., they can of course be built with different 
options.)

* As a consequence of the above, we should seek FSF approval to copy the 
IBM long double support from libgcc into glibc, under LGPLv2.1+, so that 
it can be adapted to meet the above standards.

Comments?

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]