about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/bits
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/i386/fpu/bits
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.xz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip
2.5-18.1
Diffstat (limited to 'sysdeps/i386/fpu/bits')
-rw-r--r--sysdeps/i386/fpu/bits/mathdef.h46
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h44
2 files changed, 29 insertions, 61 deletions
diff --git a/sysdeps/i386/fpu/bits/mathdef.h b/sysdeps/i386/fpu/bits/mathdef.h
deleted file mode 100644
index ec42ed5df9..0000000000
--- a/sysdeps/i386/fpu/bits/mathdef.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* 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 e04ce95099..28547d44b8 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
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
@@ -529,24 +529,38 @@ __inline_mathcodeNP (tanh, __x, \
 
 __inline_mathcodeNP (floor, __x, \
   register long double __value;						      \
-  __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));				      \
+  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));					      \
   return __value)
 
 __inline_mathcodeNP (ceil, __x, \
   register long double __value;						      \
-  __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));				      \
+  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));					      \
   return __value)
 
 #ifdef __FAST_MATH__