Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jul 2023 20:58:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 272783] Clean up libm use of the __ieee754_ prefix
Message-ID:  <bug-272783-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272783

            Bug ID: 272783
           Summary: Clean up libm use of the __ieee754_ prefix
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: kargl@FreeBSD.org

Created attachment 243675
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D243675&action=
=3Dedit
patch to remove __ieee754_ prefix

This patch removes the __ieee754_ prefix from a number of the math
functions.  msun/src/math_private.h contains the statement that

  /*
   * ieee style elementary functions
   *
   * We rename functions here to improve other sources' diffability
   * against fdlibm.
   */
   #define        __ieee754_sqrt  sqrt
   ...

Here, fdlibm refers to https://netlib.org/fdlibm.  It is seen from
https://netlib.org/fdlibm/readme that this prefix was used to=20
differentiate between different standards:

   Wrapper functions will twist the result of the ieee754=20
   function to comply to the standard specified by the value=20
   of _LIB_VERSION=20
      if _LIB_VERSION =3D _IEEE_, return the ieee754 result;
      if _LIB_VERSION =3D _SVID_, return SVID result;
      if _LIB_VERSION =3D _XOPEN_, return XOPEN result;
      if _LIB_VERSION =3D _POSIX_, return POSIX/ANSI result.
   (These are macros, see fdlibm.h for their definition.)

AFAICT, FreeBSD has never supported these wrappers.  In addition, as
C99, principally the long double, functions were added to libm, this
convention was not maintained.  Given that only 148 of 324 files under
lib/msun contain a "Copyright (C) 1993 by Sun Microsystems" statement,
the removal of the __ieee754_ prefix provides consistency across all
source files.

The last time someone compared lib/msun to fdlibm appears to be

  commit 3f70824172feb82ea3dcdb3866b54fe0eb7cd890
  Author: David Schultz <das@FreeBSD.org>
  Date:   Fri Feb 4 18:26:06 2005 +0000

  Reduce diffs against vendor source (Sun fdlibm 5.3).

The most recent fdlibm RCS string that appears in a Sun Microsystem
copyrighted file is date "95/01/18".  With Oracle Corporation's
acquisition of Sun Microsystems in 2009, it is unlikely that fdlibm=20
will ever be updated. A search for fdlibm at https://opensource.oracle.com/
yields no hits.

Finally, OpenBSD removed the use of this prefix over 21 years ago.
pSee revision 1.6 of OpenBSD's math_private.h.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-272783-227>