about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_atanhf.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/e_atanhf.S')
-rw-r--r--sysdeps/i386/fpu/e_atanhf.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_atanhf.S b/sysdeps/i386/fpu/e_atanhf.S
index 687d4c97fb..46f2c8dab4 100644
--- a/sysdeps/i386/fpu/e_atanhf.S
+++ b/sysdeps/i386/fpu/e_atanhf.S
@@ -1,5 +1,5 @@
 /* ix87 specific implementation of arctanh function.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -51,6 +51,11 @@ ln2_2:	.tfloat 0.3465735902799726547086160
 ENTRY(__ieee754_atanhf)
 	movl	4(%esp), %ecx
 
+	movl	%ecx, %eax
+	andl	$0x7fffffff, %eax
+	cmpl	$0x7f800000, %eax
+	ja	5f
+
 #ifdef PIC
 	call	1f
 1:	popl	%edx
@@ -99,4 +104,8 @@ ENTRY(__ieee754_atanhf)
 	jecxz	3f
 	fchs			// 0.5*ln2*ld((1+x)/(1-x))
 3:	ret
+
+	// x == NaN
+5:	flds	4(%esp)
+	ret
 END(__ieee754_atanhf)