2006-11-10  Ulrich Drepper  <drepper@redhat.com>
	[BZ #3451]
	* sysdeps/i386/fpu/bits/mathinline.h (floor): Make rounding mode
	change atomic.
	(ceil): Likewise.
This commit is contained in:
Ulrich Drepper 2006-11-10 17:04:58 +00:00
parent 52a33795d3
commit 5c2af13445
2 changed files with 34 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2006-11-10 Ulrich Drepper <drepper@redhat.com>
[BZ #3451]
* sysdeps/i386/fpu/bits/mathinline.h (floor): Make rounding mode
change atomic.
(ceil): Likewise.
2006-11-10 Jakub Jelinek <jakub@redhat.com> 2006-11-10 Jakub Jelinek <jakub@redhat.com>
* string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization * string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization

View File

@ -1,5 +1,5 @@
/* Inline math functions for i387. /* 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. Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995. Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
@ -529,24 +529,36 @@ __inline_mathcodeNP (tanh, __x, \
__inline_mathcodeNP (floor, __x, \ __inline_mathcodeNP (floor, __x, \
register long double __value; \ register long double __value; \
__volatile unsigned short int __cw; \ register int __ignore; \
__volatile unsigned short int __cwtmp; \ unsigned short int __cw; \
__asm __volatile ("fnstcw %0" : "=m" (__cw)); \ unsigned short int __cwtmp; \
__cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ \ __asm __volatile ("fnstcw %4\n\t" \
__asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ "movzwl %4, %1\n\t" \
__asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ "andl $0xf3ff, %1\n\t" \
__asm __volatile ("fldcw %0" : : "m" (__cw)); \ "orl $0x0400, %1\n\t" /* rounding down */ \
"movw %1, %3\n\t" \
"fldcw %3\n\t" \
"frndint\n\t" \
"fldcw %4" \
: "=t" (__value), "=&q" (__ignore) \
: "0" (__x), "m" (__cwtmp), "m" (__cw)); \
return __value) return __value)
__inline_mathcodeNP (ceil, __x, \ __inline_mathcodeNP (ceil, __x, \
register long double __value; \ register long double __value; \
__volatile unsigned short int __cw; \ register int __ignore; \
__volatile unsigned short int __cwtmp; \ unsigned short int __cw; \
__asm __volatile ("fnstcw %0" : "=m" (__cw)); \ unsigned short int __cwtmp; \
__cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ \ __asm __volatile ("fnstcw %4\n\t" \
__asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ "movzwl %4, %1\n\t" \
__asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ "andl $0xf3ff, %1\n\t" \
__asm __volatile ("fldcw %0" : : "m" (__cw)); \ "orl $0x0800, %1\n\t" /* rounding up */ \
"movw %1, %3\n\t" \
"fldcw %3\n\t" \
"frndint\n\t" \
"fldcw %4" \
: "=t" (__value), "=&q" (__ignore) \
: "0" (__x), "m" (__cwtmp), "m" (__cw)); \
return __value) return __value)
#ifdef __FAST_MATH__ #ifdef __FAST_MATH__