diff options
Diffstat (limited to 'sysdeps/i386/fpu')
61 files changed, 364 insertions, 455 deletions
diff --git a/sysdeps/i386/fpu/bits/mathdef.h b/sysdeps/i386/fpu/bits/mathdef.h new file mode 100644 index 0000000000..ec42ed5df9 --- /dev/null +++ b/sysdeps/i386/fpu/bits/mathdef.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2004 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#if !defined _MATH_H && !defined _COMPLEX_H +# error "Never use <bits/mathdef.h> directly; include <math.h> instead" +#endif + +#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF +# define _MATH_H_MATHDEF 1 + +# if defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0 +/* When using -mfpmath=sse, values are computed with the precission of the + used type. */ +typedef float float_t; /* `float' expressions are evaluated as `float'. */ +typedef double double_t; /* `double' expressions are evaluated as + `double'. */ +# else +/* The ix87 FPUs evaluate all values in the 80 bit floating-point format + which is also available for the user as `long double'. Therefore we + define: */ +typedef long double float_t; /* `float' expressions are evaluated as + `long double'. */ +typedef long double double_t; /* `double' expressions are evaluated as + `long double'. */ +# endif + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +# define FP_ILOGB0 (-2147483647 - 1) +# define FP_ILOGBNAN (-2147483647 - 1) + +#endif /* ISO C99 */ diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h index 28547d44b8..e04ce95099 100644 --- a/sysdeps/i386/fpu/bits/mathinline.h +++ b/sysdeps/i386/fpu/bits/mathinline.h @@ -1,5 +1,5 @@ /* Inline math functions for i387. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995. @@ -529,38 +529,24 @@ __inline_mathcodeNP (tanh, __x, \ __inline_mathcodeNP (floor, __x, \ register long double __value; \ - register int __ignore; \ - unsigned short int __cw; \ - unsigned short int __cwtmp; \ - __asm __volatile ("fnstcw %3\n\t" \ - "movzwl %3, %1\n\t" \ - "andl $0xf3ff, %1\n\t" \ - "orl $0x0400, %1\n\t" /* rounding down */ \ - "movw %w1, %2\n\t" \ - "fldcw %2\n\t" \ - "frndint\n\t" \ - "fldcw %3" \ - : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \ - "=m" (__cw) \ - : "0" (__x)); \ + __volatile unsigned short int __cw; \ + __volatile unsigned short int __cwtmp; \ + __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ + __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ \ + __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ + __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ + __asm __volatile ("fldcw %0" : : "m" (__cw)); \ return __value) __inline_mathcodeNP (ceil, __x, \ register long double __value; \ - register int __ignore; \ - unsigned short int __cw; \ - unsigned short int __cwtmp; \ - __asm __volatile ("fnstcw %3\n\t" \ - "movzwl %3, %1\n\t" \ - "andl $0xf3ff, %1\n\t" \ - "orl $0x0800, %1\n\t" /* rounding up */ \ - "movw %w1, %2\n\t" \ - "fldcw %2\n\t" \ - "frndint\n\t" \ - "fldcw %3" \ - : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \ - "=m" (__cw) \ - : "0" (__x)); \ + __volatile unsigned short int __cw; \ + __volatile unsigned short int __cwtmp; \ + __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ + __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ \ + __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ + __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ + __asm __volatile ("fldcw %0" : : "m" (__cw)); \ return __value) #ifdef __FAST_MATH__ diff --git a/sysdeps/i386/fpu/e_acosh.S b/sysdeps/i386/fpu/e_acosh.S index 62a232471f..981425ec7a 100644 --- a/sysdeps/i386/fpu/e_acosh.S +++ b/sysdeps/i386/fpu/e_acosh.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 2005 Free Software Foundation, Inc. + Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -50,7 +50,9 @@ ENTRY(__ieee754_acosh) cmpl $0x41b00000, %ecx ja 3f // x > 2^28 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x40000000, %ecx ja 4f // x > 2 diff --git a/sysdeps/i386/fpu/e_acoshf.S b/sysdeps/i386/fpu/e_acoshf.S index 1906c60578..17be69d575 100644 --- a/sysdeps/i386/fpu/e_acoshf.S +++ b/sysdeps/i386/fpu/e_acoshf.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -50,7 +50,9 @@ ENTRY(__ieee754_acoshf) cmpl $0x47000000, %ecx ja 3f // x > 2^14 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x40000000, %ecx ja 4f // x > 2 diff --git a/sysdeps/i386/fpu/e_acoshl.S b/sysdeps/i386/fpu/e_acoshl.S index c7b548d25a..7b6885da18 100644 --- a/sysdeps/i386/fpu/e_acoshl.S +++ b/sysdeps/i386/fpu/e_acoshl.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -57,7 +57,9 @@ ENTRY(__ieee754_acoshl) cmpl $0x4020, %ecx ja 3f // x > 2^34 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x4000, %ecx ja 4f // x > 2 diff --git a/sysdeps/i386/fpu/e_atanh.S b/sysdeps/i386/fpu/e_atanh.S index 3566ec6eff..6fb53a4acc 100644 --- a/sysdeps/i386/fpu/e_atanh.S +++ b/sysdeps/i386/fpu/e_atanh.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arctanh function. - Copyright (C) 1996, 1999, 2005 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. @@ -58,9 +58,7 @@ ENTRY(__ieee754_atanh) #ifdef PIC call 1f - cfi_adjust_cfa_offset (4) 1: popl %edx - cfi_adjust_cfa_offset (-4) addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif diff --git a/sysdeps/i386/fpu/e_atanhf.S b/sysdeps/i386/fpu/e_atanhf.S index 10ce6aed9e..a517929f2a 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, 1999, 2005 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. @@ -57,7 +57,9 @@ ENTRY(__ieee754_atanhf) ja 5f #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif andl $0x80000000, %ecx // ECX == 0 iff X >= 0 diff --git a/sysdeps/i386/fpu/e_atanhl.S b/sysdeps/i386/fpu/e_atanhl.S index 8618c3fb35..6fda9bef89 100644 --- a/sysdeps/i386/fpu/e_atanhl.S +++ b/sysdeps/i386/fpu/e_atanhl.S @@ -64,7 +64,9 @@ ENTRY(__ieee754_atanhl) 7: #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif andl $0x8000, %ecx // ECX == 0 iff X >= 0 diff --git a/sysdeps/i386/fpu/e_expl.c b/sysdeps/i386/fpu/e_expl.c index 2240ceac47..a090d0dabc 100644 --- a/sysdeps/i386/fpu/e_expl.c +++ b/sysdeps/i386/fpu/e_expl.c @@ -24,8 +24,8 @@ #include <math_private.h> -static const long double c0 = 1.44268798828125L; -static const long double c1 = 7.05260771340735992468e-6L; +static long double c0 = 1.44268798828125L; +static long double c1 = 7.05260771340735992468e-6L; long double __ieee754_expl (long double x) diff --git a/sysdeps/i386/fpu/e_log.S b/sysdeps/i386/fpu/e_log.S index ce55b72292..c7cacdfb0a 100644 --- a/sysdeps/i386/fpu/e_log.S +++ b/sysdeps/i386/fpu/e_log.S @@ -36,15 +36,13 @@ limit: .double 0.29 ENTRY(__ieee754_log) fldln2 // log(2) fldl 4(%esp) // x : log(2) - fxam - fnstsw #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fld %st // x : x : log(2) - sahf - jc 3f // in case x is NaN or +-Inf -4: fsubl MO(one) // x-1 : x : log(2) + fsubl MO(one) // x-1 : x : log(2) fld %st // x-1 : x-1 : x : log(2) fabs // |x-1| : x-1 : x : log(2) fcompl MO(limit) // x-1 : x : log(2) @@ -58,9 +56,4 @@ ENTRY(__ieee754_log) 2: fstp %st(0) // x : log(2) fyl2x // log(x) ret - -3: jp 4b // in case x is +-Inf - fstp %st(1) - fstp %st(1) - ret END (__ieee754_log) diff --git a/sysdeps/i386/fpu/e_log10.S b/sysdeps/i386/fpu/e_log10.S index 525f08c96d..e93184c219 100644 --- a/sysdeps/i386/fpu/e_log10.S +++ b/sysdeps/i386/fpu/e_log10.S @@ -37,7 +37,9 @@ ENTRY(__ieee754_log10) fldlg2 // log10(2) fldl 4(%esp) // x : log10(2) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam fnstsw diff --git a/sysdeps/i386/fpu/e_log10f.S b/sysdeps/i386/fpu/e_log10f.S index da5069d583..0a89f54784 100644 --- a/sysdeps/i386/fpu/e_log10f.S +++ b/sysdeps/i386/fpu/e_log10f.S @@ -38,7 +38,9 @@ ENTRY(__ieee754_log10f) fldlg2 // log10(2) flds 4(%esp) // x : log10(2) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam fnstsw diff --git a/sysdeps/i386/fpu/e_log10l.S b/sysdeps/i386/fpu/e_log10l.S index 3811516be5..25d3501663 100644 --- a/sysdeps/i386/fpu/e_log10l.S +++ b/sysdeps/i386/fpu/e_log10l.S @@ -39,7 +39,9 @@ ENTRY(__ieee754_log10l) fldlg2 // log10(2) fldt 4(%esp) // x : log10(2) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam fnstsw diff --git a/sysdeps/i386/fpu/e_log2.S b/sysdeps/i386/fpu/e_log2.S index d80bf80239..4f7f0d57d9 100644 --- a/sysdeps/i386/fpu/e_log2.S +++ b/sysdeps/i386/fpu/e_log2.S @@ -34,7 +34,9 @@ limit: .double 0.29 .text ENTRY(__ieee754_log2) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fldl MO(one) fldl 4(%esp) // x : 1 diff --git a/sysdeps/i386/fpu/e_log2f.S b/sysdeps/i386/fpu/e_log2f.S index 9eb7b2a826..88f28b423c 100644 --- a/sysdeps/i386/fpu/e_log2f.S +++ b/sysdeps/i386/fpu/e_log2f.S @@ -34,7 +34,9 @@ limit: .double 0.29 .text ENTRY(__ieee754_log2f) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fldl MO(one) flds 4(%esp) // x : 1 diff --git a/sysdeps/i386/fpu/e_log2l.S b/sysdeps/i386/fpu/e_log2l.S index 9de08f5de1..f5c661a2d1 100644 --- a/sysdeps/i386/fpu/e_log2l.S +++ b/sysdeps/i386/fpu/e_log2l.S @@ -34,7 +34,9 @@ limit: .double 0.29 .text ENTRY(__ieee754_log2l) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fldl MO(one) fldt 4(%esp) // x : 1 diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S index cd4538b594..bdba1d3225 100644 --- a/sysdeps/i386/fpu/e_logf.S +++ b/sysdeps/i386/fpu/e_logf.S @@ -37,15 +37,13 @@ limit: .double 0.29 ENTRY(__ieee754_logf) fldln2 // log(2) flds 4(%esp) // x : log(2) - fxam - fnstsw #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fld %st // x : x : log(2) - sahf - jc 3f // in case x is NaN or +-Inf -4: fsubl MO(one) // x-1 : x : log(2) + fsubl MO(one) // x-1 : x : log(2) fld %st // x-1 : x-1 : x : log(2) fabs // |x-1| : x-1 : x : log(2) fcompl MO(limit) // x-1 : x : log(2) @@ -59,9 +57,4 @@ ENTRY(__ieee754_logf) 2: fstp %st(0) // x : log(2) fyl2x // log(x) ret - -3: jp 4b // in case x is +-Inf - fstp %st(1) - fstp %st(1) - ret END (__ieee754_logf) diff --git a/sysdeps/i386/fpu/e_logl.S b/sysdeps/i386/fpu/e_logl.S index 551dcf1e46..bda3ea508e 100644 --- a/sysdeps/i386/fpu/e_logl.S +++ b/sysdeps/i386/fpu/e_logl.S @@ -37,15 +37,13 @@ limit: .double 0.29 ENTRY(__ieee754_logl) fldln2 // log(2) fldt 4(%esp) // x : log(2) - fxam - fnstsw #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fld %st // x : x : log(2) - sahf - jc 3f // in case x is NaN or +-Inf -4: fsubl MO(one) // x-1 : x : log(2) + fsubl MO(one) // x-1 : x : log(2) fld %st // x-1 : x-1 : x : log(2) fabs // |x-1| : x-1 : x : log(2) fcompl MO(limit) // x-1 : x : log(2) @@ -59,9 +57,4 @@ ENTRY(__ieee754_logl) 2: fstp %st(0) // x : log(2) fyl2x // log(x) ret - -3: jp 4b // in case x is +-Inf - fstp %st(1) - fstp %st(1) - ret END (__ieee754_logl) diff --git a/sysdeps/i386/fpu/e_pow.S b/sysdeps/i386/fpu/e_pow.S index 792f926902..d100c0ac57 100644 --- a/sysdeps/i386/fpu/e_pow.S +++ b/sysdeps/i386/fpu/e_pow.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of pow function. - Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007 + Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -67,7 +67,9 @@ ENTRY(__ieee754_pow) fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw @@ -85,7 +87,6 @@ ENTRY(__ieee754_pow) fldl 4(%esp) // x : y subl $8,%esp - cfi_adjust_cfa_offset (8) fxam fnstsw @@ -119,9 +120,7 @@ ENTRY(__ieee754_pow) /* OK, we have an integer value for y. */ popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) orl $0, %edx fstp %st(0) // x jns 4f // y >= 0, jump @@ -156,16 +155,14 @@ ENTRY(__ieee754_pow) 31: fstp %st(1) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 2: /* y is a real number. */ fxch // x : y fldl MO(one) // 1.0 : x : y - fldl MO(limit) // 0.29 : 1.0 : x : y - fld %st(2) // x : 0.29 : 1.0 : x : y - fsub %st(2) // x-1 : 0.29 : 1.0 : x : y - fabs // |x-1| : 0.29 : 1.0 : x : y - fucompp // 1.0 : x : y + fld %st(1) // x : 1.0 : x : y + fsub %st(1) // x-1 : 1.0 : x : y + fabs // |x-1| : 1.0 : x : y + fcompl MO(limit) // 1.0 : x : y fnstsw fxch // x : 1.0 : y sahf @@ -184,7 +181,6 @@ ENTRY(__ieee754_pow) faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) addl $8, %esp - cfi_adjust_cfa_offset (-8) fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ret @@ -198,10 +194,9 @@ ENTRY(__ieee754_pow) // y == ±inf .align ALIGNARG(4) 12: fstp %st(0) // pop y - fldl MO(one) // 1 - fldl 4(%esp) // x : 1 - fabs // abs(x) : 1 - fucompp // < 1, == 1, or > 1 + fldl 4(%esp) // x + fabs + fcompl MO(one) // < 1, == 1, or > 1 fnstsw andb $0x45, %ah cmpb $0x45, %ah @@ -224,7 +219,6 @@ ENTRY(__ieee754_pow) 13: fldl 4(%esp) // load x == NaN ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±inf 15: fstp %st(0) // y @@ -243,9 +237,7 @@ ENTRY(__ieee754_pow) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 18f // jump if not odd movl %edx, %eax @@ -259,27 +251,22 @@ ENTRY(__ieee754_pow) fldl MOX(minf_mzero, %edx, 8) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 16: fcompl MO(zero) addl $8, %esp - cfi_adjust_cfa_offset (-8) fnstsw shrl $5, %eax andl $8, %eax fldl MOX(inf_zero, %eax, 1) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 17: shll $30, %edx // sign bit for y in right position addl $8, %esp - cfi_adjust_cfa_offset (-8) 18: shrl $31, %edx fldl MOX(inf_zero, %edx, 8) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±0 20: fstp %st(0) // y @@ -301,9 +288,7 @@ ENTRY(__ieee754_pow) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 27f // jump if not odd cmpl $0xffe00000, %edx @@ -315,16 +300,13 @@ ENTRY(__ieee754_pow) fchs ret - cfi_adjust_cfa_offset (8) 25: fstp %st(0) 26: addl $8, %esp - cfi_adjust_cfa_offset (-8) 27: // Raise divide-by-zero exception and get infinity value. fldl MO(one) fdivl MO(zero) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±0 and y is > 0. We must find out whether y is an odd integer. 21: testb $2, %dh @@ -341,9 +323,7 @@ ENTRY(__ieee754_pow) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 24f // jump if not odd cmpl $0xffe00000, %edx @@ -352,10 +332,8 @@ ENTRY(__ieee754_pow) fldl MO(mzero) ret - cfi_adjust_cfa_offset (8) 22: fstp %st(0) 23: addl $8, %esp // Don't use 2 x pop - cfi_adjust_cfa_offset (-8) 24: fldl MO(zero) ret diff --git a/sysdeps/i386/fpu/e_powf.S b/sysdeps/i386/fpu/e_powf.S index c91545418d..b3fa624f4d 100644 --- a/sysdeps/i386/fpu/e_powf.S +++ b/sysdeps/i386/fpu/e_powf.S @@ -1,6 +1,5 @@ /* ix87 specific implementation of pow function. - Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005, 2007 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -67,7 +66,9 @@ ENTRY(__ieee754_powf) fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw @@ -85,7 +86,6 @@ ENTRY(__ieee754_powf) flds 4(%esp) // x : y subl $4, %esp - cfi_adjust_cfa_offset (4) fxam fnstsw @@ -119,7 +119,6 @@ ENTRY(__ieee754_powf) /* OK, we have an integer value for y. */ popl %edx - cfi_adjust_cfa_offset (-4) orl $0, %edx fstp %st(0) // x jns 4f // y >= 0, jump @@ -150,16 +149,14 @@ ENTRY(__ieee754_powf) 31: fstp %st(1) ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) 2: /* y is a real number. */ fxch // x : y fldl MO(one) // 1.0 : x : y - fldl MO(limit) // 0.29 : 1.0 : x : y - fld %st(2) // x : 0.29 : 1.0 : x : y - fsub %st(2) // x-1 : 0.29 : 1.0 : x : y - fabs // |x-1| : 0.29 : 1.0 : x : y - fucompp // 1.0 : x : y + fld %st(1) // x : 1.0 : x : y + fsub %st(1) // x-1 : 1.0 : x : y + fabs // |x-1| : 1.0 : x : y + fcompl MO(limit) // 1.0 : x : y fnstsw fxch // x : 1.0 : y sahf @@ -178,7 +175,6 @@ ENTRY(__ieee754_powf) faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) addl $4, %esp - cfi_adjust_cfa_offset (-4) fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ret @@ -192,10 +188,9 @@ ENTRY(__ieee754_powf) // y == ±inf .align ALIGNARG(4) 12: fstp %st(0) // pop y - fldl MO(one) // 1 - flds 4(%esp) // x : 1 - fabs // abs(x) : 1 - fucompp // < 1, == 1, or > 1 + flds 4(%esp) // x + fabs + fcompl MO(one) // < 1, == 1, or > 1 fnstsw andb $0x45, %ah cmpb $0x45, %ah @@ -218,7 +213,6 @@ ENTRY(__ieee754_powf) 13: flds 4(%esp) // load x == NaN ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) // x is ±inf 15: fstp %st(0) // y @@ -237,7 +231,6 @@ ENTRY(__ieee754_powf) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %edx - cfi_adjust_cfa_offset (-4) testb $1, %dl jz 18f // jump if not odd movl %edx, %eax @@ -251,27 +244,22 @@ ENTRY(__ieee754_powf) fldl MOX(minf_mzero, %edx, 8) ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) 16: fcompl MO(zero) addl $4, %esp - cfi_adjust_cfa_offset (-4) fnstsw shrl $5, %eax andl $8, %eax fldl MOX(inf_zero, %eax, 1) ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) 17: shll $30, %edx // sign bit for y in right position addl $4, %esp - cfi_adjust_cfa_offset (-4) 18: shrl $31, %edx fldl MOX(inf_zero, %edx, 8) ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) // x is ±0 20: fstp %st(0) // y @@ -293,7 +281,6 @@ ENTRY(__ieee754_powf) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %edx - cfi_adjust_cfa_offset (-4) testb $1, %dl jz 27f // jump if not odd cmpl $0xff000000, %edx @@ -305,16 +292,13 @@ ENTRY(__ieee754_powf) fchs ret - cfi_adjust_cfa_offset (4) 25: fstp %st(0) 26: addl $4, %esp - cfi_adjust_cfa_offset (-4) 27: // Raise divide-by-zero exception and get infinity value. fldl MO(one) fdivl MO(zero) ret - cfi_adjust_cfa_offset (4) .align ALIGNARG(4) // x is ±0 and y is > 0. We must find out whether y is an odd integer. 21: testb $2, %dh @@ -331,7 +315,6 @@ ENTRY(__ieee754_powf) // OK, the value is an integer, but is the number of bits small // enough so that all are coming from the mantissa? popl %edx - cfi_adjust_cfa_offset (-4) testb $1, %dl jz 24f // jump if not odd cmpl $0xff000000, %edx @@ -340,10 +323,8 @@ ENTRY(__ieee754_powf) fldl MO(mzero) ret - cfi_adjust_cfa_offset (4) 22: fstp %st(0) 23: addl $4, %esp // Don't use pop. - cfi_adjust_cfa_offset (-4) 24: fldl MO(zero) ret diff --git a/sysdeps/i386/fpu/e_powl.S b/sysdeps/i386/fpu/e_powl.S index 6215496207..080764b84a 100644 --- a/sysdeps/i386/fpu/e_powl.S +++ b/sysdeps/i386/fpu/e_powl.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of pow function. - Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007 + Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -67,7 +67,9 @@ ENTRY(__ieee754_powl) fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw @@ -85,7 +87,6 @@ ENTRY(__ieee754_powl) fldt 4(%esp) // x : y subl $8,%esp - cfi_adjust_cfa_offset (8) fxam fnstsw @@ -119,9 +120,7 @@ ENTRY(__ieee754_powl) /* OK, we have an integer value for y. */ popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) orl $0, %edx fstp %st(0) // x jns 4f // y >= 0, jump @@ -156,16 +155,14 @@ ENTRY(__ieee754_powl) 31: fstp %st(1) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 2: /* y is a real number. */ fxch // x : y fldl MO(one) // 1.0 : x : y - fldl MO(limit) // 0.29 : 1.0 : x : y - fld %st(2) // x : 0.29 : 1.0 : x : y - fsub %st(2) // x-1 : 0.29 : 1.0 : x : y - fabs // |x-1| : 0.29 : 1.0 : x : y - fucompp // 1.0 : x : y + fld %st(1) // x : 1.0 : x : y + fsub %st(1) // x-1 : 1.0 : x : y + fabs // |x-1| : 1.0 : x : y + fcompl MO(limit) // 1.0 : x : y fnstsw fxch // x : 1.0 : y sahf @@ -189,16 +186,13 @@ ENTRY(__ieee754_powl) faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) addl $8, %esp - cfi_adjust_cfa_offset (-8) fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ret - cfi_adjust_cfa_offset (8) 28: fstp %st(1) // y*log2(x) fldl MO(one) // 1 : y*log2(x) fscale // 2^(y*log2(x)) : y*log2(x) addl $8, %esp - cfi_adjust_cfa_offset (-8) fstp %st(1) // 2^(y*log2(x)) ret @@ -211,10 +205,9 @@ ENTRY(__ieee754_powl) // y == ±inf .align ALIGNARG(4) 12: fstp %st(0) // pop y - fldl MO(one) // 1 - fldt 4(%esp) // x : 1 - fabs // abs(x) : 1 - fucompp // < 1, == 1, or > 1 + fldt 4(%esp) // x + fabs + fcompl MO(one) // < 1, == 1, or > 1 fnstsw andb $0x45, %ah cmpb $0x45, %ah @@ -237,7 +230,6 @@ ENTRY(__ieee754_powl) 13: fldt 4(%esp) // load x == NaN ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±inf 15: fstp %st(0) // y @@ -255,9 +247,7 @@ ENTRY(__ieee754_powl) // OK, the value is an integer, but is it odd? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 18f // jump if not odd // It's an odd integer. @@ -265,27 +255,22 @@ ENTRY(__ieee754_powl) fldl MOX(minf_mzero, %edx, 8) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 16: fcompl MO(zero) addl $8, %esp - cfi_adjust_cfa_offset (-8) fnstsw shrl $5, %eax andl $8, %eax fldl MOX(inf_zero, %eax, 1) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) 17: shll $30, %edx // sign bit for y in right position addl $8, %esp - cfi_adjust_cfa_offset (-8) 18: shrl $31, %edx fldl MOX(inf_zero, %edx, 8) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±0 20: fstp %st(0) // y @@ -306,9 +291,7 @@ ENTRY(__ieee754_powl) // OK, the value is an integer, but is it odd? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 27f // jump if not odd // It's an odd integer. @@ -318,16 +301,13 @@ ENTRY(__ieee754_powl) fchs ret - cfi_adjust_cfa_offset (8) 25: fstp %st(0) 26: addl $8, %esp - cfi_adjust_cfa_offset (-8) 27: // Raise divide-by-zero exception and get infinity value. fldl MO(one) fdivl MO(zero) ret - cfi_adjust_cfa_offset (8) .align ALIGNARG(4) // x is ±0 and y is > 0. We must find out whether y is an odd integer. 21: testb $2, %dh @@ -343,19 +323,15 @@ ENTRY(__ieee754_powl) // OK, the value is an integer, but is it odd? popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) andb $1, %al jz 24f // jump if not odd // It's an odd integer. fldl MO(mzero) ret - cfi_adjust_cfa_offset (8) 22: fstp %st(0) 23: addl $8, %esp // Don't use 2 x pop - cfi_adjust_cfa_offset (-8) 24: fldl MO(zero) ret diff --git a/sysdeps/i386/fpu/e_scalb.S b/sysdeps/i386/fpu/e_scalb.S index 7e334a3611..1596f6a700 100644 --- a/sysdeps/i386/fpu/e_scalb.S +++ b/sysdeps/i386/fpu/e_scalb.S @@ -64,7 +64,9 @@ ENTRY(__ieee754_scalb) /* y is -inf */ 1: fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw movl 8(%esp), %edx @@ -84,7 +86,9 @@ ENTRY(__ieee754_scalb) 2: fstp %st fstp %st #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fldl MO(nan) ret diff --git a/sysdeps/i386/fpu/e_scalbf.S b/sysdeps/i386/fpu/e_scalbf.S index e99ee92cb0..d41c29327d 100644 --- a/sysdeps/i386/fpu/e_scalbf.S +++ b/sysdeps/i386/fpu/e_scalbf.S @@ -66,7 +66,9 @@ ENTRY(__ieee754_scalbf) /* y is -inf */ 1: fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw movl 4(%esp), %edx @@ -86,7 +88,9 @@ ENTRY(__ieee754_scalbf) 2: fstp %st fstp %st #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fldl MO(nan) ret diff --git a/sysdeps/i386/fpu/e_scalbl.S b/sysdeps/i386/fpu/e_scalbl.S index 3f67d0befb..65644f8f0e 100644 --- a/sysdeps/i386/fpu/e_scalbl.S +++ b/sysdeps/i386/fpu/e_scalbl.S @@ -66,7 +66,9 @@ ENTRY(__ieee754_scalbl) /* y is -inf */ 1: fxam #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fnstsw movl 12(%esp), %edx @@ -86,7 +88,9 @@ ENTRY(__ieee754_scalbl) 2: fstp %st fstp %st #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif fldl MO(nan) ret diff --git a/sysdeps/i386/fpu/feholdexcpt.c b/sysdeps/i386/fpu/feholdexcpt.c index feaa24b8d9..55096869a1 100644 --- a/sysdeps/i386/fpu/feholdexcpt.c +++ b/sysdeps/i386/fpu/feholdexcpt.c @@ -1,5 +1,5 @@ /* Store current floating-point environment and clear exceptions. - Copyright (C) 1997, 1999, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -51,4 +51,3 @@ feholdexcept (fenv_t *envp) return 0; } -libm_hidden_def (feholdexcept) diff --git a/sysdeps/i386/fpu/fesetround.c b/sysdeps/i386/fpu/fesetround.c index a868f275f0..2746f3ebf3 100644 --- a/sysdeps/i386/fpu/fesetround.c +++ b/sysdeps/i386/fpu/fesetround.c @@ -1,5 +1,5 @@ /* Set current rounding direction. - Copyright (C) 1997, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -50,4 +50,3 @@ fesetround (int round) return 0; } -libm_hidden_def (fesetround) diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 4efc714b29..71c1ab5d8e 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -7,20 +7,20 @@ ldouble: 1 # asin Test "asin (-0.5) == -pi/6": -ildouble: 1 ldouble: 1 -Test "asin (-1.0) == -pi/2": ildouble: 1 +Test "asin (-1.0) == -pi/2": ldouble: 1 -Test "asin (0.5) == pi/6": ildouble: 1 +Test "asin (0.5) == pi/6": ldouble: 1 -Test "asin (0.75) == 0.848062078981481008052944338998418080": ildouble: 1 +Test "asin (0.75) == 0.848062078981481008052944338998418080": ldouble: 1 -Test "asin (1.0) == pi/2": ildouble: 1 +Test "asin (1.0) == pi/2": ldouble: 1 +ildouble: 1 # atanh Test "atanh (0.75) == 0.972955074527656652552676371721589865": @@ -35,20 +35,20 @@ ildouble: 2 ldouble: 2 # cacosh -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": +Test "Real part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i": double: 1 float: 9 idouble: 1 ifloat: 9 ildouble: 6 ldouble: 6 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i": +Test "Imaginary part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i": double: 1 -float: 4 idouble: 1 -ifloat: 4 ildouble: 1 ldouble: 1 +ifloat: 4 +float: 4 Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i": ildouble: 1 ldouble: 1 @@ -149,9 +149,7 @@ float: 1 idouble: 1 ifloat: 1 Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": -double: 1 float: 1 -idouble: 1 ifloat: 1 # cexp @@ -356,9 +354,7 @@ ifloat: 1 ildouble: 2 ldouble: 2 Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -381,9 +377,7 @@ Test "Real part of: ctan (0.75 + 1.25 i) == 0.1608077859162064267251660581734386 ildouble: 1 ldouble: 1 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 3 ldouble: 3 @@ -401,9 +395,7 @@ Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i": float: 1 ifloat: 1 Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": -double: 1 float: 1 -idouble: 1 ifloat: 1 Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i": double: 1 @@ -481,26 +473,24 @@ float: 1 # j0 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 -float: 2 +float: 1 idouble: 1 -ifloat: 2 +ifloat: 1 ildouble: 1 ldouble: 1 Test "j0 (10.0) == -0.245935764451348335197760862485328754": -double: 3 +double: 1 float: 1 -idouble: 3 +idouble: 1 ifloat: 1 Test "j0 (2.0) == 0.223890779141235668051827454649948626": -double: 1 float: 1 -idouble: 1 ifloat: 1 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 -float: 2 +float: 1 idouble: 1 -ifloat: 2 +ifloat: 1 ildouble: 1 ldouble: 1 Test "j0 (8.0) == 0.171650807137553906090869407851972001": @@ -508,23 +498,22 @@ float: 1 ifloat: 1 # j1 -Test "j1 (0.75) == 0.349243602174862192523281016426251335": -double: 1 -idouble: 1 Test "j1 (10.0) == 0.0434727461688614366697487680258592883": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "j1 (0.75) == 0.349243602174862192523281016426251335": +double: 1 +idouble: 1 Test "j1 (2.0) == 0.576724807756873387202448242269137087": double: 1 idouble: 1 -Test "j1 (8.0) == 0.234636346853914624381276651590454612": +Test "j1 (0.75) == 0.349243602174862192523281016426251335": double: 1 -float: 1 idouble: 1 +Test "j1 (8.0) == 0.234636346853914624381276651590454612": +float: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -532,26 +521,24 @@ ldouble: 1 # jn Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 -float: 2 +float: 1 idouble: 1 -ifloat: 2 +ifloat: 1 ildouble: 1 ldouble: 1 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754": -double: 3 +double: 1 float: 1 -idouble: 3 +idouble: 1 ifloat: 1 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626": -double: 1 float: 1 -idouble: 1 ifloat: 1 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1": double: 1 -float: 2 +float: 1 idouble: 1 -ifloat: 2 +ifloat: 1 ildouble: 1 ldouble: 1 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001": @@ -561,9 +548,7 @@ Test "jn (1, 0.75) == 0.349243602174862192523281016426251335": double: 1 idouble: 1 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -571,24 +556,22 @@ Test "jn (1, 2.0) == 0.576724807756873387202448242269137087": double: 1 idouble: 1 Test "jn (1, 8.0) == 0.234636346853914624381276651590454612": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 Test "jn (10, -1.0) == 0.263061512368745320699785368779050294e-9": double: 1 -float: 1 idouble: 1 -ifloat: 1 ildouble: 1 ldouble: 1 +ifloat: 1 +float: 1 Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18": -double: 1 float: 1 -idouble: 1 ifloat: 1 +double: 1 +idouble: 1 Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10": float: 1 ifloat: 1 @@ -596,46 +579,46 @@ ildouble: 2 ldouble: 2 Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9": double: 1 -float: 1 idouble: 1 -ifloat: 1 ildouble: 1 ldouble: 1 +ifloat: 1 +float: 1 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428": -double: 5 +double: 2 float: 2 -idouble: 5 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6": -double: 2 -idouble: 2 ildouble: 1 ldouble: 1 +idouble: 2 +double: 2 Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083": ildouble: 1 ldouble: 1 Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2": -double: 1 float: 1 -idouble: 1 ifloat: 1 +double: 1 +idouble: 1 Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083": ildouble: 1 ldouble: 1 Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563": -double: 5 +double: 1 float: 2 -idouble: 5 +idouble: 1 ifloat: 2 ildouble: 1 ldouble: 1 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835": -double: 1 -idouble: 1 ildouble: 1 ldouble: 1 +double: 1 +idouble: 1 # lgamma Test "lgamma (-0.5) == log(2*sqrt(pi))": @@ -644,10 +627,10 @@ idouble: 1 ildouble: 1 ldouble: 1 Test "lgamma (0.7) == 0.260867246531666514385732417016759578": -double: 1 float: 1 -idouble: 1 ifloat: 1 +double: 1 +idouble: 1 Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1": double: 1 float: 2 @@ -694,7 +677,6 @@ ldouble: 1 # sinh Test "sinh (0.75) == 0.822316731935829980703661634446913849": -double: 1 ildouble: 1 # tan @@ -732,39 +714,32 @@ float: 1 idouble: 1 ifloat: 1 Test "y0 (1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 ildouble: 1 ldouble: 1 -Test "y0 (1.5) == 0.382448923797758843955068554978089862": -double: 1 -float: 1 -idouble: 1 ifloat: 1 +float: 1 +double: 2 +idouble: 2 Test "y0 (10.0) == 0.0556711672835993914244598774101900481": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 Test "y0 (8.0) == 0.223521489387566220527323400498620359": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "y0 (1.5) == 0.382448923797758843955068554978089862": +float: 1 +ifloat: 1 +double: 1 +idouble: 1 # y1 Test "y1 (0.125) == -5.19993611253477499595928744876579921": ildouble: 1 ldouble: 1 -Test "y1 (1.0) == -0.781212821300288716547150000047964821": -double: 1 -idouble: 1 Test "y1 (10.0) == 0.249015424206953883923283474663222803": double: 2 float: 2 @@ -778,12 +753,13 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "y1 (8.0) == -0.158060461731247494255555266187483550": -double: 1 float: 2 -idouble: 1 ifloat: 2 ildouble: 1 ldouble: 1 +Test "y1 (1.0) == -0.781212821300288716547150000047964821": +double: 1 +idouble: 1 # yn Test "yn (0, 0.125) == -1.38968062514384052915582277745018693": @@ -795,28 +771,24 @@ float: 1 idouble: 1 ifloat: 1 Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 ildouble: 1 ldouble: 1 +ifloat: 1 +float: 1 +double: 2 +idouble: 2 Test "yn (0, 1.5) == 0.382448923797758843955068554978089862": -double: 1 +ifloat: 1 float: 1 +double: 1 idouble: 1 -ifloat: 1 Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 Test "yn (0, 8.0) == 0.223521489387566220527323400498620359": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -824,8 +796,8 @@ Test "yn (1, 0.125) == -5.19993611253477499595928744876579921": ildouble: 1 ldouble: 1 Test "yn (1, 1.0) == -0.781212821300288716547150000047964821": -double: 1 idouble: 1 +double: 1 Test "yn (1, 10.0) == 0.249015424206953883923283474663222803": double: 2 float: 2 @@ -839,12 +811,13 @@ ifloat: 2 ildouble: 1 ldouble: 1 Test "yn (1, 8.0) == -0.158060461731247494255555266187483550": -double: 1 float: 2 -idouble: 1 ifloat: 2 ildouble: 1 ldouble: 1 +Test "yn (3, 0.75) == -12.9877176234475433186319774484809207": +ifloat: 1 +float: 1 Test "yn (10, 0.125) == -127057845771019398.252538486899753195": double: 1 float: 1 @@ -868,10 +841,10 @@ float: 3 idouble: 1 ifloat: 3 Test "yn (10, 2.0) == -129184.542208039282635913145923304214": -double: 2 float: 3 -idouble: 2 ifloat: 3 +double: 2 +idouble: 2 Test "yn (3, 0.125) == -2612.69757350066712600220955744091741": ildouble: 1 ldouble: 1 @@ -882,12 +855,12 @@ idouble: 1 ifloat: 1 ildouble: 2 ldouble: 2 -Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": -double: 1 +Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": float: 1 -idouble: 1 ifloat: 1 -Test "yn (3, 2.0) == -1.12778377684042778608158395773179238": +double: 1 +idouble: 1 +Test "yn (3, 10.0) == -0.251362657183837329779204747654240998": double: 1 float: 1 idouble: 1 @@ -899,8 +872,8 @@ ildouble: 622 ldouble: 622 Function: "asin": -ildouble: 1 ldouble: 1 +ildouble: 1 Function: "atanh": ildouble: 2 @@ -922,11 +895,11 @@ ldouble: 6 Function: Imaginary part of "cacosh": double: 1 -float: 4 idouble: 1 -ifloat: 4 ildouble: 1 ldouble: 1 +ifloat: 4 +float: 4 Function: Real part of "casin": double: 1 @@ -1100,9 +1073,7 @@ ildouble: 3 ldouble: 3 Function: Real part of "ctanh": -double: 1 float: 1 -idouble: 1 ifloat: 1 ildouble: 5 ldouble: 5 @@ -1144,10 +1115,10 @@ Function: "hypot": float: 1 Function: "j0": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 +double: 1 +float: 1 +idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1160,9 +1131,9 @@ ildouble: 1 ldouble: 1 Function: "jn": -double: 5 +double: 2 float: 2 -idouble: 5 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 @@ -1194,7 +1165,6 @@ ildouble: 1 ldouble: 1 Function: "sinh": -double: 1 ildouble: 1 Function: "tan": diff --git a/sysdeps/i386/fpu/math_private.h b/sysdeps/i386/fpu/math_private.h deleted file mode 100644 index a426788ef1..0000000000 --- a/sysdeps/i386/fpu/math_private.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _MATH_PRIVATE_H - -#define math_opt_barrier(x) \ -({ __typeof(x) __x; \ - __asm ("" : "=t" (__x) : "0" (x)); \ - __x; }) -#define math_force_eval(x) \ -do \ - { \ - if (sizeof (x) <= sizeof (double)) \ - __asm __volatile ("" : : "m" (x)); \ - else \ - __asm __volatile ("" : : "f" (x)); \ - } \ -while (0) - -#include <math/math_private.h> -#endif diff --git a/sysdeps/i386/fpu/s_asinh.S b/sysdeps/i386/fpu/s_asinh.S index ca042b414b..6c99d3b6f6 100644 --- a/sysdeps/i386/fpu/s_asinh.S +++ b/sysdeps/i386/fpu/s_asinh.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -62,7 +62,9 @@ ENTRY(__asinh) fxch // |x| : log(2) ja 3f // |x| > 2^28 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x40000000, %eax ja 5f // |x| > 2 @@ -98,7 +100,9 @@ ENTRY(__asinh) .align ALIGNARG(4) 2: #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif jecxz 4f fchs // x diff --git a/sysdeps/i386/fpu/s_asinhf.S b/sysdeps/i386/fpu/s_asinhf.S index d0ce6afc22..32e6fd6071 100644 --- a/sysdeps/i386/fpu/s_asinhf.S +++ b/sysdeps/i386/fpu/s_asinhf.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -62,7 +62,9 @@ ENTRY(__asinhf) fxch // |x| : log(2) ja 3f // |x| > 2^14 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x40000000, %eax ja 5f // |x| > 2 @@ -98,7 +100,9 @@ ENTRY(__asinhf) .align ALIGNARG(4) 2: #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif jecxz 4f fchs // x diff --git a/sysdeps/i386/fpu/s_asinhl.S b/sysdeps/i386/fpu/s_asinhl.S index 1040eead1c..5933460f64 100644 --- a/sysdeps/i386/fpu/s_asinhl.S +++ b/sysdeps/i386/fpu/s_asinhl.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of arcsinh. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -69,7 +69,9 @@ ENTRY(__asinhl) fxch // |x| : log(2) ja 3f // |x| > 2^34 #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpl $0x4000, %eax ja 5f // |x| > 2 @@ -105,7 +107,9 @@ ENTRY(__asinhl) .align ALIGNARG(4) 2: #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif jecxz 4f fchs // x diff --git a/sysdeps/i386/fpu/s_cbrt.S b/sysdeps/i386/fpu/s_cbrt.S index e180b15466..c69958bb57 100644 --- a/sysdeps/i386/fpu/s_cbrt.S +++ b/sysdeps/i386/fpu/s_cbrt.S @@ -1,5 +1,5 @@ /* Compute cubic root of double value. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Dirk Alboth <dirka@uni-paderborn.de> and Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -89,9 +89,9 @@ ENTRY(__cbrt) #ifdef PIC pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) + call 3f +3: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %ebx #endif cmpl $0x00100000, %eax @@ -178,17 +178,13 @@ ENTRY(__cbrt) fdivp %st, %st(1) /* u*(t2+2*xm)/(2*t2+xm) */ fmull MOX(16+factor,%ecx) /* u*(t2+2*xm)/(2*t2+xm)*FACT */ pushl %eax - cfi_adjust_cfa_offset (4) fildl (%esp) /* xe/3 : u*(t2+2*xm)/(2*t2+xm)*FACT */ fxch /* u*(t2+2*xm)/(2*t2+xm)*FACT : xe/3 */ fscale /* u*(t2+2*xm)/(2*t2+xm)*FACT*2^xe/3 */ popl %edx - cfi_adjust_cfa_offset (-4) #ifdef PIC movl 12(%esp), %eax popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) #else movl 8(%esp), %eax #endif diff --git a/sysdeps/i386/fpu/s_cbrtf.S b/sysdeps/i386/fpu/s_cbrtf.S index 2ff4f6e088..03d5770efa 100644 --- a/sysdeps/i386/fpu/s_cbrtf.S +++ b/sysdeps/i386/fpu/s_cbrtf.S @@ -1,5 +1,5 @@ /* Compute cubic root of float value. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Dirk Alboth <dirka@uni-paderborn.de> and Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -76,9 +76,9 @@ ENTRY(__cbrtf) #ifdef PIC pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) + call 3f +3: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %ebx #endif cmpl $0x00800000, %eax @@ -155,17 +155,13 @@ ENTRY(__cbrtf) fdivp %st, %st(1) /* u*(t2+2*xm)/(2*t2+xm) */ fmull MOX(16+factor,%ecx) /* u*(t2+2*xm)/(2*t2+xm)*FACT */ pushl %eax - cfi_adjust_cfa_offset (4) fildl (%esp) /* xe/3 : u*(t2+2*xm)/(2*t2+xm)*FACT */ fxch /* u*(t2+2*xm)/(2*t2+xm)*FACT : xe/3 */ fscale /* u*(t2+2*xm)/(2*t2+xm)*FACT*2^xe/3 */ popl %edx - cfi_adjust_cfa_offset (-4) #ifdef PIC movl 8(%esp), %eax popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) #else movl 4(%esp), %eax #endif diff --git a/sysdeps/i386/fpu/s_cbrtl.S b/sysdeps/i386/fpu/s_cbrtl.S index 637ad729c1..f9dac170e0 100644 --- a/sysdeps/i386/fpu/s_cbrtl.S +++ b/sysdeps/i386/fpu/s_cbrtl.S @@ -1,5 +1,5 @@ /* Compute cubic root of long double value. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Dirk Alboth <dirka@uni-paderborn.de> and Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -108,9 +108,9 @@ ENTRY(__cbrtl) #ifdef PIC pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) + call 3f +3: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %ebx #endif cmpl $0, %eax @@ -206,17 +206,13 @@ ENTRY(__cbrtl) fldt MOX(32+factor,%ecx) fmulp /* u*(t2+2*xm)/(2*t2+xm)*FACT */ pushl %eax - cfi_adjust_cfa_offset (4) fildl (%esp) /* xe/3 : u*(t2+2*xm)/(2*t2+xm)*FACT */ fxch /* u*(t2+2*xm)/(2*t2+xm)*FACT : xe/3 */ fscale /* u*(t2+2*xm)/(2*t2+xm)*FACT*2^xe/3 */ popl %edx - cfi_adjust_cfa_offset (-4) #ifdef PIC movl 16(%esp), %eax popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) #else movl 12(%esp), %eax #endif diff --git a/sysdeps/i386/fpu/s_cexp.S b/sysdeps/i386/fpu/s_cexp.S index 47e3eb66a6..50d17aea11 100644 --- a/sysdeps/i386/fpu/s_cexp.S +++ b/sysdeps/i386/fpu/s_cexp.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of complex exponential function for double. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -71,7 +71,9 @@ ENTRY(__cexp) fnstsw fldl 16(%esp) /* y : x */ #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif movb %ah, %dh andb $0x45, %ah diff --git a/sysdeps/i386/fpu/s_cexpf.S b/sysdeps/i386/fpu/s_cexpf.S index f116854096..396e056135 100644 --- a/sysdeps/i386/fpu/s_cexpf.S +++ b/sysdeps/i386/fpu/s_cexpf.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of complex exponential function for double. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -71,7 +71,9 @@ ENTRY(__cexpf) fnstsw flds 8(%esp) /* y : x */ #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif movb %ah, %dh andb $0x45, %ah @@ -112,13 +114,10 @@ ENTRY(__cexpf) fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */ fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */ subl $8, %esp - cfi_adjust_cfa_offset (8) fstps 4(%esp) fstps (%esp) popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) ret /* We have to reduce the argument to fsincos. */ @@ -134,13 +133,10 @@ ENTRY(__cexpf) fmulp %st, %st(3) fmulp %st, %st(1) subl $8, %esp - cfi_adjust_cfa_offset (8) fstps 4(%esp) fstps (%esp) popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) ret /* The real part is +-inf. We must make further differences. */ @@ -214,14 +210,12 @@ ENTRY(__cexpf) +-Inf+-0i. */ .align ALIGNARG(4) 4: subl $4, %esp - cfi_adjust_cfa_offset (4) fstps (%esp) shrl $6, %edx fstp %st(0) andl $8, %edx movl MOX(huge_nan_null_null,%edx,1), %eax popl %edx - cfi_adjust_cfa_offset (-4) ret /* The real part is +-Inf, the imaginary is also is not finite. */ diff --git a/sysdeps/i386/fpu/s_cexpl.S b/sysdeps/i386/fpu/s_cexpl.S index 8bb0680bce..cbc7c99f0e 100644 --- a/sysdeps/i386/fpu/s_cexpl.S +++ b/sysdeps/i386/fpu/s_cexpl.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of complex exponential function for double. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -71,7 +71,9 @@ ENTRY(__cexpl) fnstsw fldt 20(%esp) /* y : x */ #ifdef PIC - LOAD_PIC_REG (cx) + call 1f +1: popl %ecx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx #endif movb %ah, %dh andb $0x45, %ah diff --git a/sysdeps/i386/fpu/s_expm1.S b/sysdeps/i386/fpu/s_expm1.S index e761183639..35e1ff6693 100644 --- a/sysdeps/i386/fpu/s_expm1.S +++ b/sysdeps/i386/fpu/s_expm1.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of exp(x)-1. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Based on code by John C. Bowman <bowman@ipp-garching.mpg.de>. @@ -56,7 +56,9 @@ ENTRY(__expm1) cmpb $0x40, %ch je 3f // If +-0, jump. #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpb $0x05, %ch je 2f // If +-Inf, jump. diff --git a/sysdeps/i386/fpu/s_expm1f.S b/sysdeps/i386/fpu/s_expm1f.S index 88adb75b86..c2c64f0748 100644 --- a/sysdeps/i386/fpu/s_expm1f.S +++ b/sysdeps/i386/fpu/s_expm1f.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of exp(x)-1. - Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Based on code by John C. Bowman <bowman@ipp-garching.mpg.de>. @@ -56,7 +56,9 @@ ENTRY(__expm1f) cmpb $0x40, %ch je 3f // If +-0, jump. #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpb $0x05, %ch je 2f // If +-Inf, jump. diff --git a/sysdeps/i386/fpu/s_expm1l.S b/sysdeps/i386/fpu/s_expm1l.S index 2dc379b790..4d491c02f8 100644 --- a/sysdeps/i386/fpu/s_expm1l.S +++ b/sysdeps/i386/fpu/s_expm1l.S @@ -1,5 +1,5 @@ /* ix87 specific implementation of exp(x)-1. - Copyright (C) 1996, 1997, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Based on code by John C. Bowman <bowman@ipp-garching.mpg.de>. @@ -56,7 +56,9 @@ ENTRY(__expm1l) cmpb $0x40, %ch je 3f // If +-0, jump. #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif cmpb $0x05, %ch je 2f // If +-Inf, jump. diff --git a/sysdeps/i386/fpu/s_frexp.S b/sysdeps/i386/fpu/s_frexp.S index cfc822106e..563105a917 100644 --- a/sysdeps/i386/fpu/s_frexp.S +++ b/sysdeps/i386/fpu/s_frexp.S @@ -1,5 +1,5 @@ /* ix87 specific frexp implementation for double. - Copyright (C) 1997, 2000, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -63,7 +63,9 @@ ENTRY (BP_SYM (__frexp)) fldl VAL0(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 3f +3: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %edx #endif fmull MO(two54) movl $-54, %ecx diff --git a/sysdeps/i386/fpu/s_frexpf.S b/sysdeps/i386/fpu/s_frexpf.S index 8640bbc223..00c4ab5b8e 100644 --- a/sysdeps/i386/fpu/s_frexpf.S +++ b/sysdeps/i386/fpu/s_frexpf.S @@ -1,5 +1,5 @@ /* ix87 specific frexp implementation for float. - Copyright (C) 1997, 2000, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -60,7 +60,9 @@ ENTRY (BP_SYM (__frexpf)) flds VAL(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 3f +3: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %edx #endif fmuls MO(two25) movl $-25, %ecx diff --git a/sysdeps/i386/fpu/s_frexpl.S b/sysdeps/i386/fpu/s_frexpl.S index 60ae57ee3e..1417507ded 100644 --- a/sysdeps/i386/fpu/s_frexpl.S +++ b/sysdeps/i386/fpu/s_frexpl.S @@ -1,5 +1,5 @@ /* ix87 specific frexp implementation for long double. - Copyright (C) 1997, 2000, 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -65,7 +65,9 @@ ENTRY (BP_SYM (__frexpl)) fldt VAL0(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 3f +3: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-3b], %edx #endif fmull MO(two64) /* It's not necessary to use a 80bit factor */ diff --git a/sysdeps/i386/fpu/s_ilogb.S b/sysdeps/i386/fpu/s_ilogb.S index 0cf1ad7419..68d9c1a680 100644 --- a/sysdeps/i386/fpu/s_ilogb.S +++ b/sysdeps/i386/fpu/s_ilogb.S @@ -21,13 +21,11 @@ ENTRY(__ilogb) fxtract pushl %eax - cfi_adjust_cfa_offset (4) fstp %st fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret diff --git a/sysdeps/i386/fpu/s_ilogbf.S b/sysdeps/i386/fpu/s_ilogbf.S index 99e53edd75..521afe2b60 100644 --- a/sysdeps/i386/fpu/s_ilogbf.S +++ b/sysdeps/i386/fpu/s_ilogbf.S @@ -21,13 +21,11 @@ ENTRY(__ilogbf) fxtract pushl %eax - cfi_adjust_cfa_offset (4) fstp %st fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret diff --git a/sysdeps/i386/fpu/s_ilogbl.S b/sysdeps/i386/fpu/s_ilogbl.S index 1f559b311e..ed547bdc8b 100644 --- a/sysdeps/i386/fpu/s_ilogbl.S +++ b/sysdeps/i386/fpu/s_ilogbl.S @@ -22,13 +22,11 @@ ENTRY(__ilogbl) fxtract pushl %eax - cfi_adjust_cfa_offset (4) fstp %st fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret diff --git a/sysdeps/i386/fpu/s_llrint.S b/sysdeps/i386/fpu/s_llrint.S index 23bbec6024..e8e5ecee09 100644 --- a/sysdeps/i386/fpu/s_llrint.S +++ b/sysdeps/i386/fpu/s_llrint.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,13 +25,10 @@ ENTRY(__llrint) fldl 4(%esp) subl $8, %esp - cfi_adjust_cfa_offset (8) fistpll (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) ret END(__llrint) weak_alias (__llrint, llrint) diff --git a/sysdeps/i386/fpu/s_llrintf.S b/sysdeps/i386/fpu/s_llrintf.S index 3de73f6661..1deabc4f54 100644 --- a/sysdeps/i386/fpu/s_llrintf.S +++ b/sysdeps/i386/fpu/s_llrintf.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,13 +25,10 @@ ENTRY(__llrintf) flds 4(%esp) subl $8, %esp - cfi_adjust_cfa_offset (8) fistpll (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) ret END(__llrintf) weak_alias (__llrintf, llrintf) diff --git a/sysdeps/i386/fpu/s_llrintl.S b/sysdeps/i386/fpu/s_llrintl.S index f6545e9fcd..b34d79a5d8 100644 --- a/sysdeps/i386/fpu/s_llrintl.S +++ b/sysdeps/i386/fpu/s_llrintl.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,13 +25,10 @@ ENTRY(__llrintl) fldt 4(%esp) subl $8, %esp - cfi_adjust_cfa_offset (8) fistpll (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) popl %edx - cfi_adjust_cfa_offset (-4) ret END(__llrintl) weak_alias (__llrintl, llrintl) diff --git a/sysdeps/i386/fpu/s_log1p.S b/sysdeps/i386/fpu/s_log1p.S index ec777fdf93..d3bc3d7251 100644 --- a/sysdeps/i386/fpu/s_log1p.S +++ b/sysdeps/i386/fpu/s_log1p.S @@ -31,7 +31,9 @@ ENTRY(__log1p) fldl 4(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam diff --git a/sysdeps/i386/fpu/s_log1pf.S b/sysdeps/i386/fpu/s_log1pf.S index 6919ac902e..d5283fcfee 100644 --- a/sysdeps/i386/fpu/s_log1pf.S +++ b/sysdeps/i386/fpu/s_log1pf.S @@ -31,7 +31,9 @@ ENTRY(__log1pf) flds 4(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam diff --git a/sysdeps/i386/fpu/s_log1pl.S b/sysdeps/i386/fpu/s_log1pl.S index 4bca67d6b0..26c407b606 100644 --- a/sysdeps/i386/fpu/s_log1pl.S +++ b/sysdeps/i386/fpu/s_log1pl.S @@ -36,7 +36,9 @@ ENTRY(__log1pl) fldt 4(%esp) #ifdef PIC - LOAD_PIC_REG (dx) + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx #endif fxam diff --git a/sysdeps/i386/fpu/s_lrint.S b/sysdeps/i386/fpu/s_lrint.S index 799875b335..a15f54f1da 100644 --- a/sysdeps/i386/fpu/s_lrint.S +++ b/sysdeps/i386/fpu/s_lrint.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,11 +25,9 @@ ENTRY(__lrint) fldl 4(%esp) subl $4, %esp - cfi_adjust_cfa_offset (4) fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret END(__lrint) weak_alias (__lrint, lrint) diff --git a/sysdeps/i386/fpu/s_lrintf.S b/sysdeps/i386/fpu/s_lrintf.S index 2aa1a4e83d..0f15e64de2 100644 --- a/sysdeps/i386/fpu/s_lrintf.S +++ b/sysdeps/i386/fpu/s_lrintf.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,11 +25,9 @@ ENTRY(__lrintf) flds 4(%esp) subl $4, %esp - cfi_adjust_cfa_offset (4) fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret END(__lrintf) weak_alias (__lrintf, lrintf) diff --git a/sysdeps/i386/fpu/s_lrintl.S b/sysdeps/i386/fpu/s_lrintl.S index c0211c11da..90313d612c 100644 --- a/sysdeps/i386/fpu/s_lrintl.S +++ b/sysdeps/i386/fpu/s_lrintl.S @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2005 Free Software Foundation, Inc. + Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -25,11 +25,9 @@ ENTRY(__lrintl) fldt 4(%esp) subl $4, %esp - cfi_adjust_cfa_offset (4) fistpl (%esp) fwait popl %eax - cfi_adjust_cfa_offset (-4) ret END(__lrintl) weak_alias (__lrintl, lrintl) diff --git a/sysdeps/i386/fpu/s_nearbyint.S b/sysdeps/i386/fpu/s_nearbyint.S index 52909139a9..d8bb382d9e 100644 --- a/sysdeps/i386/fpu/s_nearbyint.S +++ b/sysdeps/i386/fpu/s_nearbyint.S @@ -9,9 +9,7 @@ ENTRY(__nearbyint) fldl 4(%esp) pushl %eax - cfi_adjust_cfa_offset (4) pushl %ecx - cfi_adjust_cfa_offset (4) fnstcw (%esp) movl (%esp), %eax orl $0x20, %eax @@ -21,9 +19,7 @@ ENTRY(__nearbyint) fclex fldcw (%esp) popl %ecx - cfi_adjust_cfa_offset (-4) popl %eax - cfi_adjust_cfa_offset (-4) ret END (__nearbyint) weak_alias (__nearbyint, nearbyint) diff --git a/sysdeps/i386/fpu/s_nearbyintf.S b/sysdeps/i386/fpu/s_nearbyintf.S index 6a6b1d6c2b..21858650e2 100644 --- a/sysdeps/i386/fpu/s_nearbyintf.S +++ b/sysdeps/i386/fpu/s_nearbyintf.S @@ -9,9 +9,7 @@ ENTRY(__nearbyintf) flds 4(%esp) pushl %eax - cfi_adjust_cfa_offset (4) pushl %ecx - cfi_adjust_cfa_offset (4) fnstcw (%esp) movl (%esp), %eax orl $0x20, %eax @@ -21,9 +19,7 @@ ENTRY(__nearbyintf) fclex fldcw (%esp) popl %ecx - cfi_adjust_cfa_offset (-4) popl %eax - cfi_adjust_cfa_offset (-4) ret END (__nearbyintf) weak_alias (__nearbyintf, nearbyintf) diff --git a/sysdeps/i386/fpu/s_nearbyintl.S b/sysdeps/i386/fpu/s_nearbyintl.S index 819af63a8d..d74dacb990 100644 --- a/sysdeps/i386/fpu/s_nearbyintl.S +++ b/sysdeps/i386/fpu/s_nearbyintl.S @@ -9,9 +9,7 @@ ENTRY(__nearbyintl) fldt 4(%esp) pushl %eax - cfi_adjust_cfa_offset (4) pushl %ecx - cfi_adjust_cfa_offset (4) fnstcw (%esp) movl (%esp), %eax orl $0x20, %eax @@ -21,9 +19,7 @@ ENTRY(__nearbyintl) fclex fldcw (%esp) popl %ecx - cfi_adjust_cfa_offset (-4) popl %eax - cfi_adjust_cfa_offset (-4) ret END (__nearbyintl) weak_alias (__nearbyintl, nearbyintl) diff --git a/sysdeps/i386/fpu/s_nextafterl.c b/sysdeps/i386/fpu/s_nextafterl.c index aef0a144e5..5b617cb4e7 100644 --- a/sysdeps/i386/fpu/s_nextafterl.c +++ b/sysdeps/i386/fpu/s_nextafterl.c @@ -27,7 +27,7 @@ static char rcsid[] = "$NetBSD: $"; */ #include "math.h" -#include <math_private.h> +#include "math_private.h" #ifdef __STDC__ long double __nextafterl(long double x, long double y) @@ -52,12 +52,9 @@ static char rcsid[] = "$NetBSD: $"; return x+y; if(x==y) return y; /* x=y, return y */ if((ix|hx|lx)==0) { /* x == 0 */ - long double u; SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + y = x*x; + if(y==x) return y; else return x; /* raise underflow flag */ } if(esx>=0) { /* x > 0 */ if(esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))) { @@ -112,9 +109,12 @@ static char rcsid[] = "$NetBSD: $"; } esy = esx&0x7fff; if(esy==0x7fff) return x+x; /* overflow */ - if(esy==0) { - long double u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ + if(esy==0) { /* underflow */ + y = x*x; + if(y!=x) { /* raise underflow flag */ + SET_LDOUBLE_WORDS(y,esx,hx,lx); + return y; + } } SET_LDOUBLE_WORDS(x,esx,hx,lx); return x; diff --git a/sysdeps/i386/fpu/s_nexttoward.c b/sysdeps/i386/fpu/s_nexttoward.c index 9bd86a3724..2bd768e448 100644 --- a/sysdeps/i386/fpu/s_nexttoward.c +++ b/sysdeps/i386/fpu/s_nexttoward.c @@ -27,8 +27,7 @@ static char rcsid[] = "$NetBSD: $"; */ #include "math.h" -#include <math_private.h> -#include <float.h> +#include "math_private.h" #ifdef __STDC__ double __nexttoward(double x, long double y) @@ -53,12 +52,10 @@ static char rcsid[] = "$NetBSD: $"; return x+y; if((long double) x==y) return y; /* x=y, return y */ if((ix|lx)==0) { /* x == 0 */ - double u; + double x2; INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00 @@ -88,14 +85,16 @@ static char rcsid[] = "$NetBSD: $"; hy = hx&0x7ff00000; if(hy>=0x7ff00000) { x = x+x; /* overflow */ - if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1) - /* Force conversion to double. */ - asm ("" : "+m"(x)); + /* Force conversion to double. */ + asm ("" : "=m"(x) : "m"(x)); return x; } - if(hy<0x00100000) { - double u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ + if(hy<0x00100000) { /* underflow */ + double x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + INSERT_WORDS(x2,hx,lx); + return x2; + } } INSERT_WORDS(x,hx,lx); return x; diff --git a/sysdeps/i386/fpu/s_nexttowardf.c b/sysdeps/i386/fpu/s_nexttowardf.c index 25f70e4f4d..3fbe53c338 100644 --- a/sysdeps/i386/fpu/s_nexttowardf.c +++ b/sysdeps/i386/fpu/s_nexttowardf.c @@ -19,8 +19,7 @@ static char rcsid[] = "$NetBSD: $"; #endif #include "math.h" -#include <math_private.h> -#include <float.h> +#include "math_private.h" #ifdef __STDC__ float __nexttowardf(float x, long double y) @@ -45,12 +44,10 @@ static char rcsid[] = "$NetBSD: $"; return x+y; if((long double) x==y) return y; /* x=y, return y */ if(ix==0) { /* x == 0 */ - float u; + float x2; SET_FLOAT_WORD(x,((esy&0x8000)<<16)|1);/* return +-minsub*/ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80 @@ -72,14 +69,16 @@ static char rcsid[] = "$NetBSD: $"; hy = hx&0x7f800000; if(hy>=0x7f800000) { x = x+x; /* overflow */ - if (FLT_EVAL_METHOD != 0) - /* Force conversion to float. */ - asm ("" : "+m"(x)); + /* Force conversion to float. */ + asm ("" : "=m"(x) : "m"(x)); return x; } - if(hy<0x00800000) { - float u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ + if(hy<0x00800000) { /* underflow */ + float x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + SET_FLOAT_WORD(x2,hx); + return x2; + } } SET_FLOAT_WORD(x,hx); return x; |