Skip to content

Commit

Permalink
Updated to fedora-glibc-20080411T1934
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Jelinek committed Apr 11, 2008
1 parent 6fd3c3f commit a346458
Show file tree
Hide file tree
Showing 31 changed files with 740 additions and 369 deletions.
61 changes: 61 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
2007-11-20 Ryan S. Arnold <rsa@us.ibm.com>

[BZ #4997]
* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Fixed erroneous
result when x is +/-nextafter(+/-0.5,-/+1) i.e. all 1's in the
mantissa.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
Likewise. Also account for when x is an odd number between 2^52
and 2^53-1.
* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
* math/libm-test.inc (lround_test, llround_test): Added test cases to
detect aforementioned erroneous conditions.

2008-04-11 Jakub Jelinek <jakub@redhat.com>

* configure.in: Check for -fno-section-anchors in addition to
-fno-toplevel-reorder.

2008-04-11 Ulrich Drepper <drepper@redhat.com>

* include/features.h (__GLIBC_MINOR__): Bump to 8.

* sysdeps/powerpc/powerpc32/fpu/s_lroundf.S: Remove duplicate comment.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S: Likewise.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_lrint.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_lround.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_lroundf.S: Likewise.

2008-04-11 Jakub Jelinek <jakub@redhat.com>

[BZ #5443]
* time/era.c: Transform __libc_setlocale_lock into rwlock.
* time/alt_digit.c: Likewise.
* wcsmbs/wcsmbsload.c: Likewise.

2008-04-10 Ulrich Drepper <drepper@redhat.com>

* version.h (VERSION): Bump to 2.8.

* timzeone/asia: Update from tzdata2008b.
* timezone/backward: Likewise.
* timezone/europe: Likewise.
* timezone/northamerica: Likewise.
* timezone/southamerica: Likewise.
* timezone/iso3166.tab: Likewise.
* timezone/leapseconds: Likewise.
* timezone/zone.tab: Likewise.
* timezone/private.h: Update from tzcode2008a.
* timezone/zdump.c: Likewise.
* timezone/zic.c: Likewise.

2008-01-24 Steven Munroe <sjmunroe@us.ibm.com>

[BZ #5741]
* sysdeps/powerpc/powerpc64/dl-machine.h (PPC_DCBT, PPC_DCBF):
Define additonal Data Cache Block instruction macros.
(elf_machine_fixup_plt): Add dcbt for opd and plt entries.
Replace dcbst with dcbf and sync with sync/isync.

2008-02-21 Alan Modra <amodra@bigpond.net.au>

* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_type_class):
Expand Down
10 changes: 5 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5067,7 +5067,7 @@ echo "$as_me: WARNING:
if test -n "$sysheaders"; then
SYSINCLUDES=-nostdinc
for d in include include-fixed; do
i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
SYSINCLUDES="$SYSINCLUDES -isystem $i"
done
SYSINCLUDES="$SYSINCLUDES \
Expand Down Expand Up @@ -6411,15 +6411,15 @@ echo "${ECHO_T}$libc_cv_hashstyle" >&6; }
fi
{ echo "$as_me:$LINENO: checking for -fno-toplevel-reorder" >&5
echo $ECHO_N "checking for -fno-toplevel-reorder... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking for -fno-toplevel-reorder -fno-section-anchors" >&5
echo $ECHO_N "checking for -fno-toplevel-reorder -fno-section-anchors... $ECHO_C" >&6; }
if test "${libc_cv_fno_toplevel_reorder+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat > conftest.c <<EOF
int foo;
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
conftest.c 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
Expand All @@ -6436,7 +6436,7 @@ fi
{ echo "$as_me:$LINENO: result: $libc_cv_fno_toplevel_reorder" >&5
echo "${ECHO_T}$libc_cv_fno_toplevel_reorder" >&6; }
if test $libc_cv_fno_toplevel_reorder = yes; then
fno_unit_at_a_time=-fno-toplevel-reorder
fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
else
fno_unit_at_a_time=-fno-unit-at-a-time
fi
Expand Down
6 changes: 3 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1614,11 +1614,11 @@ EOF
AC_SUBST(libc_cv_hashstyle)
fi

AC_CACHE_CHECK(for -fno-toplevel-reorder, libc_cv_fno_toplevel_reorder, [dnl
AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
cat > conftest.c <<EOF
int foo;
EOF
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fno-toplevel-reorder -fno-section-anchors
conftest.c 1>&AS_MESSAGE_LOG_FD])
then
libc_cv_fno_toplevel_reorder=yes
Expand All @@ -1627,7 +1627,7 @@ else
fi
rm -f conftest*])
if test $libc_cv_fno_toplevel_reorder = yes; then
fno_unit_at_a_time=-fno-toplevel-reorder
fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors"
else
fno_unit_at_a_time=-fno-unit-at-a-time
fi
Expand Down
4 changes: 2 additions & 2 deletions fedora/branch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ glibc-branch := fedora
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-f8
fedora-sync-date := 2008-04-10 19:07 UTC
fedora-sync-tag := fedora-glibc-20080410T1907
fedora-sync-date := 2008-04-11 19:34 UTC
fedora-sync-tag := fedora-glibc-20080411T1934
14 changes: 11 additions & 3 deletions fedora/glibc.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: @glibcversion@
Release: 15
Release: 16
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
Expand Down Expand Up @@ -976,18 +976,26 @@ rm -f *.filelist*
%endif

