aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/mathbits.h5
-rw-r--r--sysdeps/i386/fpu/mathbits.h5
-rw-r--r--sysdeps/libm-i387/e_scalb.S78
-rw-r--r--sysdeps/libm-i387/e_scalbf.S79
-rw-r--r--sysdeps/libm-i387/e_scalbl.S78
-rw-r--r--sysdeps/libm-i387/s_asinh.S11
-rw-r--r--sysdeps/libm-i387/s_asinhf.S11
-rw-r--r--sysdeps/libm-i387/s_asinhl.S11
-rw-r--r--sysdeps/libm-i387/s_ilogb.S12
-rw-r--r--sysdeps/libm-i387/s_ilogbf.S12
-rw-r--r--sysdeps/libm-i387/s_ilogbl.S13
-rw-r--r--sysdeps/libm-i387/s_llrint.S (renamed from sysdeps/libm-i387/s_rinttoll.S)6
-rw-r--r--sysdeps/libm-i387/s_lrint.S (renamed from sysdeps/libm-i387/s_rinttol.S)6
-rw-r--r--sysdeps/libm-i387/s_remquo.S7
-rw-r--r--sysdeps/libm-i387/s_remquof.S7
-rw-r--r--sysdeps/libm-i387/s_remquol.S7
-rw-r--r--sysdeps/libm-ieee754/e_gamma_r.c47
-rw-r--r--sysdeps/libm-ieee754/e_gammaf_r.c46
-rw-r--r--sysdeps/libm-ieee754/e_gammal_r.c46
-rw-r--r--sysdeps/libm-ieee754/e_lgamma_r.c40
-rw-r--r--sysdeps/libm-ieee754/e_lgammaf_r.c22
-rw-r--r--sysdeps/libm-ieee754/s_llrint.c (renamed from sysdeps/libm-ieee754/s_rinttoll.c)6
-rw-r--r--sysdeps/libm-ieee754/s_llround.c (renamed from sysdeps/libm-ieee754/s_roundtoll.c)6
-rw-r--r--sysdeps/libm-ieee754/s_lrint.c (renamed from sysdeps/libm-ieee754/s_rinttol.c)6
-rw-r--r--sysdeps/libm-ieee754/s_lround.c (renamed from sysdeps/libm-ieee754/s_roundtol.c)6
-rw-r--r--sysdeps/libm-ieee754/s_remquo.c2
-rw-r--r--sysdeps/libm-ieee754/s_remquof.c2
-rw-r--r--sysdeps/libm-ieee754/s_remquol.c2
-rw-r--r--sysdeps/libm-ieee754/s_scalbn.c13
-rw-r--r--sysdeps/libm-ieee754/s_scalbnf.c20
-rw-r--r--sysdeps/libm-ieee754/s_scalbnl.c34
-rw-r--r--sysdeps/libm-ieee754/w_gamma.c22
-rw-r--r--sysdeps/libm-ieee754/w_gamma_r.c51
-rw-r--r--sysdeps/libm-ieee754/w_gammaf.c21
-rw-r--r--sysdeps/libm-ieee754/w_gammaf_r.c52
-rw-r--r--sysdeps/libm-ieee754/w_gammal.c21
-rw-r--r--sysdeps/libm-ieee754/w_gammal_r.c52
-rw-r--r--sysdeps/m68k/fpu/__math.h4
-rw-r--r--sysdeps/m68k/fpu/s_llrint.c (renamed from sysdeps/m68k/fpu/s_rinttoll.c)4
-rw-r--r--sysdeps/m68k/fpu/s_lrint.c (renamed from sysdeps/m68k/fpu/s_rinttol.c)6
-rw-r--r--sysdeps/m68k/fpu/s_remquo.c9
-rw-r--r--sysdeps/posix/Makefile5
-rw-r--r--sysdeps/powerpc/Dist1
-rw-r--r--sysdeps/stub/e_acoshl.c2
-rw-r--r--sysdeps/stub/e_acosl.c2
-rw-r--r--sysdeps/stub/e_asinl.c2
-rw-r--r--sysdeps/stub/e_atan2l.c2
-rw-r--r--sysdeps/stub/e_expl.c2
-rw-r--r--sysdeps/stub/e_fmodl.c2
-rw-r--r--sysdeps/stub/e_j0l.c3
-rw-r--r--sysdeps/stub/e_j1l.c3
-rw-r--r--sysdeps/stub/e_jnl.c3
-rw-r--r--sysdeps/stub/e_lgammal_r.c2
-rw-r--r--sysdeps/stub/e_log10l.c2
-rw-r--r--sysdeps/stub/e_logl.c2
-rw-r--r--sysdeps/stub/e_powl.c2
-rw-r--r--sysdeps/stub/e_rem_pio2l.c2
-rw-r--r--sysdeps/stub/e_sqrtl.c2
-rw-r--r--sysdeps/stub/k_cosl.c2
-rw-r--r--sysdeps/stub/k_rem_pio2l.c2
-rw-r--r--sysdeps/stub/k_sinl.c2
-rw-r--r--sysdeps/stub/k_tanl.c2
-rw-r--r--sysdeps/stub/s_atanl.c2
-rw-r--r--sysdeps/stub/s_erfl.c3
-rw-r--r--sysdeps/stub/s_exp2.c2
-rw-r--r--sysdeps/stub/s_exp2f.c2
-rw-r--r--sysdeps/stub/s_exp2l.c2
-rw-r--r--sysdeps/stub/s_expm1l.c2
-rw-r--r--sysdeps/stub/s_log1pl.c2
-rw-r--r--sysdeps/stub/s_log2l.c2
-rw-r--r--sysdeps/unix/sysv/linux/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/Makefile34
-rw-r--r--sysdeps/unix/sysv/linux/arm/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/configure24
-rw-r--r--sysdeps/unix/sysv/linux/configure.in24
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.S9
-rw-r--r--sysdeps/unix/sysv/linux/mk-stdiolim.c4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Dist1
79 files changed, 673 insertions, 379 deletions
diff --git a/sysdeps/generic/mathbits.h b/sysdeps/generic/mathbits.h
index e4db3dcf19..b14b52d901 100644
--- a/sysdeps/generic/mathbits.h
+++ b/sysdeps/generic/mathbits.h
@@ -32,4 +32,9 @@ typedef double double_t; /* `double' expressions are evaluated as
/* Define `INFINITY' as value of type `float_t'. */
#define INFINITY HUGE_VAL
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+#define FP_ILOGB0 0x80000001
+#define FP_ILOGBNAN 0x7fffffff
+
#endif /* mathbits.h */
diff --git a/sysdeps/i386/fpu/mathbits.h b/sysdeps/i386/fpu/mathbits.h
index 7885afeec0..f4a22c0757 100644
--- a/sysdeps/i386/fpu/mathbits.h
+++ b/sysdeps/i386/fpu/mathbits.h
@@ -33,4 +33,9 @@ typedef long double double_t; /* `double' expressions are evaluated as
/* Define `INFINITY' as value of type `float_t'. */
#define INFINITY HUGE_VALL
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+#define FP_ILOGB0 0x80000000
+#define FP_ILOGBNAN 0x80000000
+
#endif /* mathbits.h */
diff --git a/sysdeps/libm-i387/e_scalb.S b/sysdeps/libm-i387/e_scalb.S
index 427a3b905e..790f1c1d56 100644
--- a/sysdeps/libm-i387/e_scalb.S
+++ b/sysdeps/libm-i387/e_scalb.S
@@ -1,16 +1,94 @@
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
+ *
+ * Correct handling of y==-inf <drepper@gnu>
*/
#include <machine/asm.h>
RCSID("$NetBSD: e_scalb.S,v 1.4 1995/05/08 23:49:52 jtc Exp $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(zero_nan,@object)
+zero_nan:
+ .double 0.0
+nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
+minus_zero:
+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80
+ .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
+ ASM_SIZE_DIRECTIVE(zero_nan)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%ecx)
+#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+#else
+#define MO(op) op
+#define MOX(op,x,f) op(,x,f)
+#endif
+
+
ENTRY(__ieee754_scalb)
fldl 12(%esp)
+ fxam
+ fnstsw
fldl 4(%esp)
+ andl $0x4700, %eax
+ cmpl $0x0700, %eax
+ je 1f
+ andl $0x4500, %eax
+ cmpl $0x0100, %eax
+ je 2f
+ fxam
+ fnstsw
+ andl $0x4500, %eax
+ cmpl $0x0100, %eax
+ je 2f
+ fld %st(1)
+ frndint
+ fcomp %st(2)
+ fnstsw
+ sahf
+ jne 2f
fscale
fstp %st(1)
ret
+
+ /* y is -inf */
+1: fxam
+#ifdef PIC
+ call 1f
+1: popl %ecx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx
+#endif
+ fnstsw
+ movl 8(%esp), %edx
+ shrl $5, %eax
+ fstp %st(1)
+ andl $0x80000000, %edx
+ andl $8, %eax
+ fstp %st(1)
+ shrl $27, %edx
+ addl %edx, %eax
+ fldl MOX(zero_nan, %eax, 1)
+ ret
+
+ /* The result is NaN, but we must not raise an exception.
+ So use a variable. */
+2: fstp %st
+ fstp %st
+#ifdef PIC
+ call 1f
+1: popl %ecx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx
+#endif
+ fldl MO(nan)
+ ret
END(__ieee754_scalb)
diff --git a/sysdeps/libm-i387/e_scalbf.S b/sysdeps/libm-i387/e_scalbf.S
index 4c62134a0c..c869da9b38 100644
--- a/sysdeps/libm-i387/e_scalbf.S
+++ b/sysdeps/libm-i387/e_scalbf.S
@@ -2,16 +2,95 @@
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
* Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ *
+ * Correct handling of y==-inf <drepper@gnu>
*/
#include <machine/asm.h>
RCSID("$NetBSD: $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(zero_nan,@object)
+zero_nan:
+ .double 0.0
+nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
+minus_zero:
+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80
+ .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
+ ASM_SIZE_DIRECTIVE(zero_nan)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%ecx)
+#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+#else
+#define MO(op) op
+#define MOX(op,x,f) op(,x,f)
+#endif
+
+
+ .text
ENTRY(__ieee754_scalbf)
flds 8(%esp)
+ fxam
+ fnstsw
flds 4(%esp)
+ andl $0x4700, %eax
+ cmpl $0x0700, %eax
+ je 1f
+ andl $0x4500, %eax
+ cmpl $0x0100, %eax
+ je 2f
+ fxam
+ fnstsw
+ andl $0x4500, %eax
+ cmpl $0x0100, %eax
+ je 2f
+ fld %st(1)
+ frndint
+ fcomp %st(2)
+ fnstsw
+ sahf
+ jne 2f
fscale
fstp %st(1)
ret
+
+ /* y is -inf */
+1: fxam
+#ifdef PIC
+ call 1f
+1: popl %ecx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx
+#endif
+ fnstsw
+ movl 4(%esp), %edx
+ shrl $5, %eax
+ fstp %st(1)
+ andl $0x80000000, %edx
+ andl $8, %eax
+ fstp %st(1)
+ shrl $27, %edx
+ addl %edx, %eax
+ fldl MOX(zero_nan, %eax, 1)
+ ret
+
+ /* The result is NaN, but we must not raise an exception.
+ So use a variable. */
+2: fstp %st
+ fstp %st
+#ifdef PIC
+ call 1f
+1: popl %ecx
+ addl $_GLOBAL_OFFSET_TA