<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc.git/sysdeps/ieee754/flt-32/s_logbf.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/'/>
<entry>
<title>math: Don't redirect inlined builtin math functions</title>
<updated>2025-11-17T14:17:07+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2025-11-10T13:28:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=13cfd77bf5679e8a888a63e233fb60529177b278'/>
<id>13cfd77bf5679e8a888a63e233fb60529177b278</id>
<content type='text'>
When we want to inline builtin math functions, like truncf, for

  extern float truncf (float __x) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
  extern float __truncf (float __x) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));

  float (truncf) (float) asm ("__truncf");

compiler may redirect truncf calls to __truncf, instead of inlining it
(for instance, clang).  The USE_TRUNCF_BUILTIN is 1 to indicate that
truncf should be inlined.  In this case, we don't want the truncf
redirection:

  1. For each math function which may be inlined, we define

  #if USE_TRUNCF_BUILTIN
   # define NO_truncf_BUILTIN inline_truncf
   #else
   # define NO_truncf_BUILTIN truncf
   #endif

in &lt;math-use-builtins.h&gt;.

  2. Include &lt;math-use-builtins.h&gt; in include/math.h.

  3. Change MATH_REDIRECT to

   #define MATH_REDIRECT(FUNC, PREFIX, ARGS)		\
    float (NO_ ## FUNC ## f ## _BUILTIN) (ARGS (float))	\
      asm (PREFIX #FUNC "f");

With this change If USE_TRUNCF_BUILTIN is 0, we get

  float (truncf) (float) asm ("__truncf");
  truncf will be redirected to __truncf.

And for USE_TRUNCF_BUILTIN 1, we get:

  float (inline_truncf) (float) asm ("__truncf");

In both cases either truncf will be inlined or the internal alias
(__truncf) will be called.

It is not required for all math-use-builtin symbol, only the one
defined in math.h.  It also allows to remove all the math-use-builtin
inclusion, since it is now implicitly included by math.h.

For MIPS, some math-use-builtin headers include sysdep.h and this
in turn includes a lot of extra headers that do not allow ldbl-128
code to override alias definition (math.h will include
some stdlib.h definition).  The math-use-builtin only requires
the __mips_isa_rev, so move the defintion to sgidefs.h.

Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
Co-authored-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we want to inline builtin math functions, like truncf, for

  extern float truncf (float __x) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));
  extern float __truncf (float __x) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));

  float (truncf) (float) asm ("__truncf");

compiler may redirect truncf calls to __truncf, instead of inlining it
(for instance, clang).  The USE_TRUNCF_BUILTIN is 1 to indicate that
truncf should be inlined.  In this case, we don't want the truncf
redirection:

  1. For each math function which may be inlined, we define

  #if USE_TRUNCF_BUILTIN
   # define NO_truncf_BUILTIN inline_truncf
   #else
   # define NO_truncf_BUILTIN truncf
   #endif