%changelog
* Fri Apr 11 2008 Jakub Jelinek <jakub@redhat.com> 2.7.90-16
- update to trunk
- misc fixes (BZ#4997, BZ#5741)
- make sure all users of __libc_setlocale_lock know it is
now a rwlock
- fix ppc/ppc64 compatibility _sys_errlist and _sys_siglist
symbols

* Thu Apr 10 2008 Jakub Jelinek <jakub@redhat.com> 2.7.90-15
- update to trunk
- misc fixes (BZ#4314, BZ#4407, BZ#5209, BZ#5436, BZ#5768, BZ#5998,
BZ#6024)
BZ#6024)
- restart sshd in %post when upstart is used - it doesn't have
/dev/initctl (#441763)
- disable assert checking again

* Tue Apr 8 2008 Jakub Jelinek <jakub@redhat.com> 2.7.90-14
- update to trunk
- misc fixes (BZ#5443, BZ#5475, BZ#5478, BZ#5939, BZ#5979, BZ#5995,
BZ#6004, BZ#6007, BZ#6020, BZ#6021, BZ#6042)
BZ#6004, BZ#6007, BZ#6020, BZ#6021, BZ#6042)
- change mtrace to keep perl 5.10 quiet (#441082)
- don't share conversion state between mbtowc and wctomb (#438687)
- if st_blksize is too large and malloc fails, retry with smaller
Expand Down
43 changes: 43 additions & 0 deletions math/libm-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4300,6 +4300,17 @@ lround_test (void)
# endif
TEST_f_l (lround, 2097152.5, 2097153);
TEST_f_l (lround, -2097152.5, -2097153);
/* nextafter(0.5,-1) */
TEST_f_l (lround, 0x1.fffffffffffffp-2, 0);
/* nextafter(-0.5,1) */
TEST_f_l (lround, -0x1.fffffffffffffp-2, 0);
#else
/* nextafter(0.5,-1) */
TEST_f_l (lround, 0x1.fffffp-2, 0);
/* nextafter(-0.5,1) */
TEST_f_l (lround, -0x1.fffffp-2, 0);
TEST_f_l (lround, 0x1.fffffep+23, 16777215);
TEST_f_l (lround, -0x1.fffffep+23, -16777215);
#endif
END (lround);
}
Expand Down Expand Up @@ -4359,8 +4370,40 @@ llround_test (void)
TEST_f_L (llround, 4294967295.5, 4294967296LL);
/* 0x200000000 */
TEST_f_L (llround, 8589934591.5, 8589934592LL);

/* nextafter(0.5,-1) */
TEST_f_L (llround, 0x1.fffffffffffffp-2, 0);
/* nextafter(-0.5,1) */
TEST_f_L (llround, -0x1.fffffffffffffp-2, 0);
/* On PowerPC an exponent of '52' is the largest incrementally
* representable sequence of whole-numbers in the 'double' range. We test
* lround to make sure that a guard bit set during the lround operation
* hasn't forced an erroneous shift giving us an incorrect result. The odd
* numbers between +-(2^52+1 and 2^53-1) are affected since they have the
* rightmost bit set. */
/* +-(2^52+1) */
TEST_f_L (llround, 0x1.0000000000001p+52,4503599627370497LL);
TEST_f_L (llround, -0x1.0000000000001p+52,-4503599627370497LL);
/* +-(2^53-1): Input is the last (positive and negative) incrementally
* representable whole-number in the 'double' range that might round
* erroneously. */
TEST_f_L (llround, 0x1.fffffffffffffp+52, 9007199254740991LL);
TEST_f_L (llround, -0x1.fffffffffffffp+52, -9007199254740991LL);
#else
/* nextafter(0.5,-1) */
TEST_f_L (llround, 0x1.fffffep-2, 0);
/* nextafter(-0.5,1) */
TEST_f_L (llround, -0x1.fffffep-2, 0);
/* As above, on PowerPC an exponent of '23' is the largest incrementally
* representable sequence of whole-numbers in the 'float' range.
* Likewise, numbers between +-(2^23+1 and 2^24-1) are affected. */
TEST_f_L (llround, 0x1.000002p+23,8388609);
TEST_f_L (llround, -0x1.000002p+23,-8388609);
TEST_f_L (llround, 0x1.fffffep+23, 16777215);
TEST_f_L (llround, -0x1.fffffep+23, -16777215);
#endif


#ifdef TEST_LDOUBLE
/* The input can only be represented in long double. */
TEST_f_L (llround, 4503599627370495.5L, 4503599627370496LL);
Expand Down
52 changes: 26 additions & 26 deletions sysdeps/powerpc/powerpc32/fpu/s_lround.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* lround function. PowerPC32 version.
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 2004, 2006, 2007 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
Expand All @@ -20,13 +20,10 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>

.section .rodata.cst8,"aM",@progbits,8
.section .rodata.cst4,"aM",@progbits,4
.align 2
.LC0: /* 0.0 */
.long 0x00000000
.LC1: /* 0.5 */
.LC0: /* 0.5 */
.long 0x3f000000

.section ".text"

/* long [r3] lround (float x [fp1])
Expand All @@ -37,7 +34,10 @@
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. */
to the integer value. It is necessary to detect when x is
(+-)0x1.fffffffffffffp-2 because adding +-0.5 in this case will
cause an erroneous shift, carry and round. We simply return 0 if
0.5 > x > -0.5. */

ENTRY (__lround)
stwu r1,-16(r1)
Expand All @@ -49,40 +49,40 @@ ENTRY (__lround)
bcl 20,31,1f
1: mflr r9
addis r9,r9,.LC0-1b@ha
addi r9,r9,.LC0-1b@l
lfs fp10,.LC0-1b@l(r9)
# else
bl _GLOBAL_OFFSET_TABLE_@local-4
mflr r10
lwz r9,.LC0@got(10)
lfs fp10,0(r9)
# endif
mtlr r11
cfi_same_value (lr)
lfs fp12,0(r9)
#else
lis r9,.LC0@ha
lfs fp12,.LC0@l(r9)
#endif
#ifdef SHARED
lfs fp10,.LC1-.LC0(r9)
#else
lis r9,.LC1@ha
lfs fp10,.LC1@l(r9)
lfs fp10,.LC0@l(r9)
#endif
fcmpu cr6,fp1,fp12 /* if (x > 0.0) */
ble- cr6,.L4
fadd fp1,fp1,fp10 /* x+= 0.5; */
.L9:
fctiwz fp2,fp1 /* Convert To Integer DW lround toward 0. */
stfd fp2,8(r1)
fabs fp2, fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0. */
fcmpu cr6, fp2, fp10 /* if |x| < 0.5 */
fcmpu cr3, fp1, fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
bge cr3,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
.Lconvert:
fctiwz fp4,fp3 /* Convert to Integer word lround toward 0. */
stfd fp4,8(r1)
nop /* Ensure the following load is in a different dispatch */
nop /* group to avoid pipe stall on POWER4&5. */
nop
lwz r3,12(r1)
lwz r3,12(r1) /* Load return as integer. */
.Lout:
addi r1,r1,16
blr
.L4:
fsub fp1,fp1,fp10 /* x-= 0.5; */
b .L9
.Lretzero: /* when 0.5 > x > -0.5 */
li r3,0 /* return 0. */
b .Lout
END (__lround)

weak_alias (__lround, lround)
Expand Down
1 change: 0 additions & 1 deletion sysdeps/powerpc/powerpc32/fpu/s_lroundf.S
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* __lroundf is in s_lround.S */
/* __lroundf is in s_lround.S */
Loading

0 comments on commit a346458

Please sign in to comment.