diff mbox

ppc: Fix modf (sNaN) for pre-POWER5+ CPU (bug 20240).

Message ID 1467811476-5893-1-git-send-email-aurelien@aurel32.net
State Committed
Delegated to: Adhemerval Zanella Netto
Headers show

Commit Message

Aurelien Jarno July 6, 2016, 1:24 p.m. UTC
Commit a6a4395d fixed modf implementation by compiling s_modf.c and
s_modff.c with -fsignaling-nans. However these files are also included
from the pre-POWER5+ implementation, and thus these files should also
be compiled with -fsignaling-nans.

Changelog:
	[BZ #20240]
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
	(CFLAGS-s_modf-ppc32.c): New variable.
	(CFLAGS-s_modff-ppc32.c): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
	(CFLAGS-s_modf-ppc64.c): Likewise.
	(CFLAGS-s_modff-ppc64.c): Likewise.
---
 ChangeLog                                               | 10 ++++++++++
 sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile |  5 +++++
 sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile        |  5 +++++
 3 files changed, 20 insertions(+)

Comments

Adhemerval Zanella July 6, 2016, 7:54 p.m. UTC | #1
LGTM.

On 06/07/2016 10:24, Aurelien Jarno wrote:
> Commit a6a4395d fixed modf implementation by compiling s_modf.c and
> s_modff.c with -fsignaling-nans. However these files are also included
> from the pre-POWER5+ implementation, and thus these files should also
> be compiled with -fsignaling-nans.
> 
> Changelog:
> 	[BZ #20240]
> 	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> 	(CFLAGS-s_modf-ppc32.c): New variable.
> 	(CFLAGS-s_modff-ppc32.c): Likewise.
> 	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> 	(CFLAGS-s_modf-ppc64.c): Likewise.
> 	(CFLAGS-s_modff-ppc64.c): Likewise.
> ---
>  ChangeLog                                               | 10 ++++++++++
>  sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile |  5 +++++
>  sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile        |  5 +++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 72c5549..28aa60a 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,13 @@
> +2016-07-06  Aurelien Jarno  <aurelien@aurel32.net>
> +
> +	[BZ #20240]
> +	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> +	(CFLAGS-s_modf-ppc32.c): New variable.
> +	(CFLAGS-s_modff-ppc32.c): Likewise.
> +	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> +	(CFLAGS-s_modf-ppc64.c): Likewise.
> +	(CFLAGS-s_modff-ppc64.c): Likewise.
> +
>  2016-07-06  John David Anglin  <danglin@gcc.gnu.org>
>  
>  	* sysdeps/hppa/fpu/libm-test-ulps: Regenerate.
> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> index 590a8eb..804e7dc 100644
> --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
> @@ -34,4 +34,9 @@ CFLAGS-s_logb-power7.c = -mcpu=power7
>  CFLAGS-s_logbf-power7.c = -mcpu=power7
>  CFLAGS-e_hypot-power7.c = -mcpu=power7
>  CFLAGS-e_hypotf-power7.c = -mcpu=power7
> +
> +# These files quiet sNaNs in a way that is optimized away without
> +# -fsignaling-nans.
> +CFLAGS-s_modf-ppc32.c += -fsignaling-nans
> +CFLAGS-s_modff-ppc32.c += -fsignaling-nans
>  endif
> diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> index add1fb8..ff42288 100644
> --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
> @@ -35,4 +35,9 @@ CFLAGS-s_modf-power5+.c = -mcpu=power5+
>  CFLAGS-s_modff-power5+.c = -mcpu=power5+
>  CFLAGS-e_hypot-power7.c = -mcpu=power7
>  CFLAGS-e_hypotf-power7.c = -mcpu=power7
> +
> +# These files quiet sNaNs in a way that is optimized away without
> +# -fsignaling-nans.
> +CFLAGS-s_modf-ppc64.c += -fsignaling-nans
> +CFLAGS-s_modff-ppc64.c += -fsignaling-nans
>  endif
>
diff mbox

Patch

diff --git a/ChangeLog b/ChangeLog
index 72c5549..28aa60a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@ 
+2016-07-06  Aurelien Jarno  <aurelien@aurel32.net>
+
+	[BZ #20240]
+	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
+	(CFLAGS-s_modf-ppc32.c): New variable.
+	(CFLAGS-s_modff-ppc32.c): Likewise.
+	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+	(CFLAGS-s_modf-ppc64.c): Likewise.
+	(CFLAGS-s_modff-ppc64.c): Likewise.
+
 2016-07-06  John David Anglin  <danglin@gcc.gnu.org>
 
 	* sysdeps/hppa/fpu/libm-test-ulps: Regenerate.
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
index 590a8eb..804e7dc 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
@@ -34,4 +34,9 @@  CFLAGS-s_logb-power7.c = -mcpu=power7
 CFLAGS-s_logbf-power7.c = -mcpu=power7
 CFLAGS-e_hypot-power7.c = -mcpu=power7
 CFLAGS-e_hypotf-power7.c = -mcpu=power7
+
+# These files quiet sNaNs in a way that is optimized away without
+# -fsignaling-nans.
+CFLAGS-s_modf-ppc32.c += -fsignaling-nans
+CFLAGS-s_modff-ppc32.c += -fsignaling-nans
 endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index add1fb8..ff42288 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -35,4 +35,9 @@  CFLAGS-s_modf-power5+.c = -mcpu=power5+
 CFLAGS-s_modff-power5+.c = -mcpu=power5+
 CFLAGS-e_hypot-power7.c = -mcpu=power7
 CFLAGS-e_hypotf-power7.c = -mcpu=power7
+
+# These files quiet sNaNs in a way that is optimized away without
+# -fsignaling-nans.
+CFLAGS-s_modf-ppc64.c += -fsignaling-nans
+CFLAGS-s_modff-ppc64.c += -fsignaling-nans
 endif