diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-07-14 21:49:20 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-07-14 21:49:20 +0000 |
commit | cd6ede759fadcf8cd1f8c069928611d18cef5c1a (patch) | |
tree | 9d4bbf1daaf37c365dfa5234d1caf2b6b9547708 /sysdeps/i386 | |
parent | f21acc89c06c14160eab88246e9dbe0b17eb5f89 (diff) | |
download | glibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.tar.gz glibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.tar.xz glibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.zip |
Update. cvs/libc-ud-970714
1997-07-14 23:37 Ulrich Drepper <drepper@cygnus.com> * inet/getnameinfo.c: Pretty print. Correctly enlarge buffers. * login/programs/utmpd.c: Use _() instead of gettext(). * nis/nss_nisplus/nisplus-hosts.c: Optimize some uses of stpcpy away. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h: Only define functions if __OPTIMIZE__. * sysdeps/powerpc/bits/mathinline.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Define ISO C9x comparison function always. * sysdeps/m68k/fpu/bits/mathinline.h: Likewise. * sysdeps/stub/bits/mathinline.h: Add conditionals to show how it should look like in real files. * sysdeps/generic/bits/select.h (__FD_ZERO): Don't use memset to prevent prototype trouble, use simple loop. * sysdeps/i386/bits/select.h [!__GNUC__] (__FD_ZERO): Likewise. * sysdeps/mips/mips64/Implies: Imply ieee754. * sysdeps/unix/sysv/linux/Makefile: Make sure bits/syscall.h is installed. * sysdeps/unix/sysv/linux/sys/syscal.h: Pretty print. 1997-07-14 00:25 Ulrich Drepper <drepper@cygnus.com> * sysdeps/stub/bits/stdio_lim.h: Unify with standalone version. * sysdeps/standalone/bits/stdio_lim.h: Removed. Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1997-06-22 Paul Eggert <eggert@twinsun.com> * time/strftime.c (strftime): Use tm_zone if available, even if _LIBC. * time/tzfile.c (__tzstring): New decl. (__tzfile_read, __tzfile_default): Set __tzname to permanent strings. (__tzfile_default): First two args are now const char *. * time/tzset.c (__tzstring): New function. (tz_rule): Name is now const char *. (struct tzstring_head): New type. (tzstring_list, tzstring_last_buffer_size): New static vars. (__tzset_internal): Time zone names are now permanent, not temporary.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r-- | sysdeps/i386/bits/select.h | 8 | ||||
-rw-r--r-- | sysdeps/i386/fpu/bits/mathinline.h | 112 |
2 files changed, 64 insertions, 56 deletions
diff --git a/sysdeps/i386/bits/select.h b/sysdeps/i386/bits/select.h index 3912515a7f..e72b6f0a84 100644 --- a/sysdeps/i386/bits/select.h +++ b/sysdeps/i386/bits/select.h @@ -48,8 +48,14 @@ #else /* ! GNU CC */ +/* We don't use `memset' because this would require a prototype and + the array isn't too big. */ #define __FD_ZERO(set) \ - ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) + do { \ + unsigned int __i; \ + for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ + ((__fd_mask *) set)[__i] = '\0'; \ + } while (0) #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h index dab5494ac5..42dae92a2a 100644 --- a/sysdeps/i386/fpu/bits/mathinline.h +++ b/sysdeps/i386/fpu/bits/mathinline.h @@ -21,7 +21,56 @@ #ifndef _BITS_MATHINLINE_H #define _BITS_MATHINLINE_H 1 -#if defined __GNUG__ && \ + +#if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2 +/* ISO C 9X defines some macros to perform unordered comparisons. The + ix87 FPU supports this with special opcodes and we should use them. + These must not be inline functions since we have to be able to handle + all floating-point types. */ +# define isgreater(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; andb $0x45, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +# define isgreaterequal(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +# define isless(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \ + "setz %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +# define islessequal(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \ + "setz %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +# define islessgreater(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \ + "andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) + +# define isunordered(x, y) \ + ({ int result; \ + __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0xff, %0" \ + : "=a" (result) : "t" (x), "u" (y) : "cc"); \ + result; }) +#endif + + +#if defined __GNUC__ && \ (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7)) /* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double' functions so we disable this now. */ @@ -29,8 +78,9 @@ # define __NO_MATH_INLINES #endif + #ifdef __GNUC__ -#ifndef __NO_MATH_INLINES +#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ #ifdef __cplusplus # define __MATH_INLINE __inline @@ -258,10 +308,8 @@ __log2 (double __x) { register double __value; __asm __volatile__ - ("fld1\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (__value) : "0" (__x)); + ("fyl2x" + : "=t" (__value) : "0" (__x), "u" (1.0)); return __value; } @@ -441,7 +489,10 @@ logb (double __x) return __value; } +#endif + +#ifdef __USE_MISC __MATH_INLINE double drem (double __x, double __y); __MATH_INLINE double drem (double __x, double __y) @@ -471,55 +522,6 @@ __finite (double __x) return __result; } - -/* ISO C 9X defines some macros to perform unordered comparisons. The - ix87 FPU supports this with special opcodes and we should use them. - These must not be inline functions since we have to be able to handle - all floating-point types. */ -# define isgreater(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; andb $0x45, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -# define isgreaterequal(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -# define isless(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \ - "setz %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -# define islessequal(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \ - "setz %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -# define islessgreater(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \ - "andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) - -# define isunordered(x, y) \ - ({ int result; \ - __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0xff, %0" \ - : "=a" (result) : "t" (x), "u" (y) : "cc"); \ - result; }) -#endif - - -#ifdef __USE_MISC __MATH_INLINE double coshm1 (double __x); __MATH_INLINE double coshm1 (double __x) |