[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r18379 - in /fsf/trunk/libc: ./ math/ sysdeps/i386/fpu/ sysdeps/ieee754/dbl-64/ sysdeps/ieee754/flt-32/ sysdeps/ieee754/ldbl...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r18379 - in /fsf/trunk/libc: ./ math/ sysdeps/i386/fpu/ sysdeps/ieee754/dbl-64/ sysdeps/ieee754/flt-32/ sysdeps/ieee754/ldbl...
- From: eglibc@xxxxxxxxxx
- Date: Sat, 05 May 2012 19:40:30 -0000
Author: eglibc
Date: Sat May 5 19:40:29 2012
New Revision: 18379
Log:
Import glibc-mainline for 2012-05-05
Added:
fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S
fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S
Removed:
fsf/trunk/libc/sysdeps/i386/fpu/e_expl.c
fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/sysdeps/ieee754/dbl-64/w_exp.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/w_expf.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c
fsf/trunk/libc/sysdeps/unix/sysv/syscalls.list
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat May 5 19:40:29 2012
@@ -1,3 +1,45 @@
+2012-05-05 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * math/libm-test.inc (hypot_test) [TEST_DOUBLE && TEST_INLINE]:
+ Disable one test.
+
+ [BZ #13787]
+ [BZ #13922]
+ [BZ #14036]
+ * sysdeps/i386/fpu/e_expl.S (csat): New constant.
+ (__ieee754_expl): Allow for and saturate large arguments.
+ * sysdeps/ieee754/dbl-64/w_exp.c (o_threshold): Remove variable.
+ (u_threshold): Likewise.
+ (__exp): Call __ieee754_exp before checking for overflow and
+ underflow.
+ * sysdeps/ieee754/flt-32/w_expf.c (o_threshold): Remove variable.
+ (u_threshold): Likewise.
+ (__expf): Call __ieee754_expf before checking for overflow and
+ underflow.
+ * sysdeps/ieee754/ldbl-96/w_expl.c (o_threshold): Remove variable.
+ (u_threshold): Likewise.
+ (__expl): Call __ieee754_expl before checking for overflow and
+ underflow.
+ * sysdeps/x86_64/fpu/e_expl.S (csat): New constant.
+ (__ieee754_expl): Allow for and saturate large arguments.
+ * math/libm-test.inc (exp_test): Add another test. Do not allow
+ missing overflow exception on overflow.
+ (expm1_test): Do not allow missing overflow exception on overflow.
+
+ * sysdeps/i386/fpu/e_expl.c: Move to ...
+ * sysdeps/i386/fpu/e_expl.S: ... here. Write directly in assembly
+ rather than using inline asm.
+ * sysdeps/x86_64/fpu/e_expl.c: Remove file.
+ * sysdeps/x86_64/fpu/e_expl.S: Copy from
+ sysdeps/i386/fpu/e_expl.S, adjusted for x86_64.
+
+ * sysdeps/unix/sysv/syscalls.list (ftime): Remove.
+ (nice): Likewise.
+ (poll): Likewise.
+ (signal): Likewise.
+ (time): Likewise.
+ (times): Likewise.
+
2012-05-04 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* sysdeps/unix/syscalls.list (adjtime): Add entry from
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat May 5 19:40:29 2012
@@ -18,12 +18,12 @@
12047, 12340, 13058, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13566, 13583,
13592, 13618, 13637, 13656, 13658, 13673, 13691, 13695, 13704, 13705,
- 13706, 13726, 13738, 13739, 13758, 13760, 13761, 13775, 13786, 13792,
- 13806, 13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871,
- 13872, 13873, 13879, 13883, 13886, 13892, 13895, 13908, 13910, 13911,
- 13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13924,
- 13926, 13927, 13928, 13938, 13941, 13942, 13963, 13967, 13970, 13973,
- 14027, 14033, 14034, 14040, 14049, 14055
+ 13706, 13726, 13738, 13739, 13758, 13760, 13761, 13775, 13786, 13787,
+ 13792, 13806, 13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854,
+ 13871, 13872, 13873, 13879, 13883, 13886, 13892, 13895, 13908, 13910,
+ 13911, 13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921,
+ 13922, 13924, 13926, 13927, 13928, 13938, 13941, 13942, 13963, 13967,
+ 13970, 13973, 14027, 14033, 14034, 14040, 14049, 14055
* ISO C11 support:
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sat May 5 19:40:29 2012
@@ -3325,8 +3325,11 @@
TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
#endif
- /* Bug 13922: OVERFLOW exception may be missing. */
- TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+#if !(defined TEST_LDOUBLE && LDBL_MAX_EXP > 1024)
+ TEST_f_f (exp, 710, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+ TEST_f_f (exp, 1e5, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp, -max_value, 0);
END (exp);
@@ -3547,11 +3550,9 @@
#endif
errno = 0;
- /* Bug 13787: OVERFLOW exception may be missing. */
- TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION_OK);
+ TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION);
check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
- /* Bug 13787: OVERFLOW exception may be missing. */
- TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+ TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION);
#ifndef TEST_LDOUBLE /* Bug 13923. */
TEST_f_f (expm1, -max_value, -1);
#endif
@@ -4049,7 +4050,7 @@
TEST_ff_f (hypot, 0x1.234566p-126L, 0x1.234566p-126L, 1.891441686191081936598531534017449451173e-38L);
#endif
-#ifndef TEST_FLOAT
+#if !defined TEST_FLOAT && !(defined TEST_DOUBLE && defined TEST_INLINE)
TEST_ff_f (hypot, 0x3p1021L, 0x4p1021L, 0x5p1021L);
#endif
Added: fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S (added)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_expl.S Sat May 5 19:40:29 2012
@@ -1,0 +1,109 @@
+/*
+ * Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Public domain.
+ *
+ * Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
+ */
+
+/*
+ * The 8087 method for the exponential function is to calculate
+ * exp(x) = 2^(x log2(e))
+ * after separating integer and fractional parts
+ * x log2(e) = i + f, |f| <= .5
+ * 2^i is immediate but f needs to be precise for long double accuracy.
+ * Suppress range reduction error in computing f by the following.
+ * Separate x into integer and fractional parts
+ * x = xi + xf, |xf| <= .5
+ * Separate log2(e) into the sum of an exact number c0 and small part c1.
+ * c0 + c1 = log2(e) to extra precision
+ * Then
+ * f = (c0 xi - i) + c0 xf + c1 x
+ * where c0 xi is exact and so also is (c0 xi - i).
+ * -- moshier@xxxxxxxxxxxxxxx
+ */
+
+#include <machine/asm.h>
+
+ .section .rodata.cst16,"aM",@progbits,16
+
+ .p2align 4
+ ASM_TYPE_DIRECTIVE(c0,@object)
+c0: .byte 0, 0, 0, 0, 0, 0, 0xaa, 0xb8, 0xff, 0x3f
+ .byte 0, 0, 0, 0, 0, 0
+ ASM_SIZE_DIRECTIVE(c0)
+ ASM_TYPE_DIRECTIVE(c1,@object)
+c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
+ .byte 0, 0, 0, 0, 0, 0
+ ASM_SIZE_DIRECTIVE(c1)
+ 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)
+
+#ifdef PIC
+# define MO(op) op##@GOTOFF(%ecx)
+#else
+# define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_expl)
+ fldt 4(%esp)
+/* I added the following ugly construct because expl(+-Inf) resulted
+ in NaN. The ugliness results from the bright minds at Intel.
+ For the i686 the code can be written better.
+ -- drepper@xxxxxxxxxxx */
+ fxam /* Is NaN or +-Inf? */
+#ifdef PIC
+ LOAD_PIC_REG (cx)
+#endif
+ movzwl 4+8(%esp), %eax
+ andl $0x7fff, %eax
+ cmpl $0x400d, %eax
+ jle 3f
+ /* Overflow, underflow or infinity or NaN as argument. */
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 1f /* Is +-Inf, jump. */
+ cmpb $0x01, %dh
+ je 2f /* Is +-NaN, jump. */
+ /* Overflow or underflow; saturate. */
+ fstp %st
+ fldt MO(csat)
+ andb $2, %ah
+ jz 3f
+ fchs
+3: fldl2e /* 1 log2(e) */
+ fmul %st(1), %st /* 1 x log2(e) */
+ frndint /* 1 i */
+ fld %st(1) /* 2 x */
+ frndint /* 2 xi */
+ fld %st(1) /* 3 i */
+ fldt MO(c0) /* 4 c0 */
+ fld %st(2) /* 5 xi */
+ fmul %st(1), %st /* 5 c0 xi */
+ fsubp %st, %st(2) /* 4 f = c0 xi - i */
+ fld %st(4) /* 5 x */
+ fsub %st(3), %st /* 5 xf = x - xi */
+ fmulp %st, %st(1) /* 4 c0 xf */
+ faddp %st, %st(1) /* 3 f = f + c0 xf */
+ fldt MO(c1) /* 4 */
+ fmul %st(4), %st /* 4 c1 * x */
+ faddp %st, %st(1) /* 3 f = f + c1 * x */
+ f2xm1 /* 3 2^(fract(x * log2(e))) - 1 */
+ fld1 /* 4 1.0 */
+ faddp /* 3 2^(fract(x * log2(e))) */
+ fstp %st(1) /* 2 */
+ fscale /* 2 scale factor is st(1); e^x */
+ fstp %st(1) /* 1 */
+ fstp %st(1) /* 0 */
+ jmp 2f
+1: testl $0x200, %eax /* Test sign. */
+ jz 2f /* If positive, jump. */
+ fstp %st
+ fldz /* Set result to 0. */
+2: ret
+END(__ieee754_expl)
+strong_alias (__ieee754_expl, __expl_finite)
Removed: fsf/trunk/libc/sysdeps/i386/fpu/e_expl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/e_expl.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/e_expl.c (removed)
@@ -1,78 +1,0 @@
-/*
- * Written by J.T. Conklin <jtc@xxxxxxxxxx>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
- */
-
-/*
- * The 8087 method for the exponential function is to calculate
- * exp(x) = 2^(x log2(e))
- * after separating integer and fractional parts
- * x log2(e) = i + f, |f| <= .5
- * 2^i is immediate but f needs to be precise for long double accuracy.
- * Suppress range reduction error in computing f by the following.
- * Separate x into integer and fractional parts
- * x = xi + xf, |xf| <= .5
- * Separate log2(e) into the sum of an exact number c0 and small part c1.
- * c0 + c1 = log2(e) to extra precision
- * Then
- * f = (c0 xi - i) + c0 xf + c1 x
- * where c0 xi is exact and so also is (c0 xi - i).
- * -- moshier@xxxxxxxxxxxxxxx
- */
-
-#include <math_private.h>
-
-static const long double c0 = 1.44268798828125L;
-static const long double c1 = 7.05260771340735992468e-6L;
-
-long double
-__ieee754_expl (long double x)
-{
- long double res;
-
-/* I added the following ugly construct because expl(+-Inf) resulted
- in NaN. The ugliness results from the bright minds at Intel.
- For the i686 the code can be written better.
- -- drepper@xxxxxxxxxxx */
- asm ("fxam\n\t" /* Is NaN or +-Inf? */
- "fstsw %%ax\n\t"
- "movb $0x45, %%dh\n\t"
- "andb %%ah, %%dh\n\t"
- "cmpb $0x05, %%dh\n\t"
- "je 1f\n\t" /* Is +-Inf, jump. */
- "fldl2e\n\t" /* 1 log2(e) */
- "fmul %%st(1),%%st\n\t" /* 1 x log2(e) */
- "frndint\n\t" /* 1 i */
- "fld %%st(1)\n\t" /* 2 x */
- "frndint\n\t" /* 2 xi */
- "fld %%st(1)\n\t" /* 3 i */
- "fldt %2\n\t" /* 4 c0 */
- "fld %%st(2)\n\t" /* 5 xi */
- "fmul %%st(1),%%st\n\t" /* 5 c0 xi */
- "fsubp %%st,%%st(2)\n\t" /* 4 f = c0 xi - i */
- "fld %%st(4)\n\t" /* 5 x */
- "fsub %%st(3),%%st\n\t" /* 5 xf = x - xi */
- "fmulp %%st,%%st(1)\n\t" /* 4 c0 xf */
- "faddp %%st,%%st(1)\n\t" /* 3 f = f + c0 xf */
- "fldt %3\n\t" /* 4 */
- "fmul %%st(4),%%st\n\t" /* 4 c1 * x */
- "faddp %%st,%%st(1)\n\t" /* 3 f = f + c1 * x */
- "f2xm1\n\t" /* 3 2^(fract(x * log2(e))) - 1 */
- "fld1\n\t" /* 4 1.0 */
- "faddp\n\t" /* 3 2^(fract(x * log2(e))) */
- "fstp %%st(1)\n\t" /* 2 */
- "fscale\n\t" /* 2 scale factor is st(1); e^x */
- "fstp %%st(1)\n\t" /* 1 */
- "fstp %%st(1)\n\t" /* 0 */
- "jmp 2f\n\t"
- "1:\ttestl $0x200, %%eax\n\t" /* Test sign. */
- "jz 2f\n\t" /* If positive, jump. */
- "fstp %%st\n\t"
- "fldz\n\t" /* Set result to 0. */
- "2:\t\n"
- : "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx");
- return res;
-}
-strong_alias (__ieee754_expl, __expl_finite)
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/w_exp.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/w_exp.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/w_exp.c Sat May 5 19:40:29 2012
@@ -19,27 +19,16 @@
#include <math.h>
#include <math_private.h>
-static const double
-o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
-u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */
-
-
/* wrapper exp */
double
__exp (double x)
{
- if (__builtin_expect (isgreater (x, o_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 6);
- }
- else if (__builtin_expect (isless (x, u_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 7);
- }
+ double z = __ieee754_exp (x);
+ if (__builtin_expect (!__finite (z) || z == 0, 0)
+ && __finite (x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 6 + !!__signbit (x));
- return __ieee754_exp (x);
+ return z;
}
hidden_def (__exp)
weak_alias (__exp, exp)
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/w_expf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/w_expf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/w_expf.c Sat May 5 19:40:29 2012
@@ -19,27 +19,16 @@
#include <math.h>
#include <math_private.h>
-static const float
-o_threshold= 8.8722831726e+01, /* 0x42b17217 */
-u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
-
-
/* wrapper expf */
float
__expf (float x)
{
- if (__builtin_expect (isgreater (x, o_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_f (x, x, 106);
- }
- else if (__builtin_expect (isless (x, u_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_f (x, x, 107);
- }
+ float z = __ieee754_expf (x);
+ if (__builtin_expect (!__finitef (z) || z == 0, 0)
+ && __finitef (x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 106 + !!__signbitf (x));
- return __ieee754_expf (x);
+ return z;
}
hidden_def (__expf)
weak_alias (__expf, expf)
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/w_expl.c Sat May 5 19:40:29 2012
@@ -19,29 +19,16 @@
#include <math.h>
#include <math_private.h>
-static const long double
-o_threshold= 1.135652340629414394949193107797076489134e4,
- /* 0x400C, 0xB17217F7, 0xD1CF79AC */
-u_threshold= -1.140019167866942050398521670162263001513e4;
- /* 0x400C, 0xB220C447, 0x69C201E8 */
-
-
/* wrapper expl */
long double
__expl (long double x)
{
- if (__builtin_expect (isgreater (x, o_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206);
- }
- else if (__builtin_expect (isless (x, u_threshold), 0))
- {
- if (_LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 207);
- }
+ long double z = __ieee754_expl (x);
+ if (__builtin_expect (!__finitel (z) || z == 0, 0)
+ && __finitel (x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_l (x, x, 206 + !!__signbitl (x));
- return __ieee754_expl (x);
+ return z;
}
hidden_def (__expl)
weak_alias (__expl, expl)
Modified: fsf/trunk/libc/sysdeps/unix/sysv/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/syscalls.list Sat May 5 19:40:29 2012
@@ -1,15 +1,9 @@
# File name Caller Syscall name # args Strong name Weak names
alarm - alarm i:i alarm
-ftime - ftime i:p ftime
-nice - nice i:i nice
pause - pause Ci: pause
-poll - poll Ci:pii poll
setrlimit - setrlimit i:ip __setrlimit setrlimit
settimeofday - settimeofday i:PP __settimeofday settimeofday
-signal - signal i:ii signal
stime - stime i:p stime
-time - time Ei:P time
-times - times Ei:p __times times
ulimit - ulimit i:ii ulimit
utime - utime i:sP utime
Added: fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.S Sat May 5 19:40:29 2012
@@ -1,0 +1,106 @@
+/*
+ * Written by J.T. Conklin <jtc@xxxxxxxxxx>.
+ * Public domain.
+ *
+ * Adapted for `long double' by Ulrich Drepper <drepper@xxxxxxxxxx>.
+ */
+
+/*
+ * The 8087 method for the exponential function is to calculate
+ * exp(x) = 2^(x log2(e))
+ * after separating integer and fractional parts
+ * x log2(e) = i + f, |f| <= .5
+ * 2^i is immediate but f needs to be precise for long double accuracy.
+ * Suppress range reduction error in computing f by the following.
+ * Separate x into integer and fractional parts
+ * x = xi + xf, |xf| <= .5
+ * Separate log2(e) into the sum of an exact number c0 and small part c1.
+ * c0 + c1 = log2(e) to extra precision
+ * Then
+ * f = (c0 xi - i) + c0 xf + c1 x
+ * where c0 xi is exact and so also is (c0 xi - i).
+ * -- moshier@xxxxxxxxxxxxxxx
+ */
+
+#include <machine/asm.h>
+
+ .section .rodata.cst16,"aM",@progbits,16
+
+ .p2align 4
+ ASM_TYPE_DIRECTIVE(c0,@object)
+c0: .byte 0, 0, 0, 0, 0, 0, 0xaa, 0xb8, 0xff, 0x3f
+ .byte 0, 0, 0, 0, 0, 0
+ ASM_SIZE_DIRECTIVE(c0)
+ ASM_TYPE_DIRECTIVE(c1,@object)
+c1: .byte 0x20, 0xfa, 0xee, 0xc2, 0x5f, 0x70, 0xa5, 0xec, 0xed, 0x3f
+ .byte 0, 0, 0, 0, 0, 0
+ ASM_SIZE_DIRECTIVE(c1)
+ 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)
+
+#ifdef PIC
+# define MO(op) op##(%rip)
+#else
+# define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_expl)
+ fldt 8(%rsp)
+/* I added the following ugly construct because expl(+-Inf) resulted
+ in NaN. The ugliness results from the bright minds at Intel.
+ For the i686 the code can be written better.
+ -- drepper@xxxxxxxxxxx */
+ fxam /* Is NaN or +-Inf? */
+ movzwl 8+8(%rsp), %eax
+ andl $0x7fff, %eax
+ cmpl $0x400d, %eax
+ jle 3f
+ /* Overflow, underflow or infinity or NaN as argument. */
+ fstsw %ax
+ movb $0x45, %dh
+ andb %ah, %dh
+ cmpb $0x05, %dh
+ je 1f /* Is +-Inf, jump. */
+ cmpb $0x01, %dh
+ je 2f /* Is +-NaN, jump. */
+ /* Overflow or underflow; saturate. */
+ fstp %st
+ fldt MO(csat)
+ andb $2, %ah
+ jz 3f
+ fchs
+3: fldl2e /* 1 log2(e) */
+ fmul %st(1), %st /* 1 x log2(e) */
+ frndint /* 1 i */
+ fld %st(1) /* 2 x */
+ frndint /* 2 xi */
+ fld %st(1) /* 3 i */
+ fldt MO(c0) /* 4 c0 */
+ fld %st(2) /* 5 xi */
+ fmul %st(1), %st /* 5 c0 xi */
+ fsubp %st, %st(2) /* 4 f = c0 xi - i */
+ fld %st(4) /* 5 x */
+ fsub %st(3), %st /* 5 xf = x - xi */
+ fmulp %st, %st(1) /* 4 c0 xf */
+ faddp %st, %st(1) /* 3 f = f + c0 xf */
+ fldt MO(c1) /* 4 */
+ fmul %st(4), %st /* 4 c1 * x */
+ faddp %st, %st(1) /* 3 f = f + c1 * x */
+ f2xm1 /* 3 2^(fract(x * log2(e))) - 1 */
+ fld1 /* 4 1.0 */
+ faddp /* 3 2^(fract(x * log2(e))) */
+ fstp %st(1) /* 2 */
+ fscale /* 2 scale factor is st(1); e^x */
+ fstp %st(1) /* 1 */
+ fstp %st(1) /* 0 */
+ jmp 2f
+1: testl $0x200, %eax /* Test sign. */
+ jz 2f /* If positive, jump. */
+ fstp %st
+ fldz /* Set result to 0. */
+2: ret
+END(__ieee754_expl)
+strong_alias (__ieee754_expl, __expl_finite)
Removed: fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/e_expl.c (removed)
@@ -1,1 +1,0 @@
-#include "sysdeps/i386/fpu/e_expl.c"
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits