[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r19514 - in /fsf/trunk/libc: ./ math/ ports/ ports/sysdeps/mips/ sunrpc/ sysdeps/i386/fpu/ sysdeps/ieee754/flt-32/ sysdeps/p...



Author: eglibc
Date: Sat Jul  7 00:01:40 2012
New Revision: 19514

Log:
Import glibc-mainline for 2012-07-07

Added:
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/ports/ChangeLog.mips
    fsf/trunk/libc/ports/sysdeps/mips/dl-machine.h
    fsf/trunk/libc/sunrpc/rpc_clntout.c
    fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S
    fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/i386/fpu/s_expm1.S
    fsf/trunk/libc/sysdeps/i386/fpu/s_expm1f.S
    fsf/trunk/libc/sysdeps/ieee754/flt-32/k_tanf.c
    fsf/trunk/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/Makefile
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
    fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S
    fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Jul  7 00:01:40 2012
@@ -1,3 +1,49 @@
+2012-07-06  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	[BZ #14283]
+	* sysdeps/powerpc/fpu/k_rem_pio2f.c (__fp_kernel_rem_pio2f): Shift
+	by 7 not 8 to examine high bit of fractional part.
+
+	[BZ #14042]
+	* sysdeps/powerpc/powerpc32/ppc-mcount.S [SHARED]: Don't use PLT
+	for call to __mcount_internal.
+	* sysdeps/powerpc/powerpc32/Makefile (sysdep_routines)
+	(shared-only-routines) [$(subdir) = gmon]: Add compat-ppc-mcount.
+	* sysdeps/powerpc/powerpc32/compat-ppc-mcount.S: New file.
+
+2012-07-06  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #14154]
+	* sysdeps/ieee754/flt-32/k_tanf.c (__kernel_tanf): Use linear
+	approximation for values within 0x1p-13f of an odd multiple of
+	pi/4.
+	* math/libm-test.inc (tan_test): Do not allow spurious underflow
+	exception.  Add more tests.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+
+	[BZ #6778]
+	* sysdeps/i386/fpu/s_expm1.S (__expm1): Check for large negative
+	inputs and return -1 for them.  Do not check for +Inf in case not
+	reachable for +Inf.
+	* sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise.
+	* sysdeps/i386/fpu/e_expl.S [USE_AS_EXPM1L] (csat): Do not define.
+	(IEEE754_EXPL) [USE_AS_EXPM1L]: Check for large negative inputs
+	and return -1 for them.  Do not check for +Inf in case not
+	reachable for +Inf.
+	* sysdeps/x86_64/fpu/e_expl.S [USE_AS_EXPM1L] (csat): Do not
+	define.
+	(IEEE754_EXPL) [USE_AS_EXPM1L]: Check for large negative inputs
+	and return -1 for them.  Do not check for +Inf in case not
+	reachable for +Inf.
+	* math/libm-test.inc (expm1_test): Add more tests.  Do not allow
+	spurious underflow.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-07-06  Mike Frysinger  <vapier@xxxxxxxxxx>
+
+	* sunrpc/rpc_clntout.c: Change <rpc/types.h> to "rpc/types.h".
+
 2012-07-05  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #14157]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Jul  7 00:01:40 2012
@@ -9,7 +9,7 @@
 
 * The following bugs are resolved with this release:
 
-  14157, 14283, 14328, 14331
+  6778, 14042, 14154, 14157, 14283, 14328, 14331
 
 
 Version 2.16

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sat Jul  7 00:01:40 2012
@@ -4039,12 +4039,32 @@
   TEST_f_f (expm1, 11356.25L, 9.05128237311923300051376115753226014206e+4931L);
 #endif
 
+  TEST_f_f (expm1, -10.0, -0.9999546000702375151484644084844394493898L);
+  TEST_f_f (expm1, -16.0, -0.9999998874648252807408854862248209398728L);
+  TEST_f_f (expm1, -17.0, -0.9999999586006228121483334034897228104472L);
+  TEST_f_f (expm1, -18.0, -0.9999999847700202552873715638633707664826L);
+  TEST_f_f (expm1, -36.0, -0.9999999999999997680477169756430611687736L);
+  TEST_f_f (expm1, -37.0, -0.9999999999999999146695237425593420572195L);
+  TEST_f_f (expm1, -38.0, -0.9999999999999999686086720795197037129104L);
+  TEST_f_f (expm1, -44.0, -0.9999999999999999999221886775886620348429L);
+  TEST_f_f (expm1, -45.0, -0.9999999999999999999713748141945060635553L);
+  TEST_f_f (expm1, -46.0, -0.9999999999999999999894693826424461876212L);
+  TEST_f_f (expm1, -73.0, -0.9999999999999999999999999999999802074012L);
+  TEST_f_f (expm1, -74.0, -0.9999999999999999999999999999999927187098L);
+  TEST_f_f (expm1, -75.0, -0.9999999999999999999999999999999973213630L);
+  TEST_f_f (expm1, -78.0, -0.9999999999999999999999999999999998666385L);
+  TEST_f_f (expm1, -79.0, -0.9999999999999999999999999999999999509391L);
+  TEST_f_f (expm1, -80.0, -0.9999999999999999999999999999999999819515L);
+  TEST_f_f (expm1, -100.0, -1.0);
+  TEST_f_f (expm1, -1000.0, -1.0);
+  TEST_f_f (expm1, -10000.0, -1.0);
+  TEST_f_f (expm1, -100000.0, -1.0);
+
   errno = 0;
   TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION);
   check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
   TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION);
-  /* Bug 6778: spurious underflow exception.  */
-  TEST_f_f (expm1, -max_value, -1, UNDERFLOW_EXCEPTION_OK);
+  TEST_f_f (expm1, -max_value, -1);
 
   END (expm1);
 }
@@ -8385,12 +8405,49 @@
   TEST_f_f (tan, nan_value, nan_value);
   check_int ("errno for tan(NaN) == 0", errno, 0, 0, 0, 0);
 
-  /* Bug 14154: spurious exception may occur.  */
-  TEST_f_f (tan, M_PI_4l, 1, UNDERFLOW_EXCEPTION_OK_FLOAT);
+  TEST_f_f (tan, M_PI_4l, 1);
   TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
 
   TEST_f_f (tan, 0x1p65, -0.0472364872359047946798414219288370688827L);
   TEST_f_f (tan, -0x1p65, 0.0472364872359047946798414219288370688827L);
+
+  TEST_f_f (tan, 0xc.9p-4, 0.9995162902115457818029468900654150261381L);
+  TEST_f_f (tan, 0xc.908p-4, 0.9997603425502441410973077452249560802034L);
+  TEST_f_f (tan, 0xc.90cp-4, 0.9998823910588060302788513970802357770031L);
+  TEST_f_f (tan, 0xc.90ep-4, 0.9999434208994808753305784795924711152508L);
+  TEST_f_f (tan, 0xc.90fp-4, 0.9999739372166156702433266059635165160515L);
+  TEST_f_f (tan, 0xc.90f8p-4, 0.9999891957244072765118898375645469865764L);
+  TEST_f_f (tan, 0xc.90fcp-4, 0.9999968250656122402859679132395522927393L);
+  TEST_f_f (tan, 0xc.90fdp-4, 0.9999987324100083358016192309006353329444L);
+  TEST_f_f (tan, 0xc.90fd8p-4, 0.9999996860835706212861509874451585282616L);
+  TEST_f_f (tan, 0xc.90fdap-4, 0.9999999245021033010474530133665235922808L);
+  TEST_f_f (tan, 0xc.ap-4, 1.0073556597407272165371804539701396631519L);
+  TEST_f_f (tan, 0xc.98p-4, 1.0034282930863044654045449407466962736255L);
+  TEST_f_f (tan, 0xc.94p-4, 1.0014703786820082237342656561856877993328L);
+  TEST_f_f (tan, 0xc.92p-4, 1.0004928571392300571266638743539017593717L);
+  TEST_f_f (tan, 0xc.91p-4, 1.0000044544650244953647966900221905361131L);
+  TEST_f_f (tan, 0xc.90fep-4, 1.0000006397580424009014454926842136804016L);
+  TEST_f_f (tan, 0xc.90fdcp-4, 1.0000001629206928242190327320047489394217L);
+  TEST_f_f (tan, 0xc.90fdbp-4, 1.0000000437113909572052640953950483705005L);
+
+  TEST_f_f (tan, -0xc.9p-4, -0.9995162902115457818029468900654150261381L);
+  TEST_f_f (tan, -0xc.908p-4, -0.9997603425502441410973077452249560802034L);
+  TEST_f_f (tan, -0xc.90cp-4, -0.9998823910588060302788513970802357770031L);
+  TEST_f_f (tan, -0xc.90ep-4, -0.9999434208994808753305784795924711152508L);
+  TEST_f_f (tan, -0xc.90fp-4, -0.9999739372166156702433266059635165160515L);
+  TEST_f_f (tan, -0xc.90f8p-4, -0.9999891957244072765118898375645469865764L);
+  TEST_f_f (tan, -0xc.90fcp-4, -0.9999968250656122402859679132395522927393L);
+  TEST_f_f (tan, -0xc.90fdp-4, -0.9999987324100083358016192309006353329444L);
+  TEST_f_f (tan, -0xc.90fd8p-4, -0.9999996860835706212861509874451585282616L);
+  TEST_f_f (tan, -0xc.90fdap-4, -0.9999999245021033010474530133665235922808L);
+  TEST_f_f (tan, -0xc.ap-4, -1.0073556597407272165371804539701396631519L);
+  TEST_f_f (tan, -0xc.98p-4, -1.0034282930863044654045449407466962736255L);
+  TEST_f_f (tan, -0xc.94p-4, -1.0014703786820082237342656561856877993328L);
+  TEST_f_f (tan, -0xc.92p-4, -1.0004928571392300571266638743539017593717L);
+  TEST_f_f (tan, -0xc.91p-4, -1.0000044544650244953647966900221905361131L);
+  TEST_f_f (tan, -0xc.90fep-4, -1.0000006397580424009014454926842136804016L);
+  TEST_f_f (tan, -0xc.90fdcp-4, -1.0000001629206928242190327320047489394217L);
+  TEST_f_f (tan, -0xc.90fdbp-4, -1.0000000437113909572052640953950483705005L);
 
 #ifndef TEST_FLOAT
   TEST_f_f (tan, 1e22, -1.628778225606898878549375936939548513545L);

Modified: fsf/trunk/libc/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.mips (original)
+++ fsf/trunk/libc/ports/ChangeLog.mips Sat Jul  7 00:01:40 2012
@@ -1,3 +1,8 @@
+2012-07-06  Petar Jovanovic  <petar.jovanovic@xxxxxxxxx>
+
+	* sysdeps/mips/dl-machine.h (RTLD_START): Do not store data below
+	the stack pointer.
+
 2012-06-19  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/mips32/nptl/ld.abilist: Update

Modified: fsf/trunk/libc/ports/sysdeps/mips/dl-machine.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/mips/dl-machine.h (original)
+++ fsf/trunk/libc/ports/sysdeps/mips/dl-machine.h Sat Jul  7 00:01:40 2012
@@ -266,13 +266,14 @@
 	" STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
 	# Make sure the stack pointer is aligned for _dl_init_internal.\n\
 	and $2, $29, -2 * " STRINGXP(SZREG) "\n\
-	" STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\
+	move $8, $29\n\
 	" STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
+	" STRINGXP(PTR_S) " $8, (32 - " STRINGXP(SZREG) ")($29)\n\
 	" STRINGXP(SAVE_GP(16)) "\n\
 	# Call the function to run the initializers.\n\
 	jal _dl_init_internal\n\
 	# Restore the stack pointer for _start.\n\
-	" STRINGXP(PTR_L)  " $29, 32-" STRINGXP(SZREG) "($29)\n\
+	" STRINGXP(PTR_L)  " $29, (32 - " STRINGXP(SZREG) ")($29)\n\
 	# Pass our finalizer function to the user in $2 as per ELF ABI.\n\
 	" STRINGXP(PTR_LA) " $2, _dl_fini\n\
 	# Jump to the user entry point.\n\

Modified: fsf/trunk/libc/sunrpc/rpc_clntout.c
==============================================================================
--- fsf/trunk/libc/sunrpc/rpc_clntout.c (original)
+++ fsf/trunk/libc/sunrpc/rpc_clntout.c Sat Jul  7 00:01:40 2012
@@ -31,7 +31,7 @@
  */
 #include <stdio.h>
 #include <string.h>
-#include <rpc/types.h>
+#include "rpc/types.h"
 #include "rpc_parse.h"
 #include "rpc_util.h"
 #include "proto.h"

Modified: fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S Sat Jul  7 00:01:40 2012
@@ -60,10 +60,12 @@
 	.byte 0, 0, 0, 0, 0, 0
 	ASM_SIZE_DIRECTIVE(c1)
 #endif
+#ifndef USE_AS_EXPM1L
 	ASM_TYPE_DIRECTIVE(csat,@object)
 csat:	.byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
 	.byte 0, 0, 0, 0, 0, 0
 	ASM_SIZE_DIRECTIVE(csat)
+#endif
 
 #ifdef PIC
 # define MO(op) op##@GOTOFF(%ecx)
@@ -88,9 +90,26 @@
 #ifdef PIC
 	LOAD_PIC_REG (cx)
 #endif
-#ifndef USE_AS_EXPM1L
+#ifdef USE_AS_EXPM1L
+	xorb	$0x80, %ah
+	cmpl	$0xc006, %eax
+	fstsw	%ax
+	movb	$0x45, %dh
+	jb	4f
+
+	/* Below -64.0 (may be -NaN or -Inf). */
+	andb	%ah, %dh
+	cmpb	$0x01, %dh
+	je	2f		/* Is +-NaN, jump.  */
+	jmp	1f		/* -large, possibly -Inf.  */
+
+4:	/* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf).  */
+	/* Test for +-0 as argument.  */
+	andb	%ah, %dh
+	cmpb	$0x40, %dh
+	je	2f
+#else
 	movzwl	4+8(%esp), %eax
-#endif
 	andl	$0x7fff, %eax
 	cmpl	$0x400d, %eax
 	jle	3f
@@ -108,16 +127,8 @@
 	andb	$2, %ah
 	jz	3f
 	fchs
-3:
-#ifdef USE_AS_EXPM1L
-	/* Test for +-0 as argument.  */
-	fstsw	%ax
-	movb	$0x45, %dh
-	andb	%ah, %dh
-	cmpb	$0x40, %dh
-	je	2f
 #endif
-	FLDLOG			/* 1  log2(base)      */
+3:	FLDLOG			/* 1  log2(base)      */
 	fmul	%st(1), %st	/* 1  x log2(base)    */
 	frndint			/* 1  i               */
 	fld	%st(1)		/* 2  x               */
@@ -154,13 +165,16 @@
 #endif
 	fstp	%st(1)		/* 0  */
 	jmp	2f
-1:	testl	$0x200, %eax	/* Test sign.  */
-	jz	2f		/* If positive, jump.  */
+1:
+#ifdef USE_AS_EXPM1L
+	/* For expm1l, only negative sign gets here.  */
 	fstp	%st
-#ifdef USE_AS_EXPM1L
 	fld1
 	fchs
 #else
+	testl	$0x200, %eax	/* Test sign.  */
+	jz	2f		/* If positive, jump.  */
+	fstp	%st
 	fldz			/* Set result to 0.  */
 #endif
 2:	ret

Modified: fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps Sat Jul  7 00:01:40 2012
@@ -1779,6 +1779,9 @@
 ifloat: 1
 
 # expm1
+Test "expm1 (-45.0) == -0.9999999999999999999713748141945060635553":
+ildouble: 1
+ldouble: 1
 Test "expm1 (1) == M_El - 1.0":
 ildouble: 1
 Test "expm1 (11356.25) == 9.05128237311923300051376115753226014206e+4931":
@@ -2350,9 +2353,45 @@
 idouble: 1
 
 # tan
+Test "tan (-0xc.90fdbp-4) == -1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fdcp-4) == -1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fep-4) == -1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (-0xc.91p-4) == -1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (-0xc.92p-4) == -1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (-0xc.94p-4) == -1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
 Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575":
 ildouble: 1
 ldouble: 1
+Test "tan (0xc.90fdbp-4) == 1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fdcp-4) == 1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fep-4) == 1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (0xc.91p-4) == 1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (0xc.92p-4) == 1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (0xc.94p-4) == 1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
 Test "tan (1e22) == -1.628778225606898878549375936939548513545":
 ildouble: 1
 ldouble: 1

Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_expm1.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_expm1.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_expm1.S Sat Jul  7 00:01:40 2012
@@ -51,19 +51,31 @@
 	jae	HIDDEN_JUMPTARGET (__exp)
 
 	fldl	4(%esp)		// x
-	fxam			// Is NaN or +-Inf?
+	fxam			// Is NaN, +-Inf or +-0?
+	xorb	$0x80, %ah
+	cmpl	$0xc043, %eax	// is num <= -38.0?
 	fstsw	%ax
 	movb	$0x45, %ch
+	jb	4f
+
+	// Below -38.0 (may be -NaN or -Inf).
+	andb	%ah, %ch
+#ifdef	PIC
+	LOAD_PIC_REG (dx)
+#endif
+	cmpb	$0x01, %ch
+	je	5f		// If -NaN, jump.
+	jmp	2f		// -large, possibly -Inf.
+
+4:	// In range -38.0 to 704.0 (may be +-0 but not NaN or +-Inf).
 	andb	%ah, %ch
 	cmpb	$0x40, %ch
 	je	3f		// If +-0, jump.
 #ifdef	PIC
 	LOAD_PIC_REG (dx)
 #endif
-	cmpb	$0x05, %ch
-	je	2f		// If +-Inf, jump.
 
-	fldt	MO(l2e)		// log2(e) : x
+5:	fldt	MO(l2e)		// log2(e) : x
 	fmulp			// log2(e)*x
 	fld	%st		// log2(e)*x : log2(e)*x
 	frndint			// int(log2(e)*x) : log2(e)*x
@@ -79,9 +91,7 @@
 	fsubrp	%st, %st(1)	// 2^(log2(e)*x)
 	ret
 
-2:	testl	$0x200, %eax	// Test sign.
-	jz	3f		// If positive, jump.
-	fstp	%st
+2:	fstp	%st
 	fldl	MO(minus1)	// Set result to -1.0.
 3:	ret
 END(__expm1)

Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_expm1f.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_expm1f.S (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_expm1f.S Sat Jul  7 00:01:40 2012
@@ -51,19 +51,31 @@
 	jae	HIDDEN_JUMPTARGET (__expf)
 
 	flds	4(%esp)		// x
-	fxam			// Is NaN or +-Inf?
+	fxam			// Is NaN, +-Inf or +-0?
+	xorb	$0x80, %ah
+	cmpl	$0xc190, %eax	// is num <= -18.0?
 	fstsw	%ax
 	movb	$0x45, %ch
+	jb	4f
+
+	// Below -18.0 (may be -NaN or -Inf).
+	andb	%ah, %ch
+#ifdef	PIC
+	LOAD_PIC_REG (dx)
+#endif
+	cmpb	$0x01, %ch
+	je	5f		// If -NaN, jump.
+	jmp	2f		// -large, possibly -Inf.
+
+4:	// In range -18.0 to 88.5 (may be +-0 but not NaN or +-Inf).
 	andb	%ah, %ch
 	cmpb	$0x40, %ch
 	je	3f		// If +-0, jump.
 #ifdef	PIC
 	LOAD_PIC_REG (dx)
 #endif
-	cmpb	$0x05, %ch
-	je	2f		// If +-Inf, jump.
 
-	fldt	MO(l2e)		// log2(e) : x
+5:	fldt	MO(l2e)		// log2(e) : x
 	fmulp			// log2(e)*x
 	fld	%st		// log2(e)*x : log2(e)*x
 	frndint			// int(log2(e)*x) : log2(e)*x
@@ -79,9 +91,7 @@
 	fsubrp	%st, %st(1)	// 2^(log2(e)*x)
 	ret
 
-2:	testl	$0x200, %eax	// Test sign.
-	jz	3f		// If positive, jump.
-	fstp	%st
+2:	fstp	%st
 	fldl	MO(minus1)	// Set result to -1.0.
 3:	ret
 END(__expm1f)

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/k_tanf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/k_tanf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/k_tanf.c Sat Jul  7 00:01:40 2012
@@ -56,6 +56,8 @@
 	    z = pio4-x;
 	    w = pio4lo-y;
 	    x = z+w; y = 0.0;
+	    if (fabsf (x) < 0x1p-13f)
+		return (1 - ((hx >> 30) & 2)) * iy * (1.0f - 2 * iy * x);
 	}
 	z	=  x*x;
 	w 	=  z*z;

Modified: fsf/trunk/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c (original)
+++ fsf/trunk/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c Sat Jul  7 00:01:40 2012
@@ -1,5 +1,5 @@
 /* k_rem_pio2f.c -- float version of e_rem_pio2.c
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Adhemerval Zanella <azanella@xxxxxxxxxx>, 2011
 
@@ -153,7 +153,7 @@
       ih = iq[jz - 1] >> (7 - q0);
     }
   else if (q0 == 0)
-    ih = iq[jz - 1] >> 8;
+    ih = iq[jz - 1] >> 7;
   else if (z >= 0.5)
     ih = 2;
 

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/Makefile (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/Makefile Sat Jul  7 00:01:40 2012
@@ -6,8 +6,9 @@
 endif
 
 ifeq ($(subdir),gmon)
-sysdep_routines += ppc-mcount
+sysdep_routines += ppc-mcount compat-ppc-mcount
 static-only-routines += ppc-mcount
+shared-only-routines += compat-ppc-mcount
 endif
 
 ifeq ($(subdir),misc)

Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/compat-ppc-mcount.S Sat Jul  7 00:01:40 2012
@@ -1,0 +1,11 @@
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_15)
+
+	compat_text_section
+# define _mcount __compat_mcount
+# include "ppc-mcount.S"
+# undef _mcount
+
+compat_symbol (libc, __compat_mcount, _mcount, GLIBC_2_0)
+#endif

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S Sat Jul  7 00:01:40 2012
@@ -1,5 +1,5 @@
 /* PowerPC-specific implementation of profiling support.
-   Copyright (C) 1997, 1999, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 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
@@ -57,7 +57,11 @@
 	stw	r4, 44(r1)
 	cfi_offset (lr, -4)
 	stw	r5,  8(r1)
+#ifndef SHARED
 	bl	JUMPTARGET(__mcount_internal)
+#else
+	bl	__mcount_internal@local
+#endif
  /* Restore the registers...  */
 	lwz     r6,  8(r1)
 	lwz	r0, 44(r1)

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S Sat Jul  7 00:01:40 2012
@@ -60,10 +60,12 @@
 	.byte 0, 0, 0, 0, 0, 0
 	ASM_SIZE_DIRECTIVE(c1)
 #endif
+#ifndef USE_AS_EXPM1L
 	ASM_TYPE_DIRECTIVE(csat,@object)
 csat:	.byte 0, 0, 0, 0, 0, 0, 0, 0x80, 0x0e, 0x40
 	.byte 0, 0, 0, 0, 0, 0
 	ASM_SIZE_DIRECTIVE(csat)
+#endif
 
 #ifdef PIC
 # define MO(op) op##(%rip)
@@ -85,9 +87,26 @@
    For the i686 the code can be written better.
    -- drepper@xxxxxxxxxxx  */
 	fxam			/* Is NaN or +-Inf?  */
-#ifndef USE_AS_EXPM1L
+#ifdef USE_AS_EXPM1L
+	xorb	$0x80, %ah
+	cmpl	$0xc006, %eax
+	fstsw	%ax
+	movb	$0x45, %dh
+	jb	4f
+
+	/* Below -64.0 (may be -NaN or -Inf). */
+	andb	%ah, %dh
+	cmpb	$0x01, %dh
+	je	2f		/* Is +-NaN, jump.  */
+	jmp	1f		/* -large, possibly -Inf.  */
+
+4:	/* In range -64.0 to 64.0 (may be +-0 but not NaN or +-Inf).  */
+	/* Test for +-0 as argument.  */
+	andb	%ah, %dh
+	cmpb	$0x40, %dh
+	je	2f
+#else
 	movzwl	8+8(%rsp), %eax
-#endif
 	andl	$0x7fff, %eax
 	cmpl	$0x400d, %eax
 	jle	3f
@@ -105,16 +124,8 @@
 	andb	$2, %ah
 	jz	3f
 	fchs
-3:
-#ifdef USE_AS_EXPM1L
-	/* Test for +-0 as argument.  */
-	fstsw	%ax
-	movb	$0x45, %dh
-	andb	%ah, %dh
-	cmpb	$0x40, %dh
-	je	2f
 #endif
-	FLDLOG			/* 1  log2(base)      */
+3:	FLDLOG			/* 1  log2(base)      */
 	fmul	%st(1), %st	/* 1  x log2(base)    */
 	frndint			/* 1  i               */
 	fld	%st(1)		/* 2  x               */
@@ -151,13 +162,16 @@
 #endif
 	fstp	%st(1)		/* 0  */
 	jmp	2f
-1:	testl	$0x200, %eax	/* Test sign.  */
-	jz	2f		/* If positive, jump.  */
+1:
+#ifdef USE_AS_EXPM1L
+	/* For expm1l, only negative sign gets here.  */
 	fstp	%st
-#ifdef USE_AS_EXPM1L
 	fld1
 	fchs
 #else
+	testl	$0x200, %eax	/* Test sign.  */
+	jz	2f		/* If positive, jump.  */
+	fstp	%st
 	fldz			/* Set result to 0.  */
 #endif
 2:	ret

Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps Sat Jul  7 00:01:40 2012
@@ -1657,6 +1657,9 @@
 ifloat: 1
 
 # expm1
+Test "expm1 (-45.0) == -0.9999999999999999999713748141945060635553":
+ildouble: 1
+ldouble: 1
 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
 double: 1
 idouble: 1

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits