about summary refs log tree commit diff
path: root/sysdeps/libm-i387
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-04-30 15:51:34 +0000
committerUlrich Drepper <drepper@redhat.com>1997-04-30 15:51:34 +0000
commit779ae82ecdf88b7ed7c1f00d3ed3a639671c3c8d (patch)
tree287afe5ef732d76109129a142c5840cc42a2b34a /sysdeps/libm-i387
parenta12ea214dbc999b98ab5ed4e53fb0089cf5e183a (diff)
downloadglibc-779ae82ecdf88b7ed7c1f00d3ed3a639671c3c8d.tar.gz
glibc-779ae82ecdf88b7ed7c1f00d3ed3a639671c3c8d.tar.xz
glibc-779ae82ecdf88b7ed7c1f00d3ed3a639671c3c8d.zip
1997-04-30 17:35  Ulrich Drepper  <drepper@cygnus.com>

	* math/libm-test.c: Implement test for exceptions.
	Partly due to Andreas Jaeger.
	(csin_test): New function.
	* sysdeps/libm-i387/s_cexp.S: Raise correct exceptions.
	* sysdeps/libm-i387/s_cexpf.S: Likewise.
	* sysdeps/libm-i387/s_cexpl.S: Likewise.
	* sysdeps/libm-ieee754/s_ccos.c: Likewise.
	* sysdeps/libm-ieee754/s_ccosf.c: Likewise.
	* sysdeps/libm-ieee754/s_ccosl.c: Likewise.
	* sysdeps/libm-ieee754/s_ccosh.c: Likewise.
	* sysdeps/libm-ieee754/s_ccoshf.c: Likewise.
	* sysdeps/libm-ieee754/s_ccoshl.c: Likewise.
	* sysdeps/libm-ieee754/s_cexp.c: Likewise.
	* sysdeps/libm-ieee754/s_cexpf.c: Likewise.
	* sysdeps/libm-ieee754/s_cexpl.c: Likewise.
	* sysdeps/libm-ieee754/s_csinh.c: Likewise.
	* sysdeps/libm-ieee754/s_csinhf.c: Likewise.
	* sysdeps/libm-ieee754/s_csinhl.c: Likewise.
	* sysdeps/libm-ieee754/s_ctanh.c: Likewise.
	* sysdeps/libm-ieee754/s_ctanhf.c: Likewise.
	* sysdeps/libm-ieee754/s_ctanhl.c: Likewise.

	* sysdeps/libm-ieee754/s_ccosh.c: Correct computation.
	* sysdeps/libm-ieee754/s_ccoshf.c: Likewise.
	* sysdeps/libm-ieee754/s_ccoshl.c: Likewise.
	* sysdeps/libm-ieee754/s_csinh.c: Likewise.
	* sysdeps/libm-ieee754/s_csinhf.c: Likewise.
	* sysdeps/libm-ieee754/s_csinhl.c: Likewise.

	* sysdeps/libm-ieee754/s_csin.c: Rewrite.
	* sysdeps/libm-ieee754/s_csinf.c: Likewise.
	* sysdeps/libm-ieee754/s_csinl.c: Likewise.

	* stdlib/random_r.c (__srandom_r): Don't use seed 0.  Use 1 in this
	case.

	* sysdeps/i386/dl-machine.h (elf_machine_load_address): Use notation
	for local label.

	* time/strftime.c (add): Respect `0' padding flag.
	Reported by Richard Stallman <rms@gnu.ai.mit.edu>.

1997-04-30 15:46  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig (start-installed-name): Define here, not in csu/Makefile.
	Use in +link macro.
	* csu/Makefile (distribute): Add abi-note.S and abi-tag.h.
	(start-installed-name): Don't define here.
	When ELF generate file named by start-installed-name from start.o
	and abi-note.o.
	* csu/abi-note.S: New file.
	* sysdeps/stub/abi-tag.h: New file.
	* sysdpes/unix/sysv/linux/abi-tag.h: New file.
	Patches by Roland McGrath <roland@gnu.ai.mit.edu>.

1997-04-30 01:32  Ulrich Drepper  <drepper@cygnus.com>

	* manual/stdio.texi: Use @vtable where possible.
	Add TeX version of @multitable since texi2dvi cannot handle them
	correct in the moment.

	* po/de.po: Update.

1997-04-29 21:06  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig: Don't set cross-compiling based on $(BUILD_CC) != $(CC).
	* config.make.in: Set cross-compiling from configure result.
	* configure.in: Emit definition of `cross_compiling'.
	Patches by Marcus G. Daniels <marcus@cathcart.sysc.pdx.edu>.

