aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-24 10:55:18 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-24 10:55:18 +0000
commitf41c80910d631bacdaf39ec6d11272db79c59d38 (patch)
tree26b93c7b36e05eb08892aa730788c8f772efe2e3 /sysdeps/i386
parent40a55d2054ef9d9085c4e6b0157c5d30608736fc (diff)
downloadglibc-f41c80910d631bacdaf39ec6d11272db79c59d38.zip
glibc-f41c80910d631bacdaf39ec6d11272db79c59d38.tar.gz
glibc-f41c80910d631bacdaf39ec6d11272db79c59d38.tar.bz2
Update.
1997-08-24 12:24 Ulrich Drepper <drepper@cygnus.com> * configure.in (INSTALL): Quote `$'. * libc.map: Add __xpg_basename. * csu/Makefile (initfini.s): Disable optimization. * elf/dl-deps.c: Implement handling of DL_FILTER. * elf/dl-load.c (_dl_init_paths): Add error check. * intl/finddomain.c (_nl_find_domain): Correct comment. * intl/localealias.c: Include <bits/libc-lock.h> not <libc-lock.h>. * libio/stdio.h: Make {,v}snprintf available if __USE_BSD. Change extern inline functions to work correctly in C++. * locale/iso-4217.def: Update for more recent ISO 4217 version. * locale/loadlocale.c (_nl_load_locale): Add cast. * manual/message.texi: Finish gettext section. * posix/getopt_init.c: Don't use relative #include path. (__getopt_clean_environment): Change function to take pointer to environment as argument. Optimize generation of test string a bit. * sysdeps/unix/sysv/linux/init-first.c: Call __getopt_clean_environment with additional argument. * poisx/glob.c: Add prototype for next_brace_sub. * sysdeps/generic/dl-sysdep.c: Recognize AT_BASE value on auxiliary vector. * sysdeps/i386/dl-machine.h (elf_machine_load_address): Rewrite to not generate relocation entry. Suggested by Richard Henderson. (ELF_MACHINE_BEFORE_RTLD_RELOC): Removed. (elf_machine_runtime_setup): Add .aligns. * sysdeps/i386/fpu/fraiseexcpt.c: Add volatile to asms. * sysdeps/i386/fpu/bits/mathinline.h: Partially undo change of 1997-08-14 03:14. gcc 2.7.2* is really broken in some aspects. * sysdeps/standalone/i386/i386.h: Clean up asm statements a bit. * sysdeps/standalone/i960/i960ca.h: Likewise. 1997-08-22 19:04 Richard Henderson <rth@cygnus.com> * elf/rtld.c (_dl_start): Init _dl_rtld_map.l_opencount due to undocumented test addition in _dl_map_object. Support ET_EXEC versions of ld.so, for debugging at least: * elf/dl-load.c (_dl_map_object): Add_name_to_object could get called despite the DT_SONAME != NULL test, segfaulting. Simplify the code here as well. * elf/dl-lookup.c (do_lookup): Skip objects with no symtab. (_dl_setup_hash): Likewise for hash tables. * elf/dl-version.c (_dl_check_map_versions): Likewise for strtabs. * elf/rtld.c (_dl_start): Likewise for rpath. (_dl_rtld_libname2): New variable. (dl_main): Use it to add an soname for ourselves when we don't have one of our own. Base it on the target's .interp. (dl_main): Again, skip printing of objects that don't have strtabs. Sparc 32 merge: * elf/dl-runtime.c (ELF_FIXUP_RETURN_VALUE): Provide default value. (fixup): Simplify code. Use ELF_FIXUP_RETURN_VALUE. (profile_fixup): Likewise, though this still needs fixing for Sparc32 and PPC. * sysdeps/powerpc/dl-machine.h: Transmute ELF_FIXUP_RETURNS_ADDRESS to ELF_FIXUP_RETURN_VALUE. * sysdeps/sparc/sparc32/dl-machine.h: Implement lazy relocation. Fix up _dl_start_user to handle _dl_skip_args properly. Use _dl_hwcap to determine if "flush" is available/needed. * sysdeps/sparc/configure.in: Remove. It doesn't actually do anything anymore, and what it did do is done somewhere else. * sysdeps/sparc/configure: Likewise. * sysdeps/sparc/fpu/bits/mathdef.h (FP_ILOGB0, FP_ILOGBNAN): New. * sysdeps/sparc/fpu/fraiseexcpt.c: Rearrange for smaller code. * sysdeps/sparc/sparc32/Makefile: Fix sparc->sparc/sparc32 bits in divrem expansions. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (END, LOC): New definitions for assembly syntax differences. * sysdeps/sparc/sparc32/__longjmp.S: %g6,%g7 are reserved to the "system". Use %g2,%g3 instead. Use new local label macro. * sysdeps/sparc/sparc32/add_n.S: Use <sysdep.h> and ENTRY, END, and LOC for proper assembly headers/footers. * sysdeps/sparc/sparc32/addmul_1.S: Likewise. * sysdeps/sparc/sparc32/alloca.S: Likewise. * sysdeps/sparc/sparc32/dotmul.S: Likewise. * sysdeps/sparc/sparc32/lshift.S: Likewise. * sysdeps/sparc/sparc32/mul_1.S: Likewise. * sysdeps/sparc/sparc32/rshift.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/addmul_1.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/mul_1.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/submul_1.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S: Likewise. * sysdeps/sparc/sparc32/sub_n.S: Likewise. * sysdeps/sparc/sparc32/submul_1.S: Likewise. * sysdeps/sparc/sparc32/udiv_qrnnd.S: Likewise. * sysdeps/sparc/sparc32/umul.S: Likewise. * sysdeps/sparc/sparc32/divrem.m4: Likewise. * sysdeps/sparc/sparc32/rem.S: Regenerate. * sysdeps/sparc/sparc32/sdiv.S: Regenerate. * sysdeps/sparc/sparc32/udiv.S: Regenerate. * sysdeps/sparc/sparc32/urem.S: Regenerate. * sysdeps/sparc/sparc32/sparcv8/dotmul.S: New file. * sysdeps/sparc/sparc32/sparcv8/rem.S: New file. * sysdeps/sparc/sparc32/sparcv8/sdiv.S: New file. * sysdeps/sparc/sparc32/sparcv8/udiv.S: New file. * sysdeps/sparc/sparc32/sparcv8/umul.S: New file. * sysdeps/sparc/sparc32/sparcv8/urem.S: New file. * sysdeps/sparc/sparc32/bsd-_setjmp.S: Dike out. * sysdeps/sparc/sparc32/bsd-setjmp.S: Likewise. * sysdeps/sparc/sparc32/setjmp.S: Add _setjmp and setjmp entry points. * sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S: Clean up PIC code. * sysdeps/sparc/sparc32/elf/start.S: New file, slightly modified from the sparc64 version. * sysdeps/sparc/sparc32/elf/start.c: Removed. * sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h: Rewrite in assembly based on the sparc64 version. * sysdeps/sparc/sparc32/fpu/bits/fenv.h: Duh. Use proper syntax for manipulating %fsr. * sysdeps/sparc/sparc32/fpu/fpu_control.h: Make IEEE conformance be the default. * elf/elf.h (HWCAP_SPARC_*): New definitions. * elf/rtld.c (_dl_hwcap): New variable. * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Record AT_HWCAP. * sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c: New file. Attempt to get hold of the page size based on what we might have been told at startup time in _dl_pagesize. This will be obsolete when I finish the kernel hooks for a proper sysconf(), stay tuned. Sparc 64 merge: * sysdeps/sparc/sparc64/dl-machine.h (ELF_FIXUP_RETURN_VALUE): New. Figure out the right thing to return based on the .plt format. * sysdeps/sparc/sparc64/fpu/fpu_control.h: Update comment. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h (__dev_t): Should have been 64-bits wide. * sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: sll->sllx, optimize for branch delay slot usage. 1997-08-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * csu/Makefile ($(objpfx)crt%.o): Fix a missing *.so -> *.os change. 1997-08-20 Andreas Jaeger <aj@arthur.rhein-neckar.de> * math/libm-test.c (identities): Change epsilon. * sysdeps/i386/fpu/bits/mathinline.h: Correct arguments to fabs, fabsf, fabsl, __fabsl. * sysdeps/libm-i387/e_remainderl.S: Pop extra value from FPU stack. * sysdeps/libm-ieee754/s_csinhl.c: Include <fenv.h>.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/dl-machine.h17
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h157
-rw-r--r--sysdeps/i386/fpu/fraiseexcpt.c23
3 files changed, 103 insertions, 94 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index e517cff..213060b 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -57,20 +57,12 @@ static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
Elf32_Addr addr;
- asm (" call .Lhere\n"
- ".Lhere: popl %0\n"
- " subl $.Lhere, %0"
+ asm (" call 1f\n"
+ "1: popl %0\n"
+ " subl 1b@GOT(%%ebx), %0"
: "=r" (addr));
return addr;
}
-/* The `subl' insn above will contain an R_386_32 relocation entry
- intended to insert the run-time address of the label `.Lhere'.
- This will be the first relocation in the text of the dynamic linker;
- we skip it to avoid trying to modify read-only text in this early stage. */
-#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
- ++(const Elf32_Rel *) (dynamic_info)[DT_REL]->d_un.d_ptr; \
- (dynamic_info)[DT_RELSZ]->d_un.d_val -= sizeof (Elf32_Rel);
-
#ifndef PROF
/* We add a declaration of this function here so that in dl-runtime.c
@@ -132,6 +124,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function
+ .align 16
_dl_runtime_resolve:
pushl %eax # Preserve registers otherwise clobbered.
pushl %ecx
@@ -147,6 +140,7 @@ _dl_runtime_resolve:
.globl _dl_runtime_profile
.type _dl_runtime_profile, @function
+ .align 16
_dl_runtime_profile:
pushl %eax # Preserve registers otherwise clobbered.
pushl %ecx
@@ -167,6 +161,7 @@ _dl_runtime_profile:
.globl _dl_runtime_profile
.type _dl_runtime_resolve, @function
.type _dl_runtime_profile, @function
+ .align 16
_dl_runtime_resolve:
_dl_runtime_profile:
pushl %eax # Preserve registers otherwise clobbered.
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index c6b9331..17f62a0 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -73,6 +73,10 @@
#ifdef __GNUC__
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* The gcc, version 2.7 or below, has problems with all this inlining
+ code. So disable it for this version of the compiler. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)
+
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
@@ -154,6 +158,80 @@
}
+/* Miscellaneous functions */
+
+__inline_mathcode (__sgn, __x, \
+ return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
+
+__inline_mathcode (__pow2, __x, \
+ register long double __value; \
+ register long double __exponent; \
+ long int __p = (long int) __x; \
+ if (__x == (long double) __p) \
+ { \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (1.0), "u" (__x)); \
+ return __value; \
+ } \
+ __asm __volatile__ \
+ ("fldl %%st(0)\n\t" \
+ "frndint # int(x)\n\t" \
+ "fxch\n\t" \
+ "fsub %%st(1) # fract(x)\n\t" \
+ "f2xm1 # 2^(fract(x)) - 1\n\t" \
+ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
+ __value += 1.0; \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (__value), "u" (__exponent)); \
+ return __value)
+
+#define __sincos_code \
+ register long double __cosr; \
+ register long double __sinr; \
+ __asm __volatile__ \
+ ("fsincos\n\t" \
+ "fnstsw %%ax\n\t" \
+ "testl $0x400, %%eax\n\t" \
+ "jz 1f\n\t" \
+ "fldpi\n\t" \
+ "fadd %%st(0)\n\t" \
+ "fxch %%st(1)\n\t" \
+ "2: fprem1\n\t" \
+ "fnstsw %%ax\n\t" \
+ "testl $0x400, %%eax\n\t" \
+ "jnz 2b\n\t" \
+ "fstp %%st(1)\n\t" \
+ "fsincos\n\t" \
+ "1:" \
+ : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); \
+ *__sinx = __sinr; \
+ *__cosx = __cosr
+
+__MATH_INLINE void __sincos (double __x, double *__sinx, double *__cosx);
+__MATH_INLINE void
+__sincos (double __x, double *__sinx, double *__cosx)
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void __sincosf (float __x, float *__sinx, float *__cosx);
+__MATH_INLINE void
+__sincosf (float __x, float *__sinx, float *__cosx)
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void __sincosl (long double __x, long double *__sinx,
+ long double *__cosx);
+__MATH_INLINE void
+__sincosl (long double __x, long double *__sinx, long double *__cosx)
+{
+ __sincos_code;
+}
+
+
/* Optimized inline implementation, sometimes with reduced precision
and/or argument range. */
@@ -278,10 +356,10 @@ __inline_mathop (sqrt, "fsqrt")
__inline_mathop_ (long double, __sqrtl, "fsqrt")
#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-__inline_mathcode_ (fabs, __x, return __builtin_fabs (__x))
-__inline_mathcode_ (fabsf, __x, return __builtin_fabsf (__x))
-__inline_mathcode_ (fabsl, __x, return __builtin_fabsl (__x))
-__inline_mathcode_ (__fabsl, __x, return __builtin_fabsl (__x))
+__inline_mathcode_ (double, fabs, __x, return __builtin_fabs (__x))
+__inline_mathcode_ (float, fabsf, __x, return __builtin_fabsf (__x))
+__inline_mathcode_ (long double, fabsl, __x, return __builtin_fabsl (__x))
+__inline_mathcode_ (long double, __fabsl, __x, return __builtin_fabsl (__x))
#else
__inline_mathop (fabs, "fabs")
__inline_mathop_ (long double, __fabsl, "fabs")
@@ -356,7 +434,7 @@ ldexp (double __x, int __y)
/* Optimized versions for some non-standardized functions. */
#if defined __USE_ISOC9X || defined __USE_MISC
-__inline_mathop_decl (log2, "fyl2x", "u" (1.0), "0" (__x) : "st(1)")
+__inline_mathop(log2, "fld1; fxch; fyl2x")
__inline_mathcode (expm1, __x, __expm1_code)
@@ -443,15 +521,12 @@ __finite (double __x)
("orl $0x800fffff, %0\n\t"
"incl %0\n\t"
"shrl $31, %0"
- : "=q" (__result) : "0" (((int *) &__x)[1]));
+ : "=q" (__result) : "0" (((int *) &__x)[1]) : "cc");
return __result;
}
/* Miscellaneous functions */
-__inline_mathcode (__sgn, __x, \
- return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
-
__inline_mathcode (__coshm1, __x, \
register long double __exm1 = __expm1l (__fabsl (__x)); \
return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1)
@@ -459,69 +534,6 @@ __inline_mathcode (__coshm1, __x, \
__inline_mathcode (__acosh1p, __x, \
return log1pl (__x + __sqrtl (__x) * __sqrtl (__x + 2.0)))
-__inline_mathcode (__pow2, __x, \
- register long double __value; \
- register long double __exponent; \
- long int __p = (long int) __x; \
- if (__x == (long double) __p) \
- return ldexpl (1.0, __p); \
- __asm __volatile__ \
- ("fldl %%st(0)\n\t" \
- "frndint # int(x)\n\t" \
- "fxch\n\t" \
- "fsub %%st(1) # fract(x)\n\t" \
- "f2xm1 # 2^(fract(x)) - 1\n\t" \
- : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
- __value += 1.0; \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (__value), "u" (__exponent)); \
- return __value)
-
-#define __sincos_code \
- register long double __cosr; \
- register long double __sinr; \
- __asm __volatile__ \
- ("fsincos\n\t" \
- "fnstsw %%ax\n\t" \
- "testl $0x400, %%eax\n\t" \
- "jz 1f\n\t" \
- "fldpi\n\t" \
- "fadd %%st(0)\n\t" \
- "fxch %%st(1)\n\t" \
- "2: fprem1\n\t" \
- "fnstsw %%ax\n\t" \
- "testl $0x400, %%eax\n\t" \
- "jnz 2b\n\t" \
- "fstp %%st(1)\n\t" \
- "fsincos\n\t" \
- "1:" \
- : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); \
- *__sinx = __sinr; \
- *__cosx = __cosr
-
-__MATH_INLINE void __sincos (double __x, double *__sinx, double *__cosx);
-__MATH_INLINE void
-__sincos (double __x, double *__sinx, double *__cosx)
-{
- __sincos_code;
-}
-
-__MATH_INLINE void __sincosf (float __x, float *__sinx, float *__cosx);
-__MATH_INLINE void
-__sincosf (float __x, float *__sinx, float *__cosx)
-{
- __sincos_code;
-}
-
-__MATH_INLINE void __sincosl (long double __x, long double *__sinx,
- long double *__cosx);
-__MATH_INLINE void
-__sincosl (long double __x, long double *__sinx, long double *__cosx)
-{
- __sincos_code;
-}
-
#endif /* __USE_MISC */
/* Undefine some of the large macros which are not used anymore. */
@@ -530,6 +542,7 @@ __sincosl (long double __x, long double *__sinx, long double *__cosx)
#undef __atan2_code
#undef __sincos_code
+#endif /* Not gcc <= 2.7. */
#endif /* __NO_MATH_INLINES */
#endif /* __GNUC__ */
diff --git a/sysdeps/i386/fpu/fraiseexcpt.c b/sysdeps/i386/fpu/fraiseexcpt.c
index 0af8c71..d468449 100644
--- a/sysdeps/i386/fpu/fraiseexcpt.c
+++ b/sysdeps/i386/fpu/fraiseexcpt.c
@@ -34,7 +34,7 @@ feraiseexcept (int excepts)
{
/* One example of a invalid operation is 0.0 / 0.0. */
double d;
- __asm__ ("fldz; fdiv %%st, %%st(0); fwait" : "=t" (d));
+ __asm__ __volatile__ ("fldz; fdiv %%st, %%st(0); fwait" : "=t" (d));
(void) &d;
}
@@ -42,7 +42,8 @@ feraiseexcept (int excepts)
if ((FE_DIVBYZERO & excepts) != 0)
{
double d;
- __asm__ ("fldz; fld1; fdivp %%st, %%st(1); fwait" : "=t" (d));
+ __asm__ __volatile__ ("fldz; fld1; fdivp %%st, %%st(1); fwait"
+ : "=t" (d));
(void) &d;
}
@@ -55,16 +56,16 @@ feraiseexcept (int excepts)
/* Bah, we have to clear selected exceptions. Since there is no
`fldsw' instruction we have to do it the hard way. */
- __asm__ ("fnstenv %0" : "=m" (*&temp));
+ __asm__ __volatile__ ("fnstenv %0" : "=m" (*&temp));
/* Set the relevant bits. */
temp.status_word |= FE_OVERFLOW;
/* Put the new data in effect. */
- __asm__ ("fldenv %0" : : "m" (*&temp));
+ __asm__ __volatile__ ("fldenv %0" : : "m" (*&temp));
/* And raise the exception. */
- __asm__ ("fwait");
+ __asm__ __volatile__ ("fwait");
}
/* Next: underflow. */
@@ -76,16 +77,16 @@ feraiseexcept (int excepts)
/* Bah, we have to clear selected exceptions. Since there is no
`fldsw' instruction we have to do it the hard way. */
- __asm__ ("fnstenv %0" : "=m" (*&temp));
+ __asm__ __volatile__ ("fnstenv %0" : "=m" (*&temp));
/* Set the relevant bits. */
temp.status_word |= FE_UNDERFLOW;
/* Put the new data in effect. */
- __asm__ ("fldenv %0" : : "m" (*&temp));
+ __asm__ __volatile__ ("fldenv %0" : : "m" (*&temp));
/* And raise the exception. */
- __asm__ ("fwait");
+ __asm__ __volatile__ ("fwait");
}
/* Last: inexact. */
@@ -97,15 +98,15 @@ feraiseexcept (int excepts)
/* Bah, we have to clear selected exceptions. Since there is no
`fldsw' instruction we have to do it the hard way. */
- __asm__ ("fnstenv %0" : "=m" (*&temp));
+ __asm__ __volatile__ ("fnstenv %0" : "=m" (*&temp));
/* Set the relevant bits. */
temp.status_word |= FE_INEXACT;
/* Put the new data in effect. */
- __asm__ ("fldenv %0" : : "m" (*&temp));
+ __asm__ __volatile__ ("fldenv %0" : : "m" (*&temp));
/* And raise the exception. */
- __asm__ ("fwait");
+ __asm__ __volatile__ ("fwait");
}
}