in &lt;math-use-builtins.h&gt;.

  2. Include &lt;math-use-builtins.h&gt; in include/math.h.

  3. Change MATH_REDIRECT to

   #define MATH_REDIRECT(FUNC, PREFIX, ARGS)		\
    float (NO_ ## FUNC ## f ## _BUILTIN) (ARGS (float))	\
      asm (PREFIX #FUNC "f");

With this change If USE_TRUNCF_BUILTIN is 0, we get

  float (truncf) (float) asm ("__truncf");
  truncf will be redirected to __truncf.

And for USE_TRUNCF_BUILTIN 1, we get:

  float (inline_truncf) (float) asm ("__truncf");

In both cases either truncf will be inlined or the internal alias
(__truncf) will be called.

It is not required for all math-use-builtin symbol, only the one
defined in math.h.  It also allows to remove all the math-use-builtin
inclusion, since it is now implicitly included by math.h.

For MIPS, some math-use-builtin headers include sysdep.h and this
in turn includes a lot of extra headers that do not allow ldbl-128
code to override alias definition (math.h will include
some stdlib.h definition).  The math-use-builtin only requires
the __mips_isa_rev, so move the defintion to sgidefs.h.

Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
Co-authored-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use GCC builtins for logb functions if desired.</title>
<updated>2022-11-29T08:00:28+00:00</updated>
<author>
<name>Xiaolin Tang</name>
<email>tangxiaolin@loongson.cn</email>
</author>
<published>2022-11-23T03:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=2e2485ce05bce85bf092ba0752854afa14b92dad'/>
<id>2e2485ce05bce85bf092ba0752854afa14b92dad</id>
<content type='text'>
This patch is using the corresponding GCC builtin for logbf, logb,
logbl and logbf128 if the USE_FUNCTION_BUILTIN macros are defined to one
in math-use-builtins-function.h.

Co-Authored-By: Xi Ruoyao &lt;xry111@xry111.site&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is using the corresponding GCC builtin for logbf, logb,
logbl and logbf128 if the USE_FUNCTION_BUILTIN macros are defined to one
in math-use-builtins-function.h.

Co-Authored-By: Xi Ruoyao &lt;xry111@xry111.site&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove "Contributed by" lines</title>
<updated>2021-09-03T16:36:44+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@sourceware.org</email>
</author>
<published>2021-09-03T16:36:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=30891f35fa7da832b66d80d0807610df361851f3'/>
<id>30891f35fa7da832b66d80d0807610df361851f3</id>
<content type='text'>
We stopped adding "Contributed by" or similar lines in sources in 2012
in favour of git logs and keeping the Contributors section of the
glibc manual up to date.  Removing these lines makes the license
header a bit more consistent across files and also removes the
possibility of error in attribution when license blocks or files are
copied across since the contributed-by lines don't actually reflect
reality in those cases.

Move all "Contributed by" and similar lines (Written by, Test by,
etc.) into a new file CONTRIBUTED-BY to retain record of these
contributions.  These contributors are also mentioned in
manual/contrib.texi, so we just maintain this additional record as a
courtesy to the earlier developers.

The following scripts were used to filter a list of files to edit in
place and to clean up the CONTRIBUTED-BY file respectively.  These
were not added to the glibc sources because they're not expected to be
of any use in future given that this is a one time task:

https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc
https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02

Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We stopped adding "Contributed by" or similar lines in sources in 2012
in favour of git logs and keeping the Contributors section of the
glibc manual up to date.  Removing these lines makes the license
header a bit more consistent across files and also removes the
possibility of error in attribution when license blocks or files are
copied across since the contributed-by lines don't actually reflect
reality in those cases.

Move all "Contributed by" and similar lines (Written by, Test by,
etc.) into a new file CONTRIBUTED-BY to retain record of these
contributions.  These contributors are also mentioned in
manual/contrib.texi, so we just maintain this additional record as a
courtesy to the earlier developers.

The following scripts were used to filter a list of files to edit in
place and to clean up the CONTRIBUTED-BY file respectively.  These
were not added to the glibc sources because they're not expected to be
of any use in future given that this is a one time task:

https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc
https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02

Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use libm_alias_float in flt-32.</title>
<updated>2017-09-22T20:24:12+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2017-09-22T20:24:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=2f49ce7d6263588c0b4c60a42e95ff954cf3c7d2'/>
<id>2f49ce7d6263588c0b4c60a42e95ff954cf3c7d2</id>
<content type='text'>
This patch makes flt-32 libm functions use libm_alias_float to define
public interfaces (in cases where _Float32 aliases of those interfaces
would be appropriate, so not for finitef / isinff / isnanf).

Tested for x86_64.  Also tested with build-many-glibcs.py that
installed stripped shared libraries are unchanged by the patch.

	* sysdeps/ieee754/flt-32/s_asinhf.c: Include &lt;libm-alias-float.h&gt;.
	(asinhf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_atanf.c: Include &lt;libm-alias-float.h&gt;.
	(atanf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_cbrtf.c: Include &lt;libm-alias-float.h&gt;.
	(cbrtf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ceilf.c: Include &lt;libm-alias-float.h&gt;.
	(ceilf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_copysignf.c: Include
	&lt;libm-alias-float.h&gt;.
	(copysignf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_cosf.c: Include &lt;libm-alias-float.h&gt;.
	(cosf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_erff.c: Include &lt;libm-alias-float.h&gt;.
	(erff): Define using libm_alias_float.
	(erfcf): Likewise.
	* sysdeps/ieee754/flt-32/s_expm1f.c: Include &lt;libm-alias-float.h&gt;.
	(expm1f): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fabsf.c: Include &lt;libm-alias-float.h&gt;.
	(fabsf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_floorf.c: Include &lt;libm-alias-float.h&gt;.
	(floorf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_frexpf.c: Include &lt;libm-alias-float.h&gt;.
	(frexpf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fromfpf.c (fromfpf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Include
	&lt;libm-alias-float.h&gt;.
	* sysdeps/ieee754/flt-32/s_fromfpxf.c (fromfpxf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_getpayloadf.c: Include
	&lt;libm-alias-float.h&gt;.
	(getpayloadf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_llrintf.c: Include
	&lt;libm-alias-float.h&gt;.
	(llrintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_llroundf.c: Include
	&lt;libm-alias-float.h&gt;.
	(llroundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_logbf.c: Include &lt;libm-alias-float.h&gt;.
	(logbf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_lrintf.c: Include &lt;libm-alias-float.h&gt;.
	(lrintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_lroundf.c: Include &lt;libm-alias-float.h&gt;.
	(lroundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_modff.c: Include &lt;libm-alias-float.h&gt;.
	(modff): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nearbyintf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nextafterf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nextafterf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nextupf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nextupf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_remquof.c: Include
	&lt;libm-alias-float.h&gt;.
	(remquof): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_rintf.c: Include &lt;libm-alias-float.h&gt;.
	(rintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_roundevenf.c: Include
	&lt;libm-alias-float.h&gt;.
	(roundevenf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_roundf.c: Include &lt;libm-alias-float.h&gt;.
	(roundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_setpayloadf.c (setpayloadf): Define
	using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_setpayloadf_main.c: Include
	&lt;libm-alias-float.h&gt;.
	* sysdeps/ieee754/flt-32/s_setpayloadsigf.c (setpayloadsigf):
	Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_sincosf.c: Include
	&lt;libm-alias-float.h&gt;.
	(sincosf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_sinf.c: Include &lt;libm-alias-float.h&gt;.
	(sinf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_tanf.c: Include &lt;libm-alias-float.h&gt;.
	(tanf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_tanhf.c: Include &lt;libm-alias-float.h&gt;.
	(tanhf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_totalorderf.c: Include
	&lt;libm-alias-float.h&gt;.
	(totalorderf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_totalordermagf.c: Include
	&lt;libm-alias-float.h&gt;.
	(totalordermagf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_truncf.c: Include &lt;libm-alias-float.h&gt;.
	(truncf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ufromfpf.c (ufromfpf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ufromfpxf.c (ufromfpxf): Define using
	libm_alias_float.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes flt-32 libm functions use libm_alias_float to define
public interfaces (in cases where _Float32 aliases of those interfaces
would be appropriate, so not for finitef / isinff / isnanf).

Tested for x86_64.  Also tested with build-many-glibcs.py that
installed stripped shared libraries are unchanged by the patch.

	* sysdeps/ieee754/flt-32/s_asinhf.c: Include &lt;libm-alias-float.h&gt;.
	(asinhf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_atanf.c: Include &lt;libm-alias-float.h&gt;.
	(atanf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_cbrtf.c: Include &lt;libm-alias-float.h&gt;.
	(cbrtf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ceilf.c: Include &lt;libm-alias-float.h&gt;.
	(ceilf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_copysignf.c: Include
	&lt;libm-alias-float.h&gt;.
	(copysignf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_cosf.c: Include &lt;libm-alias-float.h&gt;.
	(cosf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_erff.c: Include &lt;libm-alias-float.h&gt;.
	(erff): Define using libm_alias_float.
	(erfcf): Likewise.
	* sysdeps/ieee754/flt-32/s_expm1f.c: Include &lt;libm-alias-float.h&gt;.
	(expm1f): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fabsf.c: Include &lt;libm-alias-float.h&gt;.
	(fabsf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_floorf.c: Include &lt;libm-alias-float.h&gt;.
	(floorf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_frexpf.c: Include &lt;libm-alias-float.h&gt;.
	(frexpf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fromfpf.c (fromfpf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Include
	&lt;libm-alias-float.h&gt;.
	* sysdeps/ieee754/flt-32/s_fromfpxf.c (fromfpxf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_getpayloadf.c: Include
	&lt;libm-alias-float.h&gt;.
	(getpayloadf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_llrintf.c: Include
	&lt;libm-alias-float.h&gt;.
	(llrintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_llroundf.c: Include
	&lt;libm-alias-float.h&gt;.
	(llroundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_logbf.c: Include &lt;libm-alias-float.h&gt;.
	(logbf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_lrintf.c: Include &lt;libm-alias-float.h&gt;.
	(lrintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_lroundf.c: Include &lt;libm-alias-float.h&gt;.
	(lroundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_modff.c: Include &lt;libm-alias-float.h&gt;.
	(modff): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nearbyintf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nextafterf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nextafterf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_nextupf.c: Include
	&lt;libm-alias-float.h&gt;.
	(nextupf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_remquof.c: Include
	&lt;libm-alias-float.h&gt;.
	(remquof): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_rintf.c: Include &lt;libm-alias-float.h&gt;.
	(rintf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_roundevenf.c: Include
	&lt;libm-alias-float.h&gt;.
	(roundevenf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_roundf.c: Include &lt;libm-alias-float.h&gt;.
	(roundf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_setpayloadf.c (setpayloadf): Define
	using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_setpayloadf_main.c: Include
	&lt;libm-alias-float.h&gt;.
	* sysdeps/ieee754/flt-32/s_setpayloadsigf.c (setpayloadsigf):
	Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_sincosf.c: Include
	&lt;libm-alias-float.h&gt;.
	(sincosf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_sinf.c: Include &lt;libm-alias-float.h&gt;.
	(sinf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_tanf.c: Include &lt;libm-alias-float.h&gt;.
	(tanf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_tanhf.c: Include &lt;libm-alias-float.h&gt;.
	(tanhf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_totalorderf.c: Include
	&lt;libm-alias-float.h&gt;.
	(totalorderf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_totalordermagf.c: Include
	&lt;libm-alias-float.h&gt;.
	(totalordermagf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_truncf.c: Include &lt;libm-alias-float.h&gt;.
	(truncf): Define using libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ufromfpf.c (ufromfpf): Define using
	libm_alias_float.
	* sysdeps/ieee754/flt-32/s_ufromfpxf.c (ufromfpxf): Define using
	libm_alias_float.
</pre>
</div>
</content>
</entry>
<entry>
<title>Work around powerpc32 integer 0 converting to -0 (bug 887, bug 19049, bug 19050).</title>
<updated>2015-10-05T17:46:50+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2015-10-05T17:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=bc3753638a1c3c93dea071414909ce2729e3ca50'/>
<id>bc3753638a1c3c93dea071414909ce2729e3ca50</id>
<content type='text'>
On powerpc32 hard-float, older processors (ones where fcfid is not
available for 32-bit code), GCC generates conversions from integers to
floating point that wrongly convert integer 0 to -0 instead of +0 in
FE_DOWNWARD mode.  This in turn results in logb and a few other
functions wrongly returning -0 when they should return +0.

This patch works around this issue in glibc as I proposed in
&lt;https://sourceware.org/ml/libc-alpha/2015-09/msg00728.html&gt;, so that
the affected functions can be correct and the affected tests pass in
the absence of a GCC fix for this longstanding issue (GCC bug 67771 -
if fixed, of course we can put in GCC version conditionals, and
eventually phase out the workarounds).  A new macro
FIX_INT_FP_CONVERT_ZERO is added in a new sysdeps header
fix-int-fp-convert-zero.h, and the powerpc32/fpu version of that
header defines the macro based on the results of a configure test for
whether such conversions use the fcfid instruction.

Tested for x86_64 (that installed stripped shared libraries are
unchanged by the patch) and powerpc (that HAVE_PPC_FCFID comes out to
0 as expected and that the relevant tests are fixed).  Also tested a
build with GCC configured for -mcpu=power4 and verified that
HAVE_PPC_FCFID comes out to 1 in that case.

There are still some other issues to fix to get test-float and
test-double passing cleanly for older powerpc32 processors (apart from
the need for an ulps regeneration for powerpc).  (test-ldouble will be
harder to get passing cleanly, but with a combination of selected
fixes to ldbl-128ibm code that don't involve significant performance
issues, allowing spurious underflow and inexact exceptions for that
format, and lots of XFAILing for the default case of unpatched libgcc,
it should be doable.)

	[BZ #887]
	[BZ #19049]
	[BZ #19050]
	* sysdeps/generic/fix-int-fp-convert-zero.h: New file.
	* sysdeps/ieee754/dbl-64/e_log10.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log10): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/e_log2.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log2): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/s_erf.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfc): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/s_logb.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logb): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/e_log10f.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log10f): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/e_log2f.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log2f): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/s_erff.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfcf): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/s_logbf.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logbf): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/ldbl-128ibm/s_erfl.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfcl): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/ldbl-128ibm/s_logbl.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logbl): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/powerpc/powerpc32/fpu/configure.ac: New file.
	* sysdeps/powerpc/powerpc32/fpu/configure: New generated file.
	* sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h: New
	file.
	* config.h.in [_LIBC] (HAVE_PPC_FCFID): New macro.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On powerpc32 hard-float, older processors (ones where fcfid is not
available for 32-bit code), GCC generates conversions from integers to
floating point that wrongly convert integer 0 to -0 instead of +0 in
FE_DOWNWARD mode.  This in turn results in logb and a few other
functions wrongly returning -0 when they should return +0.

This patch works around this issue in glibc as I proposed in
&lt;https://sourceware.org/ml/libc-alpha/2015-09/msg00728.html&gt;, so that
the affected functions can be correct and the affected tests pass in
the absence of a GCC fix for this longstanding issue (GCC bug 67771 -
if fixed, of course we can put in GCC version conditionals, and
eventually phase out the workarounds).  A new macro
FIX_INT_FP_CONVERT_ZERO is added in a new sysdeps header
fix-int-fp-convert-zero.h, and the powerpc32/fpu version of that
header defines the macro based on the results of a configure test for
whether such conversions use the fcfid instruction.

Tested for x86_64 (that installed stripped shared libraries are
unchanged by the patch) and powerpc (that HAVE_PPC_FCFID comes out to
0 as expected and that the relevant tests are fixed).  Also tested a
build with GCC configured for -mcpu=power4 and verified that
HAVE_PPC_FCFID comes out to 1 in that case.

There are still some other issues to fix to get test-float and
test-double passing cleanly for older powerpc32 processors (apart from
the need for an ulps regeneration for powerpc).  (test-ldouble will be
harder to get passing cleanly, but with a combination of selected
fixes to ldbl-128ibm code that don't involve significant performance
issues, allowing spurious underflow and inexact exceptions for that
format, and lots of XFAILing for the default case of unpatched libgcc,
it should be doable.)

	[BZ #887]
	[BZ #19049]
	[BZ #19050]
	* sysdeps/generic/fix-int-fp-convert-zero.h: New file.
	* sysdeps/ieee754/dbl-64/e_log10.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log10): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/e_log2.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log2): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/s_erf.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfc): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/dbl-64/s_logb.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logb): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/e_log10f.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log10f): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/e_log2f.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__ieee754_log2f): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/s_erff.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfcf): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/flt-32/s_logbf.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logbf): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/ldbl-128ibm/s_erfl.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__erfcl): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/ieee754/ldbl-128ibm/s_logbl.c: Include
	&lt;fix-int-fp-convert-zero.h&gt;.
	(__logbl): Adjust signs as needed if FIX_INT_FP_CONVERT_ZERO.
	* sysdeps/powerpc/powerpc32/fpu/configure.ac: New file.
	* sysdeps/powerpc/powerpc32/fpu/configure: New generated file.
	* sysdeps/powerpc/powerpc32/fpu/fix-int-fp-convert-zero.h: New
	file.
	* config.h.in [_LIBC] (HAVE_PPC_FCFID): New macro.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use glibc_likely instead __builtin_expect.</title>
<updated>2014-02-10T14:07:12+00:00</updated>
<author>
<name>Ondřej Bílka</name>
<email>neleai@seznam.cz</email>
</author>
<published>2014-02-10T13:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=a1ffb40e32741f992c743e7b16c061fefa3747ac'/>
<id>a1ffb40e32741f992c743e7b16c061fefa3747ac</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove trailing whitespace.</title>
<updated>2013-06-05T20:44:03+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2013-06-05T20:44:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=9c84384cc18ff589233628c193953ca8d7a39f5c'/>
<id>9c84384cc18ff589233628c193953ca8d7a39f5c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize handling of denormals in logb/logbf/logbl</title>
<updated>2012-05-26T11:53:22+00:00</updated>
<author>
<name>Andreas Schwab</name>
<email>schwab@linux-m68k.org</email>
</author>
<published>2012-05-25T09:57:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=25dbcb277a9dea5f241c0b888a30b9341310d941'/>
<id>25dbcb277a9dea5f241c0b888a30b9341310d941</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix for logb/logbf/logbl (bugs 13954/13955/13956)</title>
<updated>2012-05-10T20:11:55+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>azanella@linux.vnet.ibm.com</email>
</author>
<published>2012-05-10T20:11:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=89c9aa491a7cee97bf78a29cddbf0a25c902a671'/>
<id>89c9aa491a7cee97bf78a29cddbf0a25c902a671</id>
<content type='text'>
POSIX 2008 states that if the input for 'logb[f|l]' is a subnormal number
it should be treated as if it were normalized.  This means the
implementation should calculate the log2 of the mantissa and add it to the
subnormal exponent (-126 for float and -1022 for double and IBM long
double).  This patch takes care of that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
POSIX 2008 states that if the input for 'logb[f|l]' is a subnormal number
it should be treated as if it were normalized.  This means the
implementation should calculate the log2 of the mantissa and add it to the
subnormal exponent (-126 for float and -1022 for double and IBM long
double).  This patch takes care of that.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use &lt;&gt; for math.h and math_private.h everywhere.</title>
<updated>2012-03-10T00:09:10+00:00</updated>
<author>
<name>Richard Henderson</name>
<email>rth@twiddle.net</email>
</author>
<published>2012-03-09T19:29:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=1ed0291c3154c25633107d93e122c1b0c0f7c975'/>
<id>1ed0291c3154c25633107d93e122c1b0c0f7c975</id>
<content type='text'>
Entire tree edited via find | grep | sed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Entire tree edited via find | grep | sed.
</pre>
</div>
</content>
</entry>
</feed>