1997-04-27 21:50  Philip Blundell  <pjb27@cam.ac.uk>

	* sysdeps/unix/sysv/linux/net/route.h (struct in6_rtmsg): Use
	correct `int' sizes for struct members.

1997-04-29 19:14  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/libm-i387/e_powf.S Generate invalid exception correctly.
	* sysdeps/libm-i387/e_pow.S: Likewise.
	* sysdeps/libm-i387/e_powl.S: Likewise.

1997-04-23 10:08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* math/fenv.h: Correct typos.

1997-04-28 10:04  Richard Henderson  <rth@tamu.edu>

	* sysdeps/unix/sysv/linux/alpha/clone.S: Save the function argument
	in t0 rather than a4 to avoid it being clobbered.

1997-04-27 23:52  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/summary.awk: Recognize @defmumblex.

	* manual/signal.texi (Miscellaneous Signals): Use @deftypevrx for
	second description header.

1997-04-27 23:29  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/arith.texi (Floating-Point Classes): Don't indent text,
	makeinfo doesn't like that.

1997-04-27 20:52  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* malloc/obstack.h (obstack_specify_allocation_with_arg,
	obstack_chunkfun, obstack_freefun): Fix casts.

1997-04-27 18:21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/xtract-typefun.awk: Allow names with only one character.

1997-04-26 14:16  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/netinet/ip_fw.h: Use <netinet/ip_icmp.h>
	not <netinet/icmp.h>.
	Reported by Michael Deutschmann <ldeutsch@mail.netshop.net>.

1997-04-25 12:31  Ulrich Drepper  <drepper@cygnus.com>

	* csu/Makefile ($(objpfx)initfini.s): Add CPPFLAGS, CFLAGS and -g0
	to command line of compiler.
	Patch by Marcus G. Daniels <marcus@sysc.pdx.edu>.

	* sysdeps/generic/sigset.h (__sigandset, __sigorset): Fix typos.
	Patch by Marcus G. Daniels <marcus@sysc.pdx.edu>.

	* signal/signal.h (_sys_siglist, sys_siglist): Use _NSIG, not NSIG
	in declaration.
	Patch by Michael Widenius <monty@tcx.se>.

	* time/strptime.c (strptime_internal): Fix %I format specifier
	being off by one.
	Patch by Mark Kettenis <kettenis@phys.uva.nl>.

1997-04-24 12:18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* stdlib/lcong48_r.c: Include <limits.h>.
	* stdlib/seed48_r.c: Likewise.

	* stdio-common/printf_size.c (printf_size): Correct type of
	`units' and make robust against future changes.

1997-04-23 18:58  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/libm-ieee754/s_cproj.c: Use isfinite instead of finite.
	* sysdeps/libm-ieee754/s_cprojl.c: Likewise.
	* sysdeps/libm-ieee754/s_cprojf.c: Likewise.

1997-04-23 18:53  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/arith.texi, manual/math.texi: Use @defmumblex for
	additional description headers.
	* manual/xtract-typefun.awk: Recognize them.

1997-04-22 15:58  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* stdio-common/printf_size.c (printf_size): Correct size of array
	units.
Diffstat (limited to 'sysdeps/libm-i387')
-rw-r--r--sysdeps/libm-i387/e_pow.S7
-rw-r--r--sysdeps/libm-i387/e_powf.S7
-rw-r--r--sysdeps/libm-i387/e_powl.S7
-rw-r--r--sysdeps/libm-i387/s_cexp.S22
-rw-r--r--sysdeps/libm-i387/s_cexpf.S22
-rw-r--r--sysdeps/libm-i387/s_cexpl.S22
6 files changed, 54 insertions, 33 deletions
diff --git a/sysdeps/libm-i387/e_pow.S b/sysdeps/libm-i387/e_pow.S
index e665326438..45c41b48ab 100644
--- a/sysdeps/libm-i387/e_pow.S
+++ b/sysdeps/libm-i387/e_pow.S
@@ -48,9 +48,6 @@ one:	.double 1.0
 	ASM_TYPE_DIRECTIVE(limit,@object)
 limit:	.double 0.29
 	ASM_SIZE_DIRECTIVE(limit)
-	ASM_TYPE_DIRECTIVE(nan,@object)
-nan:	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-	ASM_SIZE_DIRECTIVE(nan)
 
 #ifdef PIC
 #define MO(op) op##@GOTOFF(%ecx)
@@ -191,8 +188,8 @@ ENTRY(__ieee754_pow)
 	ret
 
 	.align ALIGNARG(4)
-14:	fldl	MO(nan)
-	faddl	MO(zero)	// raise invalid exception
+14:	fldl	MO(infinity)
+	fmull	MO(zero)	// raise invalid exception
 	ret
 
 	.align ALIGNARG(4)
