From fdfb701f1a91f969290412c8fade410eb761837c5e7ec7dbf6d8e976b0d3c31e Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 15 Apr 2014 13:21:46 +0000 Subject: [PATCH 1/3] Accepting request 230181 from home:a_jaeger:FactoryFix Use /run instead of /var/run OBS-URL: https://build.opensuse.org/request/show/230181 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=360 --- glibc-testsuite.changes | 5 +++++ glibc-testsuite.spec | 28 ++++++++++++++-------------- glibc-utils.changes | 5 +++++ glibc-utils.spec | 28 ++++++++++++++-------------- glibc.changes | 5 +++++ glibc.spec | 28 ++++++++++++++-------------- nscd.conf | 2 +- 7 files changed, 58 insertions(+), 43 deletions(-) diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index a98fc17..5471994 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com + +- Use /run for nscd instead of /var/run. + ------------------------------------------------------------------- Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index c99df16..b3435b0 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -887,9 +887,9 @@ popd cp nscd/nscd.conf %{buildroot}/etc mkdir -p %{buildroot}/etc/init.d ln -sf /sbin/service %{buildroot}/usr/sbin/rcnscd -mkdir -p %{buildroot}/var/run/nscd -touch %{buildroot}/var/run/nscd/{passwd,group,hosts,services,netgroup} -touch %{buildroot}/var/run/nscd/{socket,nscd.pid} +mkdir -p %{buildroot}/run/nscd +touch %{buildroot}/run/nscd/{passwd,group,hosts,services,netgroup} +touch %{buildroot}/run/nscd/{socket,nscd.pid} # # Create ld.so.conf @@ -971,7 +971,7 @@ rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile rm -f %{buildroot}/etc/*nscd* %{buildroot}%{_sbindir}/*nscd* rm -rf %{buildroot}/usr/lib/systemd rm -rf %{buildroot}/usr/lib/tmpfiles.d -rm -rf %{buildroot}/var/run/nscd +rm -rf %{buildroot}/run/nscd %endif # i686 %endif # %{normal_build} @@ -1021,7 +1021,7 @@ done %pre -n nscd getent group nscd >/dev/null || %{_sbindir}/groupadd -r nscd -getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /var/run/nscd nscd +getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /run/nscd nscd %service_add_pre nscd.service %preun -n nscd @@ -1029,7 +1029,7 @@ getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nsc %post -n nscd %service_add_post nscd.service -mkdir -p /var/run/nscd +mkdir -p /run/nscd # Previously we had nscd.socket, remove it test -x /usr/bin/systemctl && /usr/bin/systemctl stop nscd.socket 2>/dev/null || : test -x /usr/bin/systemctl && /usr/bin/systemctl disable nscd.socket 2>/dev/null || : @@ -1274,14 +1274,14 @@ exit 0 /usr/lib/systemd/system/nscd.service %dir /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d/nscd.conf -%dir %attr(0755,root,root) %ghost /var/run/nscd -%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid -%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/passwd -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/group -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/hosts -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/services -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/netgroup +%dir %attr(0755,root,root) %ghost /run/nscd +%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/nscd.pid +%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/socket +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/passwd +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/group +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/hosts +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/services +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/netgroup %endif # !i686 %if %{build_profile} diff --git a/glibc-utils.changes b/glibc-utils.changes index a98fc17..5471994 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com + +- Use /run for nscd instead of /var/run. + ------------------------------------------------------------------- Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index 2c981c9..f6b9218 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -887,9 +887,9 @@ popd cp nscd/nscd.conf %{buildroot}/etc mkdir -p %{buildroot}/etc/init.d ln -sf /sbin/service %{buildroot}/usr/sbin/rcnscd -mkdir -p %{buildroot}/var/run/nscd -touch %{buildroot}/var/run/nscd/{passwd,group,hosts,services,netgroup} -touch %{buildroot}/var/run/nscd/{socket,nscd.pid} +mkdir -p %{buildroot}/run/nscd +touch %{buildroot}/run/nscd/{passwd,group,hosts,services,netgroup} +touch %{buildroot}/run/nscd/{socket,nscd.pid} # # Create ld.so.conf @@ -971,7 +971,7 @@ rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile rm -f %{buildroot}/etc/*nscd* %{buildroot}%{_sbindir}/*nscd* rm -rf %{buildroot}/usr/lib/systemd rm -rf %{buildroot}/usr/lib/tmpfiles.d -rm -rf %{buildroot}/var/run/nscd +rm -rf %{buildroot}/run/nscd %endif # i686 %endif # %{normal_build} @@ -1021,7 +1021,7 @@ done %pre -n nscd getent group nscd >/dev/null || %{_sbindir}/groupadd -r nscd -getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /var/run/nscd nscd +getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /run/nscd nscd %service_add_pre nscd.service %preun -n nscd @@ -1029,7 +1029,7 @@ getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nsc %post -n nscd %service_add_post nscd.service -mkdir -p /var/run/nscd +mkdir -p /run/nscd # Previously we had nscd.socket, remove it test -x /usr/bin/systemctl && /usr/bin/systemctl stop nscd.socket 2>/dev/null || : test -x /usr/bin/systemctl && /usr/bin/systemctl disable nscd.socket 2>/dev/null || : @@ -1274,14 +1274,14 @@ exit 0 /usr/lib/systemd/system/nscd.service %dir /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d/nscd.conf -%dir %attr(0755,root,root) %ghost /var/run/nscd -%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid -%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/passwd -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/group -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/hosts -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/services -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/netgroup +%dir %attr(0755,root,root) %ghost /run/nscd +%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/nscd.pid +%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/socket +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/passwd +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/group +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/hosts +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/services +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/netgroup %endif # !i686 %if %{build_profile} diff --git a/glibc.changes b/glibc.changes index a98fc17..5471994 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com + +- Use /run for nscd instead of /var/run. + ------------------------------------------------------------------- Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 3ea5f0c..5cff043 100644 --- a/glibc.spec +++ b/glibc.spec @@ -887,9 +887,9 @@ popd cp nscd/nscd.conf %{buildroot}/etc mkdir -p %{buildroot}/etc/init.d ln -sf /sbin/service %{buildroot}/usr/sbin/rcnscd -mkdir -p %{buildroot}/var/run/nscd -touch %{buildroot}/var/run/nscd/{passwd,group,hosts,services,netgroup} -touch %{buildroot}/var/run/nscd/{socket,nscd.pid} +mkdir -p %{buildroot}/run/nscd +touch %{buildroot}/run/nscd/{passwd,group,hosts,services,netgroup} +touch %{buildroot}/run/nscd/{socket,nscd.pid} # # Create ld.so.conf @@ -971,7 +971,7 @@ rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile rm -f %{buildroot}/etc/*nscd* %{buildroot}%{_sbindir}/*nscd* rm -rf %{buildroot}/usr/lib/systemd rm -rf %{buildroot}/usr/lib/tmpfiles.d -rm -rf %{buildroot}/var/run/nscd +rm -rf %{buildroot}/run/nscd %endif # i686 %endif # %{normal_build} @@ -1021,7 +1021,7 @@ done %pre -n nscd getent group nscd >/dev/null || %{_sbindir}/groupadd -r nscd -getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /var/run/nscd nscd +getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nscd" -s /sbin/nologin -d /run/nscd nscd %service_add_pre nscd.service %preun -n nscd @@ -1029,7 +1029,7 @@ getent passwd nscd >/dev/null || %{_sbindir}/useradd -r -g nscd -c "User for nsc %post -n nscd %service_add_post nscd.service -mkdir -p /var/run/nscd +mkdir -p /run/nscd # Previously we had nscd.socket, remove it test -x /usr/bin/systemctl && /usr/bin/systemctl stop nscd.socket 2>/dev/null || : test -x /usr/bin/systemctl && /usr/bin/systemctl disable nscd.socket 2>/dev/null || : @@ -1274,14 +1274,14 @@ exit 0 /usr/lib/systemd/system/nscd.service %dir /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d/nscd.conf -%dir %attr(0755,root,root) %ghost /var/run/nscd -%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid -%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/passwd -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/group -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/hosts -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/services -%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/netgroup +%dir %attr(0755,root,root) %ghost /run/nscd +%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/nscd.pid +%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/socket +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/passwd +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/group +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/hosts +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/services +%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /run/nscd/netgroup %endif # !i686 %if %{build_profile} diff --git a/nscd.conf b/nscd.conf index 1807bd5..2f409b0 100644 --- a/nscd.conf +++ b/nscd.conf @@ -1 +1 @@ -d /var/run/nscd 0755 root root +d /run/nscd 0755 root root From c85422d0b9c1094627fc2a4799beb62e565b61885524e1fa6da6d9ef9a3980d8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 16 Apr 2014 09:26:22 +0000 Subject: [PATCH 2/3] Accepting request 230302 from home:Andreas_Schwab:Factory - ibm-long-double-math.patch: Remove faulty assembler implementations of ceil, nearbyintl, roundl for IBM long double (bnc#873457, BZ #16701, BZ #16706, BZ #16707) OBS-URL: https://build.opensuse.org/request/show/230302 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=361 --- glibc-testsuite.changes | 7 + glibc-testsuite.spec | 3 + glibc-utils.changes | 7 + glibc-utils.spec | 3 + glibc.changes | 7 + glibc.spec | 3 + ibm-long-double-math.patch | 462 +++++++++++++++++++++++++++++++++++++ 7 files changed, 492 insertions(+) create mode 100644 ibm-long-double-math.patch diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 5471994..4d5ea88 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de + +- ibm-long-double-math.patch: Remove faulty assembler implementations of + ceil, nearbyintl, roundl for IBM long double (bnc#873457, BZ #16701, BZ + #16706, BZ #16707) + ------------------------------------------------------------------- Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index b3435b0..e12932d 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -248,6 +248,8 @@ Patch1006: getaddrinfo-uninit-result.patch Patch1007: ppc64-copysign.patch # PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) Patch1008: nextafterl-ibm-ldouble.patch +# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) +Patch1009: ibm-long-double-math.patch ### # Patches awaiting upstream approval @@ -473,6 +475,7 @@ rm nscd/s-stamp %patch1006 -p1 %patch1007 -p1 %patch1008 -p1 +%patch1009 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/glibc-utils.changes b/glibc-utils.changes index 5471994..4d5ea88 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de + +- ibm-long-double-math.patch: Remove faulty assembler implementations of + ceil, nearbyintl, roundl for IBM long double (bnc#873457, BZ #16701, BZ + #16706, BZ #16707) + ------------------------------------------------------------------- Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com diff --git a/glibc-utils.spec b/glibc-utils.spec index f6b9218..6d7ba57 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -247,6 +247,8 @@ Patch1006: getaddrinfo-uninit-result.patch Patch1007: ppc64-copysign.patch # PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) Patch1008: nextafterl-ibm-ldouble.patch +# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) +Patch1009: ibm-long-double-math.patch ### # Patches awaiting upstream approval @@ -473,6 +475,7 @@ rm nscd/s-stamp %patch1006 -p1 %patch1007 -p1 %patch1008 -p1 +%patch1009 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/glibc.changes b/glibc.changes index 5471994..4d5ea88 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de + +- ibm-long-double-math.patch: Remove faulty assembler implementations of + ceil, nearbyintl, roundl for IBM long double (bnc#873457, BZ #16701, BZ + #16706, BZ #16707) + ------------------------------------------------------------------- Tue Apr 15 11:00:59 UTC 2014 - aj@suse.com diff --git a/glibc.spec b/glibc.spec index 5cff043..98f1038 100644 --- a/glibc.spec +++ b/glibc.spec @@ -248,6 +248,8 @@ Patch1006: getaddrinfo-uninit-result.patch Patch1007: ppc64-copysign.patch # PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) Patch1008: nextafterl-ibm-ldouble.patch +# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) +Patch1009: ibm-long-double-math.patch ### # Patches awaiting upstream approval @@ -473,6 +475,7 @@ rm nscd/s-stamp %patch1006 -p1 %patch1007 -p1 %patch1008 -p1 +%patch1009 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/ibm-long-double-math.patch b/ibm-long-double-math.patch new file mode 100644 index 0000000..c34d2c3 --- /dev/null +++ b/ibm-long-double-math.patch @@ -0,0 +1,462 @@ +2014-03-14 Adhemerval Zanella + + [BZ #16707] + * sysdeps/powerpc/powerpc64/fpu/s_roundl.S: Remove wrong + implementation. + * math/libm-test.inc (round_test_data): Add more tests. + + [BZ #16706] + * sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S: Remove wrong + implementation. + * math/libm-test.inc (nearbyint_test_data): Add more tests. + + [BZ #16701] + * sysdeps/powerpc/powerpc64/fpu/s_ceill.S: Remove wrong + implementation. + * math/libm-test.inc (ceil_test_data): Add more tests. + +Index: glibc-2.19/math/libm-test.inc +=================================================================== +--- glibc-2.19.orig/math/libm-test.inc ++++ glibc-2.19/math/libm-test.inc +@@ -6000,6 +6000,15 @@ static const struct test_f_f_data ceil_t + TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L), + TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L), + ++ /* Check cases where first double is a exact integer higher than 2^52 and ++ the precision is determined by second long double for IBM long double. */ ++ TEST_f_f (ceil, 34503599627370498.515625L, 34503599627370499.0L), ++ TEST_f_f (ceil, -34503599627370498.515625L, -34503599627370498.0L), ++# if LDBL_MANT_DIG >= 106 ++ TEST_f_f (ceil, 1192568192774434123539907640624.484375L, 1192568192774434123539907640625.0L), ++ TEST_f_f (ceil, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), ++# endif ++ + TEST_f_f (ceil, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L), + TEST_f_f (ceil, 10141204801825835211973625643008.25L, 10141204801825835211973625643009.0L), + TEST_f_f (ceil, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L), +@@ -10495,6 +10504,16 @@ static const struct test_f_f_data nearby + TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0, NO_INEXACT_EXCEPTION), + TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0, NO_INEXACT_EXCEPTION), + #endif ++#ifdef TEST_LDOUBLE ++ /* Check cases where first double is a exact integer higher than 2^52 and ++ the precision is determined by second long double for IBM long double. */ ++ TEST_f_f (nearbyint, 34503599627370498.515625L, 34503599627370499.0L), ++ TEST_f_f (nearbyint, -34503599627370498.515625L, -34503599627370499.0L), ++# if LDBL_MANT_DIG >= 106 ++ TEST_f_f (nearbyint, 1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L), ++ TEST_f_f (nearbyint, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), ++# endif ++#endif + }; + + static void +@@ -11792,6 +11811,15 @@ static const struct test_f_f_data round_ + TEST_f_f (round, -72057594037927936.75L, -72057594037927937.0L), + TEST_f_f (round, -72057594037927937.5L, -72057594037927938.0L), + ++ /* Check cases where first double is a exact integer higher than 2^52 and ++ the precision is determined by second long double for IBM long double. */ ++ TEST_f_f (round, 34503599627370498.515625L, 34503599627370499.0L), ++ TEST_f_f (round, -34503599627370498.515625L, -34503599627370499.0L), ++# if LDBL_MANT_DIG >= 106 ++ TEST_f_f (round, 1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L), ++ TEST_f_f (round, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), ++# endif ++ + TEST_f_f (round, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L), + TEST_f_f (round, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L), + TEST_f_f (round, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L), +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_ceill.S +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_ceill.S ++++ /dev/null +@@ -1,132 +0,0 @@ +-/* s_ceill.S IBM extended format long double version. +- Copyright (C) 2004-2014 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +- .section ".toc","aw" +-.LC0: /* 2**52 */ +- .tc FD_43300000_0[TC],0x4330000000000000 +- +- .section ".text" +- +-/* long double [fp1,fp2] ceill (long double x [fp1,fp2]) +- IEEE 1003.1 ceil function. +- +- PowerPC64 long double uses the IBM extended format which is +- represented two 64-floating point double values. The values are +- non-overlapping giving an effective precision of 106 bits. The first +- double contains the high order bits of mantissa and is always ceiled +- to represent a normal ceiling of long double to double. Since the +- long double value is sum of the high and low values, the low double +- normally has the opposite sign to compensate for the this ceiling. +- +- For long double there are two cases: +- 1) |x| < 2**52, all the integer bits are in the high double. +- ceil the high double and set the low double to -0.0. +- 2) |x| >= 2**52, ceiling involves both doubles. +- See the comment before label .L2 for details. +- */ +- +-ENTRY (__ceill) +- mffs fp11 /* Save current FPU rounding mode. */ +- lfd fp13,.LC0@toc(2) +- fabs fp0,fp1 +- fabs fp9,fp2 +- fsub fp12,fp13,fp13 /* generate 0.0 */ +- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ +- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ +- bnl- cr7,.L2 +- mtfsfi 7,2 /* Set rounding mode toward +inf. */ +- fneg fp2,fp12 +- ble- cr6,.L1 +- fadd fp1,fp1,fp13 /* x+= TWO52; */ +- fsub fp1,fp1,fp13 /* x-= TWO52; */ +- fabs fp1,fp1 /* if (x == 0.0) */ +-.L0: +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- blr /* x = 0.0; */ +-.L1: +- bge- cr6,.L0 /* if (x < 0.0) */ +- fsub fp1,fp1,fp13 /* x-= TWO52; */ +- fadd fp1,fp1,fp13 /* x+= TWO52; */ +- fcmpu cr5,fp1,fp12 /* if (x > 0.0) */ +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- fnabs fp1,fp1 /* if (x == 0.0) */ +- blr /* x = -0.0; */ +- +-/* The high double is > TWO52 so we need to round the low double and +- perhaps the high double. In this case we have to round the low +- double and handle any adjustment to the high double that may be +- caused by rounding (up). This is complicated by the fact that the +- high double may already be rounded and the low double may have the +- opposite sign to compensate.This gets a bit tricky so we use the +- following algorithm: +- +- tau = floor(x_high/TWO52); +- x0 = x_high - tau; +- x1 = x_low + tau; +- r1 = rint(x1); +- y_high = x0 + r1; +- y_low = x0 - y_high + r1; +- return y; */ +-.L2: +- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ +- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ +- fcmpu cr5,fp2,fp12 /* if (x_low > 0.0) */ +- bgelr- cr7 /* return x; */ +- beqlr- cr0 +- mtfsfi 7,2 /* Set rounding mode toward +inf. */ +- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ +- +- bng- cr6,.L6 /* if (x > 0.0) */ +- fctidz fp0,fp8 +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- bng cr5,.L4 /* if (x_low > 0.0) */ +- fmr fp3,fp1 +- fmr fp4,fp2 +- b .L5 +-.L4: /* if (x_low < 0.0) */ +- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ +- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ +-.L5: +- fadd fp5,fp4,fp13 /* r1 = r1 + TWO52; */ +- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ +- b .L9 +-.L6: /* if (x < 0.0) */ +- fctidz fp0,fp8 +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- bnl cr5,.L7 /* if (x_low < 0.0) */ +- fmr fp3,fp1 +- fmr fp4,fp2 +- b .L8 +-.L7: /* if (x_low > 0.0) */ +- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ +- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ +-.L8: +- fsub fp5,fp4,fp13 /* r1-= TWO52; */ +- fadd fp5,fp5,fp13 /* r1+= TWO52; */ +-.L9: +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ +- fsub fp2,fp3,fp1 /* y_low = x0 - y_high + r1; */ +- fadd fp2,fp2,fp5 +- blr +-END (__ceill) +- +-long_double_symbol (libm, __ceill, ceill) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S ++++ /dev/null +@@ -1,113 +0,0 @@ +-/* nearbyint long double. +- IBM extended format long double version. +- Copyright (C) 2004-2014 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +- .section ".toc","aw" +-.LC0: /* 2**52 */ +- .tc FD_43300000_0[TC],0x4330000000000000 +- .section ".text" +- +-/* long double [fp1,fp2] nearbyintl (long double x [fp1,fp2]) +- IEEE 1003.1 nearbyintl function. nearbyintl is similar to the rintl +- but does raise the "inexact" exception. This implementation is +- based on rintl but explicitly masks the inexact exception on entry +- and clears any pending inexact before restoring the exception mask +- on exit. +- +- PowerPC64 long double uses the IBM extended format which is +- represented two 64-floating point double values. The values are +- non-overlapping giving an effective precision of 106 bits. The first +- double contains the high order bits of mantissa and is always rounded +- to represent a normal rounding of long double to double. Since the +- long double value is sum of the high and low values, the low double +- normally has the opposite sign to compensate for the this rounding. +- +- For long double there are two cases: +- 1) |x| < 2**52, all the integer bits are in the high double. +- floor the high double and set the low double to -0.0. +- 2) |x| >= 2**52, Rounding involves both doubles. +- See the comment before label .L2 for details. +- */ +-ENTRY (__nearbyintl) +- mffs fp11 /* Save current FPSCR. */ +- lfd fp13,.LC0@toc(2) +- fabs fp0,fp1 +- mtfsb0 28 /* Disable "inexact" exceptions. */ +- fsub fp12,fp13,fp13 /* generate 0.0 */ +- fabs fp9,fp2 +- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ +- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ +- bnl- cr7,.L2 +- fmr fp2,fp12 +- bng- cr6,.L4 +- fadd fp1,fp1,fp13 /* x+= TWO52; */ +- fsub fp1,fp1,fp13 /* x-= TWO52; */ +- b .L9 +-.L4: +- bnl- cr6,.L9 /* if (x < 0.0) */ +- fsub fp1,fp13,fp1 /* x = TWO52 - x; */ +- fsub fp0,fp1,fp13 /* x = - (x - TWO52); */ +- fneg fp1,fp0 +-.L9: +- mtfsb0 6 /* Clear any pending "inexact" exceptions. */ +- mtfsf 0x01,fp11 /* restore exception mask. */ +- blr +- +-/* The high double is > TWO52 so we need to round the low double and +- perhaps the high double. This gets a bit tricky so we use the +- following algorithm: +- +- tau = floor(x_high/TWO52); +- x0 = x_high - tau; +- x1 = x_low + tau; +- r1 = nearbyint(x1); +- y_high = x0 + r1; +- y_low = r1 - tau; +- return y; */ +-.L2: +- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ +- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ +- bge- cr7,.L9 /* return x; */ +- beq- cr0,.L9 +- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ +- fctidz fp0,fp8 +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ +- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ +- +- fcmpu cr6,fp4,fp12 /* if (x1 > 0.0) */ +- bng- cr6,.L8 +- fadd fp5,fp4,fp13 /* r1 = x1 + TWO52; */ +- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ +- b .L6 +-.L8: +- fmr fp5,fp4 +- bge- cr6,.L6 /* if (x1 < 0.0) */ +- fsub fp5,fp13,fp4 /* r1 = TWO52 - x1; */ +- fsub fp0,fp5,fp13 /* r1 = - (r1 - TWO52); */ +- fneg fp5,fp0 +-.L6: +- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ +- fsub fp2,fp5,fp8 /* y_low = r1 - tau; */ +- b .L9 +-END (__nearbyintl) +- +-long_double_symbol (libm, __nearbyintl, nearbyintl) +Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_roundl.S +=================================================================== +--- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_roundl.S ++++ /dev/null +@@ -1,132 +0,0 @@ +-/* long double round function. +- IBM extended format long double version. +- Copyright (C) 2004-2014 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +- .section ".toc","aw" +-.LC0: /* 2**52 */ +- .tc FD_43300000_0[TC],0x4330000000000000 +-.LC1: /* 0.5 */ +- .tc FD_3fe00000_0[TC],0x3fe0000000000000 +- .section ".text" +- +-/* long double [fp1,fp2] roundl (long double x [fp1,fp2]) +- IEEE 1003.1 round function. IEEE specifies "round to the nearest +- integer value, rounding halfway cases away from zero, regardless of +- the current rounding mode." However PowerPC Architecture defines +- "Round to Nearest" as "Choose the best approximation. In case of a +- tie, choose the one that is even (least significant bit o).". +- So we can't use the PowerPC "Round to Nearest" mode. Instead we set +- "Round toward Zero" mode and round by adding +-0.5 before rounding +- to the integer value. */ +- +-ENTRY (__roundl) +- mffs fp11 /* Save current FPU rounding mode. */ +- lfd fp13,.LC0@toc(2) +- fabs fp0,fp1 +- fabs fp9,fp2 +- fsub fp12,fp13,fp13 /* generate 0.0 */ +- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ +- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ +- bnl- cr7,.L2 +- mtfsfi 7,1 /* Set rounding mode toward 0. */ +- lfd fp10,.LC1@toc(2) +- ble- cr6,.L1 +- fneg fp2,fp12 +- fadd fp1,fp1,fp10 /* x+= 0.5; */ +- fadd fp1,fp1,fp13 /* x+= TWO52; */ +- fsub fp1,fp1,fp13 /* x-= TWO52; */ +- fabs fp1,fp1 /* if (x == 0.0) x = 0.0; */ +-.L0: +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- blr +-.L1: +- fsub fp9,fp1,fp10 /* x-= 0.5; */ +- fneg fp2,fp12 +- bge- cr6,.L0 /* if (x < 0.0) */ +- fsub fp1,fp9,fp13 /* x-= TWO52; */ +- fadd fp1,fp1,fp13 /* x+= TWO52; */ +- fnabs fp1,fp1 /* if (x == 0.0) x = -0.0; */ +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- blr +- +-/* The high double is > TWO52 so we need to round the low double and +- perhaps the high double. In this case we have to round the low +- double and handle any adjustment to the high double that may be +- caused by rounding (up). This is complicated by the fact that the +- high double may already be rounded and the low double may have the +- opposite sign to compensate.This gets a bit tricky so we use the +- following algorithm: +- +- tau = floor(x_high/TWO52); +- x0 = x_high - tau; +- x1 = x_low + tau; +- r1 = rint(x1); +- y_high = x0 + r1; +- y_low = x0 - y_high + r1; +- return y; */ +-.L2: +- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ +- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ +- fcmpu cr5,fp2,fp12 /* if (x_low > 0.0) */ +- lfd fp10,.LC1@toc(2) +- bgelr- cr7 /* return x; */ +- beqlr- cr0 +- mtfsfi 7,1 /* Set rounding mode toward 0. */ +- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ +- +- bng- cr6,.L6 /* if (x > 0.0) */ +- fctidz fp0,fp8 +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- bng cr5,.L4 /* if (x_low > 0.0) */ +- fmr fp3,fp1 +- fmr fp4,fp2 +- b .L5 +-.L4: /* if (x_low < 0.0) */ +- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ +- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ +-.L5: +- fadd fp5,fp4,fp10 /* r1 = x1 + 0.5; */ +- fadd fp5,fp5,fp13 /* r1 = r1 + TWO52; */ +- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ +- b .L9 +-.L6: /* if (x < 0.0) */ +- fctidz fp0,fp8 +- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ +- bnl cr5,.L7 /* if (x_low < 0.0) */ +- fmr fp3,fp1 +- fmr fp4,fp2 +- b .L8 +-.L7: /* if (x_low > 0.0) */ +- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ +- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ +-.L8: +- fsub fp5,fp4,fp10 /* r1 = x1 - 0.5; */ +- fsub fp5,fp5,fp13 /* r1-= TWO52; */ +- fadd fp5,fp5,fp13 /* r1+= TWO52; */ +-.L9: +- mtfsf 0x01,fp11 /* restore previous rounding mode. */ +- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ +- fsub fp2,fp3,fp1 /* y_low = x0 - y_high + r1; */ +- fadd fp2,fp2,fp5 +- blr +-END (__roundl) +- +-long_double_symbol (libm, __roundl, roundl) From 96e20a41d7738eaaa8619ad9ccd4f869aeb0e95ce95e4397915f1b89c09effa2 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 17 Apr 2014 14:02:34 +0000 Subject: [PATCH 3/3] Accepting request 230484 from home:Andreas_Schwab:Factory - ibm-long-double-frexpl.patch: Correct IBM long double frexpl (bnc#872573, BZ #16740, BZ #16619) OBS-URL: https://build.opensuse.org/request/show/230484 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=362 --- glibc-testsuite.changes | 6 ++ glibc-testsuite.spec | 9 +- glibc-utils.changes | 6 ++ glibc-utils.spec | 9 +- glibc.changes | 6 ++ glibc.spec | 9 +- ibm-long-double-frexpl.patch | 194 +++++++++++++++++++++++++++++++++++ 7 files changed, 230 insertions(+), 9 deletions(-) create mode 100644 ibm-long-double-frexpl.patch diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 4d5ea88..8292fd9 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de + +- ibm-long-double-frexpl.patch: Correct IBM long double frexpl + (bnc#872573, BZ #16740, BZ #16619) + ------------------------------------------------------------------- Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index e12932d..1bd53a8 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -250,6 +250,10 @@ Patch1007: ppc64-copysign.patch Patch1008: nextafterl-ibm-ldouble.patch # PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) Patch1009: ibm-long-double-math.patch +# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) +Patch1010: ibm-long-double-frexpl.patch +# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) +Patch1011: aarch64-setcontext.patch ### # Patches awaiting upstream approval @@ -264,8 +268,6 @@ Patch2002: ldd-system-interp.patch Patch2003: abort-no-flush.patch # PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) Patch2004: pthread-mutex-trylock-elision.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch2005: aarch64-setcontext.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -476,13 +478,14 @@ rm nscd/s-stamp %patch1007 -p1 %patch1008 -p1 %patch1009 -p1 +%patch1010 -p1 +%patch1011 -p1 %patch2000 -p1 %patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 -%patch2005 -p1 %patch3000 diff --git a/glibc-utils.changes b/glibc-utils.changes index 4d5ea88..8292fd9 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de + +- ibm-long-double-frexpl.patch: Correct IBM long double frexpl + (bnc#872573, BZ #16740, BZ #16619) + ------------------------------------------------------------------- Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index 6d7ba57..03d3165 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -249,6 +249,10 @@ Patch1007: ppc64-copysign.patch Patch1008: nextafterl-ibm-ldouble.patch # PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) Patch1009: ibm-long-double-math.patch +# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) +Patch1010: ibm-long-double-frexpl.patch +# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) +Patch1011: aarch64-setcontext.patch ### # Patches awaiting upstream approval @@ -263,8 +267,6 @@ Patch2002: ldd-system-interp.patch Patch2003: abort-no-flush.patch # PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) Patch2004: pthread-mutex-trylock-elision.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch2005: aarch64-setcontext.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -476,13 +478,14 @@ rm nscd/s-stamp %patch1007 -p1 %patch1008 -p1 %patch1009 -p1 +%patch1010 -p1 +%patch1011 -p1 %patch2000 -p1 %patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 -%patch2005 -p1 %patch3000 diff --git a/glibc.changes b/glibc.changes index 4d5ea88..8292fd9 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de + +- ibm-long-double-frexpl.patch: Correct IBM long double frexpl + (bnc#872573, BZ #16740, BZ #16619) + ------------------------------------------------------------------- Tue Apr 15 14:23:54 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 98f1038..1673831 100644 --- a/glibc.spec +++ b/glibc.spec @@ -250,6 +250,10 @@ Patch1007: ppc64-copysign.patch Patch1008: nextafterl-ibm-ldouble.patch # PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) Patch1009: ibm-long-double-math.patch +# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) +Patch1010: ibm-long-double-frexpl.patch +# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) +Patch1011: aarch64-setcontext.patch ### # Patches awaiting upstream approval @@ -264,8 +268,6 @@ Patch2002: ldd-system-interp.patch Patch2003: abort-no-flush.patch # PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) Patch2004: pthread-mutex-trylock-elision.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch2005: aarch64-setcontext.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -476,13 +478,14 @@ rm nscd/s-stamp %patch1007 -p1 %patch1008 -p1 %patch1009 -p1 +%patch1010 -p1 +%patch1011 -p1 %patch2000 -p1 %patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 -%patch2005 -p1 %patch3000 diff --git a/ibm-long-double-frexpl.patch b/ibm-long-double-frexpl.patch new file mode 100644 index 0000000..5b1e3b8 --- /dev/null +++ b/ibm-long-double-frexpl.patch @@ -0,0 +1,194 @@ +2014-04-16 Alan Modra + + [BZ #16740] + [BZ #16619] + * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite. + * math/libm-test.inc (frexp_test_data): Add tests. + +Index: glibc-2.19/math/libm-test.inc +=================================================================== +--- glibc-2.19.orig/math/libm-test.inc ++++ glibc-2.19/math/libm-test.inc +@@ -8723,6 +8723,15 @@ static const struct test_f_f1_data frexp + + TEST_fI_f1 (frexp, 12.8L, 0.8L, 4, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, -27.34L, -0.854375L, 5, NO_INEXACT_EXCEPTION), ++ ++#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106 ++ TEST_fI_f1 (frexp, 1.0L-0x1p-106L, 1.0L-0x1p-106L, 0, NO_INEXACT_EXCEPTION), ++ TEST_fI_f1 (frexp, 1.0L, 0.5L, 1, NO_INEXACT_EXCEPTION), ++ TEST_fI_f1 (frexp, 1.0L+0x1p-105L, 0.5L+0x1p-106L, 1, NO_INEXACT_EXCEPTION), ++ TEST_fI_f1 (frexp, -1.0L+0x1p-106L, -1.0L+0x1p-106L, 0, NO_INEXACT_EXCEPTION), ++ TEST_fI_f1 (frexp, -1.0L, -0.5L, 1, NO_INEXACT_EXCEPTION), ++ TEST_fI_f1 (frexp, -1.0L-0x1p-105L, -0.5L-0x1p-106L, 1, NO_INEXACT_EXCEPTION), ++#endif + }; + + static void +Index: glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c +=================================================================== +--- glibc-2.19.orig/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c ++++ glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c +@@ -31,57 +31,115 @@ static char rcsid[] = "$NetBSD: $"; + #include + #include + +-static const long double +-two107 = 162259276829213363391578010288128.0; /* 0x4670000000000000, 0 */ +- + long double __frexpl(long double x, int *eptr) + { +- uint64_t hx, lx, ix, ixl; +- int64_t explo; +- double xhi, xlo; +- +- ldbl_unpack (x, &xhi, &xlo); +- EXTRACT_WORDS64 (hx, xhi); +- EXTRACT_WORDS64 (lx, xlo); +- ixl = 0x7fffffffffffffffULL&lx; +- ix = 0x7fffffffffffffffULL&hx; +- *eptr = 0; +- if(ix>=0x7ff0000000000000ULL||ix==0) return x; /* 0,inf,nan */ +- if (ix<0x0010000000000000ULL) { /* subnormal */ +- x *= two107; +- xhi = ldbl_high (x); +- EXTRACT_WORDS64 (hx, xhi); +- ix = hx&0x7fffffffffffffffULL; +- *eptr = -107; ++ uint64_t hx, lx, ix, ixl; ++ int64_t explo, expon; ++ double xhi, xlo; ++ ++ ldbl_unpack (x, &xhi, &xlo); ++ EXTRACT_WORDS64 (hx, xhi); ++ EXTRACT_WORDS64 (lx, xlo); ++ ixl = 0x7fffffffffffffffULL & lx; ++ ix = 0x7fffffffffffffffULL & hx; ++ expon = 0; ++ if (ix >= 0x7ff0000000000000ULL || ix == 0) ++ { ++ /* 0,inf,nan. */ ++ *eptr = expon; ++ return x; ++ } ++ expon = ix >> 52; ++ if (expon == 0) ++ { ++ /* Denormal high double, the low double must be 0.0. */ ++ int cnt; ++ ++ /* Normalize. */ ++ if (sizeof (ix) == sizeof (long)) ++ cnt = __builtin_clzl (ix); ++ else if ((ix >> 32) != 0) ++ cnt = __builtin_clzl ((long) (ix >> 32)); ++ else ++ cnt = __builtin_clzl ((long) ix) + 32; ++ cnt = cnt - 12; ++ expon -= cnt; ++ ix <<= cnt + 1; ++ } ++ expon -= 1022; ++ ix &= 0x000fffffffffffffULL; ++ hx &= 0x8000000000000000ULL; ++ hx |= (1022LL << 52) | ix; ++ ++ if (ixl != 0) ++ { ++ /* If the high double is an exact power of two and the low ++ double has the opposite sign, then the exponent calculated ++ from the high double is one too big. */ ++ if (ix == 0 ++ && (int64_t) (hx ^ lx) < 0) ++ { ++ hx += 1L << 52; ++ expon -= 1; ++ } ++ ++ explo = ixl >> 52; ++ if (explo == 0) ++ { ++ /* The low double started out as a denormal. Normalize its ++ mantissa and adjust the exponent. */ ++ int cnt; ++ ++ if (sizeof (ixl) == sizeof (long)) ++ cnt = __builtin_clzl (ixl); ++ else if ((ixl >> 32) != 0) ++ cnt = __builtin_clzl ((long) (ixl >> 32)); ++ else ++ cnt = __builtin_clzl ((long) ixl) + 32; ++ cnt = cnt - 12; ++ explo -= cnt; ++ ixl <<= cnt + 1; ++ } ++ ++ /* With variable precision we can't assume much about the ++ magnitude of the returned low double. It may even be a ++ denormal. */ ++ explo -= expon; ++ ixl &= 0x000fffffffffffffULL; ++ lx &= 0x8000000000000000ULL; ++ if (explo <= 0) ++ { ++ /* Handle denormal low double. */ ++ if (explo > -52) ++ { ++ ixl |= 1LL << 52; ++ ixl >>= 1 - explo; ++ } ++ else ++ { ++ ixl = 0; ++ lx = 0; ++ if ((hx & 0x7ff0000000000000ULL) == (1023LL << 52)) ++ { ++ /* Oops, the adjustment we made above for values a ++ little smaller than powers of two turned out to ++ be wrong since the returned low double will be ++ zero. This can happen if the input was ++ something weird like 0x1p1000 - 0x1p-1000. */ ++ hx -= 1L << 52; ++ expon += 1; ++ } ++ } ++ explo = 0; + } +- *eptr += (ix>>52)-1022; ++ lx |= (explo << 52) | ixl; ++ } + +- if (ixl != 0ULL) { +- explo = (ixl>>52) - (ix>>52) + 0x3fe; +- if ((ixl&0x7ff0000000000000ULL) == 0LL) { +- /* the lower double is a denormal so we need to correct its +- mantissa and perhaps its exponent. */ +- int cnt; +- +- if (sizeof (ixl) == sizeof (long)) +- cnt = __builtin_clzl (ixl); +- else if ((ixl >> 32) != 0) +- cnt = __builtin_clzl ((long) (ixl >> 32)); +- else +- cnt = __builtin_clzl ((long) ixl) + 32; +- cnt = cnt - 12; +- lx = (lx&0x8000000000000000ULL) | ((explo-cnt)<<52) +- | ((ixl<<(cnt+1))&0x000fffffffffffffULL); +- } else +- lx = (lx&0x800fffffffffffffULL) | (explo<<52); +- } else +- lx = 0ULL; +- +- hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL; +- INSERT_WORDS64 (xhi, hx); +- INSERT_WORDS64 (xlo, lx); +- x = ldbl_pack (xhi, xlo); +- return x; ++ INSERT_WORDS64 (xhi, hx); ++ INSERT_WORDS64 (xlo, lx); ++ x = ldbl_pack (xhi, xlo); ++ *eptr = expon; ++ return x; + } + #ifdef IS_IN_libm + long_double_symbol (libm, __frexpl, frexpl);