freebsd-nq/lib/msun/bsdsrc
Bruce Evans 0b42281ee9 Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access
to doubles as bits.  fdlibm-1.1 had similar aliasing bugs, but these
were fixed by NetBSD or Cygnus before a modified version of fdlibm was
imported in 1994.  TRUNC() is only used by tgamma() and some
implementation-detail functions.  The aliasing bugs were detected by
compiling with gcc -O2 but don't seem to have broken tgamma() on i386's
or amd64's.  They broke my modified version of tgamma().

Moved the definition of TRUNC() to mathimpl.h so that it can be fixed
in one place, although the general version is even slower than necessary
because it has to operate on pointers to volatiles to handle its arg
sometimes being volatile.  Inefficiency of the fdlibm macros slows
down libm generally, and tgamma() is a relatively unimportant part of
libm.  The macros act as if on 32-bit words in memory, so they are
hard to optimize to direct actions on 64-bit double registers for
(non-i386) machines where this is possible.  The optimization is too
hard for gcc on amd64's, and declaring variables as volatile makes it
impossible.
2005-09-19 11:28:19 +00:00
..
b_exp.c Cosmetic changes only: 2004-12-16 20:40:37 +00:00
b_log.c Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access 2005-09-19 11:28:19 +00:00
b_tgamma.c Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access 2005-09-19 11:28:19 +00:00
mathimpl.h Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access 2005-09-19 11:28:19 +00:00