diff --git a/sysdeps/libm-i387/e_powf.S b/sysdeps/libm-i387/e_powf.S
index 102cd4e3af..d7342bf56f 100644
--- a/sysdeps/libm-i387/e_powf.S
+++ b/sysdeps/libm-i387/e_powf.S
@@ -48,9 +48,6 @@ one:	.double 1.0
 	ASM_TYPE_DIRECTIVE(limit,@object)
 limit:	.double 0.29
 	ASM_SIZE_DIRECTIVE(limit)
-	ASM_TYPE_DIRECTIVE(nan,@object)
-nan:	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-	ASM_SIZE_DIRECTIVE(nan)
 
 #ifdef PIC
 #define MO(op) op##@GOTOFF(%ecx)
@@ -187,8 +184,8 @@ ENTRY(__ieee754_powf)
 	ret
 
 	.align ALIGNARG(4)
-14:	fldl	MO(nan)
-	faddl	MO(zero)	// raise invalid exception
+14:	fldl	MO(infinity)
+	fmull	MO(zero)	// raise invalid exception
 	ret
 
 	.align ALIGNARG(4)
diff --git a/sysdeps/libm-i387/e_powl.S b/sysdeps/libm-i387/e_powl.S
index dba725aa77..0ea4829822 100644
--- a/sysdeps/libm-i387/e_powl.S
+++ b/sysdeps/libm-i387/e_powl.S
@@ -48,9 +48,6 @@ one:	.double 1.0
 	ASM_TYPE_DIRECTIVE(limit,@object)
 limit:	.double 0.29
 	ASM_SIZE_DIRECTIVE(limit)
-	ASM_TYPE_DIRECTIVE(nan,@object)
-nan:	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-	ASM_SIZE_DIRECTIVE(nan)
 
 #ifdef PIC
 #define MO(op) op##@GOTOFF(%ecx)
@@ -191,8 +188,8 @@ ENTRY(__ieee754_powl)
 	ret
 
 	.align ALIGNARG(4)
-14:	fldl	MO(nan)
-	faddl	MO(zero)	// raise invalid exception
+14:	fldl	MO(infinity)
+	fmull	MO(zero)	// raise invalid exception
 	ret
 
 	.align ALIGNARG(4)
diff --git a/sysdeps/libm-i387/s_cexp.S b/sysdeps/libm-i387/s_cexp.S
index 48e002b2f6..5630d3cb65 100644
--- a/sysdeps/libm-i387/s_cexp.S
+++ b/sysdeps/libm-i387/s_cexp.S
@@ -31,7 +31,8 @@ huge_nan_null_null:
 	.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
 	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
 	.double	0.0
-	.double	0.0
+zero:	.double	0.0
+infinity:
 	.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
 	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
 	.double 0.0
@@ -90,7 +91,7 @@ ENTRY(__cexp)
 	   Check your FPU manual for more information.  */
 	andb	$0x01, %ah
 	cmpb	$0x01, %ah
-	je	2f
+	je	20f
 
 	/* We have finite numbers in the real and imaginary part.  Do
 	   the real work now.  */
@@ -139,9 +140,8 @@ ENTRY(__cexp)
 1:	fxam			/* y : x */
 	fnstsw
 	movb	%ah, %dl
-	andb	$0x01, %ah	/* See above why 0x01 is usable here.  */
-	cmpb	$0x01, %ah
-	je	3f
+	testb	$0x01, %ah	/* See above why 0x01 is usable here.  */
+	jne	3f
 
 
 	/* The real part is +-Inf and the imaginary part is finite.  */
@@ -220,7 +220,14 @@ ENTRY(__cexp)
 	.align ALIGNARG(4)
 3:	fstp	%st(0)
 	fstp	%st(0)		/* <empty> */
-	movl	%edx, %eax
+	andb	$0x45, %ah
+	andb	$0x47, %dh
+	xorb	%dh, %ah
+	jnz	30f
+	fldl	MO(infinity)	/* Raise invalid exception.  */
+	fmull	MO(zero)
+	fstp	%st(0)
+30:	movl	%edx, %eax
 	shrl	$5, %edx
 	shll	$4, %eax
 	andl	$16, %edx
@@ -236,6 +243,9 @@ ENTRY(__cexp)
 
 	/* The real part is NaN.  */
 	.align ALIGNARG(4)
+20:	fldl	MO(infinity)		/* Raise invalid exception.  */
+	fmull	MO(zero)
+	fstp	%st(0)
 2:	fstp	%st(0)
 	fstp	%st(0)
 	movl	4(%esp), %eax		/* Pointer to memory for result.  */
diff --git a/sysdeps/libm-i387/s_cexpf.S b/sysdeps/libm-i387/s_cexpf.S
index 6fd414b045..d6dcebcb23 100644
--- a/sysdeps/libm-i387/s_cexpf.S
+++ b/sysdeps/libm-i387/s_cexpf.S
@@ -31,7 +31,8 @@ huge_nan_null_null:
 	.byte 0, 0, 0x80, 0x7f
 	.byte 0, 0, 0xc0, 0x7f
 	.float	0.0
-	.float	0.0
+zero:	.float	0.0
+infinity:
 	.byte 0, 0, 0x80, 0x7f
 	.byte 0, 0, 0xc0, 0x7f
 	.float 0.0
@@ -90,7 +91,7 @@ ENTRY(__cexpf)
 	   Check your FPU manual for more information.  */
 	andb	$0x01, %ah
 	cmpb	$0x01, %ah
-	je	2f
+	je	20f
 
 	/* We have finite numbers in the real and imaginary part.  Do
 	   the real work now.  */
@@ -143,9 +144,8 @@ ENTRY(__cexpf)
 1:	fxam			/* y : x */
 	fnstsw
 	movb	%ah, %dl
-	andb	$0x01, %ah	/* See above why 0x01 is usable here.  */
-	cmpb	$0x01, %ah
-	je	3f
+	testb	$0x01, %ah	/* See above why 0x01 is usable here.  */
+	jne	3f
 
 
 	/* The real part is +-Inf and the imaginary part is finite.  */
@@ -222,7 +222,14 @@ ENTRY(__cexpf)
 	.align ALIGNARG(4)
 3:	fstp	%st(0)
 	fstp	%st(0)		/* <empty> */
-	movl	%edx, %eax
+	andb	$0x45, %ah
+	andb	$0x47, %dh
+	xorb	%dh, %ah
+	jnz	30f
+	flds	MO(infinity)	/* Raise invalid exception.  */
+	fmuls	MO(zero)
+	fstp	%st(0)
+30:	movl	%edx, %eax
 	shrl	$6, %edx
 	shll	$3, %eax
 	andl	$8, %edx
@@ -235,6 +242,9 @@ ENTRY(__cexpf)
 
 	/* The real part is NaN.  */
 	.align ALIGNARG(4)
+20:	flds	MO(infinity)		/* Raise invalid exception.  */
+	fmuls	MO(zero)
+	fstp	%st(0)
 2:	fstp	%st(0)
 	fstp	%st(0)
 	movl	MO(huge_nan_null_null+4), %eax
diff --git a/sysdeps/libm-i387/s_cexpl.S b/sysdeps/libm-i387/s_cexpl.S
index fa31e74162..11c05c52e6 100644
--- a/sysdeps/libm-i387/s_cexpl.S
+++ b/sysdeps/libm-i387/s_cexpl.S
@@ -31,7 +31,8 @@ huge_nan_null_null:
 	.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
 	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
 	.double	0.0
-	.double	0.0
+zero:	.double	0.0
+infinity:
 	.byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
 	.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
 	.double 0.0
@@ -90,7 +91,7 @@ ENTRY(__cexpl)
 	   Check your FPU manual for more information.  */
 	andb	$0x01, %ah
 	cmpb	$0x01, %ah
-	je	2f
+	je	20f
 
 	/* We have finite numbers in the real and imaginary part.  Do
 	   the real work now.  */
@@ -139,9 +140,8 @@ ENTRY(__cexpl)
 1:	fxam			/* y : x */
 	fnstsw
 	movb	%ah, %dl
-	andb	$0x01, %ah	/* See above why 0x01 is usable here.  */
-	cmpb	$0x01, %ah
-	je	3f
+	testb	$0x01, %ah	/* See above why 0x01 is usable here.  */
+	jne	3f
 
 
 	/* The real part is +-Inf and the imaginary part is finite.  */
@@ -220,7 +220,14 @@ ENTRY(__cexpl)
 	.align ALIGNARG(4)
 3:	fstp	%st(0)
 	fstp	%st(0)		/* <empty> */
-	movl	%edx, %eax
+	andb	$0x45, %ah
+	andb	$0x47, %dh
+	xorb	%dh, %ah
+	jnz	30f
+	fldl	MO(infinity)	/* Raise invalid exception.  */
+	fmull	MO(zero)
+	fstp	%st(0)
+30:	movl	%edx, %eax
 	shrl	$5, %edx
 	shll	$4, %eax
 	andl	$16, %edx
@@ -236,6 +243,9 @@ ENTRY(__cexpl)
 
 	/* The real part is NaN.  */
 	.align ALIGNARG(4)
+20:	fldl	MO(infinity)		/* Raise invalid exception.  */
+	fmull	MO(zero)
+	fstp	%st(0)
 2:	fstp	%st(0)
 	fstp	%st(0)
 	movl	4(%esp), %eax		/* Pointer to memory for result.  */