This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, hjl/pr14117, created. glibc-2.15-1150-g108137e
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 4 Jun 2012 12:56:54 -0000
- Subject: GNU C Library master sources branch, hjl/pr14117, created. glibc-2.15-1150-g108137e
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/pr14117 has been created
at 108137e8327ac4e2eb2441aecb90dbd61ff552ef (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=108137e8327ac4e2eb2441aecb90dbd61ff552ef
commit 108137e8327ac4e2eb2441aecb90dbd61ff552ef
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:32:50 2012 -0700
Use x86_64 fpu/bits/mathinline.h for i386 and x86-64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index b03183b..2b3f3e0 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,10 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/i386/fpu/bits/mathinline.h: Removed.
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Renamed to ...
+ * sysdeps/x86/fpu/bits/mathinline.h: This.
+
* sysdeps/i386/fpu/bits/fenv.h: Removed.
* sysdeps/i386/fpu/Implies: New file.
* sysdeps/x86_64/fpu/Implies: Likewise.
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
deleted file mode 100644
index 2a7e96b..0000000
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ /dev/null
@@ -1,733 +0,0 @@
-/* Inline math functions for i387.
- Copyright (C) 1995-2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif
-
-
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
-/* GCC 2.97 and up have builtins that actually can be used. */
-# if !__GNUC_PREREQ (2,97)
-/* ISO C99 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. */
-# undef isgreater
-# undef isgreaterequal
-# undef isless
-# undef islessequal
-# undef islessgreater
-# undef isunordered
-# ifdef __i686__
-/* For the PentiumPro and more recent processors we can provide
- better code. */
-# define isgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; seta %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-# define isgreaterequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setae %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-
-# define isless(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; seta %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
- __result; })
-
-# define islessequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setae %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
- __result; })
-
-# define islessgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setne %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-
-# define isunordered(x, y) \
- ({ register char __result; \
- __asm__ ("fucomip %%st(1), %%st; setp %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
- __result; })
-# else
-/* This is the dumb, portable code for i386 and above. */
-# define isgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isgreaterequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isless(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
- __result; })
-
-# define islessequal(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
- : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
- __result; })
-
-# define islessgreater(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-
-# define isunordered(x, y) \
- ({ register char __result; \
- __asm__ ("fucompp; fnstsw; sahf; setp %%al" \
- : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
- __result; })
-# endif /* __i686__ */
-# endif /* GCC 2.97 */
-
-/* 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_PREREQ (2, 8)
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[1] < 0;
-}
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
- __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
- return (__u.__i[2] & 0x8000) != 0;
-}
-# endif
-#endif
-
-
-/* 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_PREREQ (2, 8)
-
-#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
- && defined __OPTIMIZE__)
-
-/* The inline functions do not set errno or raise necessarily the
- correct exceptions. */
-# undef math_errhandling
-
-/* A macro to define float, double, and long double versions of various
- math functions for the ix87 FPU. FUNC is the function name (which will
- be suffixed with f and l for the float and long double version,
- respectively). OP is the name of the FPU operation.
- We define two sets of macros. The set with the additional NP
- doesn't add a prototype declaration. */
-
-#if defined __USE_MISC || defined __USE_ISOC99
-# define __inline_mathop(func, op) \
- __inline_mathop_ (double, func, op) \
- __inline_mathop_ (float, __CONCAT(func,f), op) \
- __inline_mathop_ (long double, __CONCAT(func,l), op)
-# define __inline_mathopNP(func, op) \
- __inline_mathopNP_ (double, func, op) \
- __inline_mathopNP_ (float, __CONCAT(func,f), op) \
- __inline_mathopNP_ (long double, __CONCAT(func,l), op)
-#else
-# define __inline_mathop(func, op) \
- __inline_mathop_ (double, func, op)
-# define __inline_mathopNP(func, op) \
- __inline_mathopNP_ (double, func, op)
-#endif
-
-#define __inline_mathop_(float_type, func, op) \
- __inline_mathop_decl_ (float_type, func, op, "0" (__x))
-#define __inline_mathopNP_(float_type, func, op) \
- __inline_mathop_declNP_ (float_type, func, op, "0" (__x))
-
-
-#if defined __USE_MISC || defined __USE_ISOC99
-# define __inline_mathop_decl(func, op, params...) \
- __inline_mathop_decl_ (double, func, op, params) \
- __inline_mathop_decl_ (float, __CONCAT(func,f), op, params) \
- __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params)
-# define __inline_mathop_declNP(func, op, params...) \
- __inline_mathop_declNP_ (double, func, op, params) \
- __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params) \
- __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params)
-#else
-# define __inline_mathop_decl(func, op, params...) \
- __inline_mathop_decl_ (double, func, op, params)
-# define __inline_mathop_declNP(func, op, params...) \
- __inline_mathop_declNP_ (double, func, op, params)
-#endif
-
-#define __inline_mathop_decl_(float_type, func, op, params...) \
- __MATH_INLINE float_type func (float_type) __THROW; \
- __inline_mathop_declNP_ (float_type, func, op, params)
-
-#define __inline_mathop_declNP_(float_type, func, op, params...) \
- __MATH_INLINE float_type __NTH (func (float_type __x)) \
- { \
- register float_type __result; \
- __asm __volatile__ (op : "=t" (__result) : params); \
- return __result; \
- }
-
-
-#if defined __USE_MISC || defined __USE_ISOC99
-# define __inline_mathcode(func, arg, code) \
- __inline_mathcode_ (double, func, arg, code) \
- __inline_mathcode_ (float, __CONCAT(func,f), arg, code) \
- __inline_mathcode_ (long double, __CONCAT(func,l), arg, code)
-# define __inline_mathcodeNP(func, arg, code) \
- __inline_mathcodeNP_ (double, func, arg, code) \
- __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code) \
- __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code)
-# define __inline_mathcode2(func, arg1, arg2, code) \
- __inline_mathcode2_ (double, func, arg1, arg2, code) \
- __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code) \
- __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code)
-# define __inline_mathcodeNP2(func, arg1, arg2, code) \
- __inline_mathcodeNP2_ (double, func, arg1, arg2, code) \
- __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code) \
- __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code)
-# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
- __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) \
- __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \
- __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
-# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
- __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) \
- __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \
- __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
-#else
-# define __inline_mathcode(func, arg, code) \
- __inline_mathcode_ (double, func, (arg), code)
-# define __inline_mathcodeNP(func, arg, code) \
- __inline_mathcodeNP_ (double, func, (arg), code)
-# define __inline_mathcode2(func, arg1, arg2, code) \
- __inline_mathcode2_ (double, func, arg1, arg2, code)
-# define __inline_mathcodeNP2(func, arg1, arg2, code) \
- __inline_mathcodeNP2_ (double, func, arg1, arg2, code)
-# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
- __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)
-# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
- __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)
-#endif
-
-#define __inline_mathcode_(float_type, func, arg, code) \
- __MATH_INLINE float_type func (float_type) __THROW; \
- __inline_mathcodeNP_(float_type, func, arg, code)
-
-#define __inline_mathcodeNP_(float_type, func, arg, code) \
- __MATH_INLINE float_type __NTH (func (float_type arg)) \
- { \
- code; \
- }
-
-
-#define __inline_mathcode2_(float_type, func, arg1, arg2, code) \
- __MATH_INLINE float_type func (float_type, float_type) __THROW; \
- __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code)
-
-#define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \
- __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2)) \
- { \
- code; \
- }
-
-#define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \
- __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \
- __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code)
-
-#define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \
- __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2, \
- float_type arg3)) \
- { \
- code; \
- }
-#endif
-
-
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-/* Miscellaneous functions */
-
-/* __FAST_MATH__ is defined by gcc -ffast-math. */
-#ifdef __FAST_MATH__
-# ifdef __USE_GNU
-# define __sincos_code \
- register long double __cosr; \
- register long double __sinr; \
- register unsigned int __swtmp; \
- __asm __volatile__ \
- ("fsincos\n\t" \
- "fnstsw %w2\n\t" \
- "testl $0x400, %2\n\t" \
- "jz 1f\n\t" \
- "fldpi\n\t" \
- "fadd %%st(0)\n\t" \
- "fxch %%st(1)\n\t" \
- "2: fprem1\n\t" \
- "fnstsw %w2\n\t" \
- "testl $0x400, %2\n\t" \
- "jnz 2b\n\t" \
- "fstp %%st(1)\n\t" \
- "fsincos\n\t" \
- "1:" \
- : "=t" (__cosr), "=u" (__sinr), "=a" (__swtmp) : "0" (__x)); \
- *__sinx = __sinr; \
- *__cosx = __cosr
-
-__MATH_INLINE void
-__NTH (__sincos (double __x, double *__sinx, double *__cosx))
-{
- __sincos_code;
-}
-
-__MATH_INLINE void
-__NTH (__sincosf (float __x, float *__sinx, float *__cosx))
-{
- __sincos_code;
-}
-
-__MATH_INLINE void
-__NTH (__sincosl (long double __x, long double *__sinx, long double *__cosx))
-{
- __sincos_code;
-}
-# endif
-
-
-/* Optimized inline implementation, sometimes with reduced precision
- and/or argument range. */
-
-# if __GNUC_PREREQ (3, 5)
-# define __expm1_code \
- register long double __temp; \
- __temp = __builtin_expm1l (__x); \
- return __temp ? __temp : __x
-# else
-# define __expm1_code \
- register long double __value; \
- register long double __exponent; \
- register long double __temp; \
- __asm __volatile__ \
- ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" \
- "fmul %%st(1) # x * log2(e)\n\t" \
- "fst %%st(1)\n\t" \
- "frndint # int(x * log2(e))\n\t" \
- "fxch\n\t" \
- "fsub %%st(1) # fract(x * log2(e))\n\t" \
- "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
- "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \
- : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
- __asm __volatile__ \
- ("fscale # 2^int(x * log2(e))\n\t" \
- : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \
- __temp -= 1.0; \
- __temp += __value; \
- return __temp ? __temp : __x
-# endif
-__inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
-
-# if __GNUC_PREREQ (3, 4)
-__inline_mathcodeNP_ (long double, __expl, __x, return __builtin_expl (__x))
-# else
-# define __exp_code \
- register long double __value; \
- register long double __exponent; \
- __asm __volatile__ \
- ("fldl2e # e^x = 2^(x * log2(e))\n\t" \
- "fmul %%st(1) # x * log2(e)\n\t" \
- "fst %%st(1)\n\t" \
- "frndint # int(x * log2(e))\n\t" \
- "fxch\n\t" \
- "fsub %%st(1) # fract(x * log2(e))\n\t" \
- "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
- : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
- __value += 1.0; \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (__value), "u" (__exponent)); \
- return __value
-__inline_mathcodeNP (exp, __x, __exp_code)
-__inline_mathcodeNP_ (long double, __expl, __x, __exp_code)
-# endif
-
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP (tan, __x, \
- register long double __value; \
- register long double __value2 __attribute__ ((__unused__)); \
- __asm __volatile__ \
- ("fptan" \
- : "=t" (__value2), "=u" (__value) : "0" (__x)); \
- return __value)
-# endif
-#endif /* __FAST_MATH__ */
-
-
-#if __GNUC_PREREQ (3, 4)
-__inline_mathcodeNP2_ (long double, __atan2l, __y, __x,
- return __builtin_atan2l (__y, __x))
-#else
-# define __atan2_code \
- register long double __value; \
- __asm __volatile__ \
- ("fpatan" \
- : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); \
- return __value
-# ifdef __FAST_MATH__
-__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
-# endif
-__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
-#endif
-
-
-#if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP2 (fmod, __x, __y, \
- register long double __value; \
- __asm __volatile__ \
- ("1: fprem\n\t" \
- "fnstsw %%ax\n\t" \
- "sahf\n\t" \
- "jp 1b" \
- : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); \
- return __value)
-#endif
-
-
-#ifdef __FAST_MATH__
-# if !__GNUC_PREREQ (3,3)
-__inline_mathopNP (sqrt, "fsqrt")
-__inline_mathopNP_ (long double, __sqrtl, "fsqrt")
-# define __libc_sqrtl(n) __sqrtl (n)
-# else
-# define __libc_sqrtl(n) __builtin_sqrtl (n)
-# endif
-#endif
-
-#if __GNUC_PREREQ (2, 8)
-__inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x))
-# if defined __USE_MISC || defined __USE_ISOC99
-__inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x))
-__inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x))
-# endif
-__inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x))
-#else
-__inline_mathop (fabs, "fabs")
-__inline_mathop_ (long double, __fabsl, "fabs")
-#endif
-
-#ifdef __FAST_MATH__
-# if !__GNUC_PREREQ (3, 4)
-/* The argument range of this inline version is reduced. */
-__inline_mathopNP (sin, "fsin")
-/* The argument range of this inline version is reduced. */
-__inline_mathopNP (cos, "fcos")
-
-__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
-# endif
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")
-
-__inline_mathcodeNP (asin, __x, return __atan2l (__x, __libc_sqrtl (1.0 - __x * __x)))
-__inline_mathcodeNP (acos, __x, return __atan2l (__libc_sqrtl (1.0 - __x * __x), __x))
-# endif
-
-# if !__GNUC_PREREQ (3, 4)
-__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
-# endif
-#endif /* __FAST_MATH__ */
-
-__inline_mathcode_ (long double, __sgn1l, __x, \
- __extension__ union { long double __xld; unsigned int __xi[3]; } __n = \
- { __xld: __x }; \
- __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; \
- __n.__xi[1] = 0x80000000; \
- __n.__xi[0] = 0; \
- return __n.__xld)
-
-
-#ifdef __FAST_MATH__
-/* The argument range of the inline version of sinhl is slightly reduced. */
-__inline_mathcodeNP (sinh, __x, \
- register long double __exm1 = __expm1l (__fabsl (__x)); \
- return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x))
-
-__inline_mathcodeNP (cosh, __x, \
- register long double __ex = __expl (__x); \
- return 0.5 * (__ex + 1.0 / __ex))
-
-__inline_mathcodeNP (tanh, __x, \
- register long double __exm1 = __expm1l (-__fabsl (__x + __x)); \
- return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
-#endif
-
-__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)); \
- 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)); \
- return __value)
-
-#ifdef __FAST_MATH__
-# define __ldexp_code \
- register long double __value; \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (__x), "u" ((long double) __y)); \
- return __value
-
-__MATH_INLINE double
-__NTH (ldexp (double __x, int __y))
-{
- __ldexp_code;
-}
-#endif
-
-
-/* Optimized versions for some non-standardized functions. */
-#if defined __USE_ISOC99 || defined __USE_MISC
-
-# ifdef __FAST_MATH__
-__inline_mathcodeNP (expm1, __x, __expm1_code)
-
-/* We cannot rely on M_SQRT being defined. So we do it for ourself
- here. */
-# define __M_SQRT2 1.41421356237309504880L /* sqrt(2) */
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP (log1p, __x, \
- register long double __value; \
- if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2) \
- __value = logl (1.0 + __x); \
- else \
- __asm __volatile__ \
- ("fldln2\n\t" \
- "fxch\n\t" \
- "fyl2xp1" \
- : "=t" (__value) : "0" (__x) : "st(1)"); \
- return __value)
-# endif
-
-
-/* The argument range of the inline version of asinhl is slightly reduced. */
-__inline_mathcodeNP (asinh, __x, \
- register long double __y = __fabsl (__x); \
- return (log1pl (__y * __y / (__libc_sqrtl (__y * __y + 1.0) + 1.0) + __y) \
- * __sgn1l (__x)))
-
-__inline_mathcodeNP (acosh, __x, \
- return logl (__x + __libc_sqrtl (__x - 1.0) * __libc_sqrtl (__x + 1.0)))
-
-__inline_mathcodeNP (atanh, __x, \
- register long double __y = __fabsl (__x); \
- return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x))
-
-/* The argument range of the inline version of hypotl is slightly reduced. */
-__inline_mathcodeNP2 (hypot, __x, __y,
- return __libc_sqrtl (__x * __x + __y * __y))
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP(logb, __x, \
- register long double __value; \
- register long double __junk; \
- __asm __volatile__ \
- ("fxtract\n\t" \
- : "=t" (__junk), "=u" (__value) : "0" (__x)); \
- return __value)
-# endif
-
-# endif
-#endif
-
-#ifdef __USE_ISOC99
-# ifdef __FAST_MATH__
-
-# if !__GNUC_PREREQ (3, 5)
-__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)")
-# endif
-
-__MATH_INLINE float
-__NTH (ldexpf (float __x, int __y))
-{
- __ldexp_code;
-}
-
-__MATH_INLINE long double
-__NTH (ldexpl (long double __x, int __y))
-{
- __ldexp_code;
-}
-
-__inline_mathopNP (rint, "frndint")
-# endif /* __FAST_MATH__ */
-
-# define __lrint_code \
- long int __lrintres; \
- __asm__ __volatile__ \
- ("fistpl %0" \
- : "=m" (__lrintres) : "t" (__x) : "st"); \
- return __lrintres
-__MATH_INLINE long int
-__NTH (lrintf (float __x))
-{
- __lrint_code;
-}
-__MATH_INLINE long int
-__NTH (lrint (double __x))
-{
- __lrint_code;
-}
-__MATH_INLINE long int
-__NTH (lrintl (long double __x))
-{
- __lrint_code;
-}
-# undef __lrint_code
-
-# define __llrint_code \
- long long int __llrintres; \
- __asm__ __volatile__ \
- ("fistpll %0" \
- : "=m" (__llrintres) : "t" (__x) : "st"); \
- return __llrintres
-__MATH_INLINE long long int
-__NTH (llrintf (float __x))
-{
- __llrint_code;
-}
-__MATH_INLINE long long int
-__NTH (llrint (double __x))
-{
- __llrint_code;
-}
-__MATH_INLINE long long int
-__NTH (llrintl (long double __x))
-{
- __llrint_code;
-}
-# undef __llrint_code
-
-#endif
-
-
-#ifdef __USE_MISC
-
-# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
-__inline_mathcodeNP2 (drem, __x, __y, \
- register double __value; \
- register int __clobbered; \
- __asm __volatile__ \
- ("1: fprem1\n\t" \
- "fstsw %%ax\n\t" \
- "sahf\n\t" \
- "jp 1b" \
- : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); \
- return __value)
-# endif
-
-
-/* This function is used in the `isfinite' macro. */
-__MATH_INLINE int
-__NTH (__finite (double __x))
-{
- return (__extension__
- (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
- | 0x800fffffu) + 1) >> 31));
-}
-
-#endif /* __USE_MISC */
-
-/* Undefine some of the large macros which are not used anymore. */
-#undef __atan2_code
-#ifdef __FAST_MATH__
-# undef __expm1_code
-# undef __exp_code
-# undef __sincos_code
-#endif /* __FAST_MATH__ */
-
-#endif /* __NO_MATH_INLINES */
-
-
-/* This code is used internally in the GNU libc. */
-#ifdef __LIBC_INTERNAL_MATH_INLINES
-__inline_mathop (__ieee754_sqrt, "fsqrt")
-__inline_mathcode2 (__ieee754_atan2, __y, __x,
- register long double __value;
- __asm __volatile__ ("fpatan\n\t"
- : "=t" (__value)
- : "0" (__x), "u" (__y) : "st(1)");
- return __value;)
-#endif
-
-#endif /* __GNUC__ */
diff --git a/sysdeps/x86_64/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
similarity index 100%
rename from sysdeps/x86_64/fpu/bits/mathinline.h
rename to sysdeps/x86/fpu/bits/mathinline.h
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7b5d43309c57dec8fc0e63e0cea1443aabc318c1
commit 7b5d43309c57dec8fc0e63e0cea1443aabc318c1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:30:45 2012 -0700
Use x86_64 fpu/bits/fenv.h for i386 and x86_64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index 03739eb..b03183b 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,12 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/i386/fpu/bits/fenv.h: Removed.
+ * sysdeps/i386/fpu/Implies: New file.
+ * sysdeps/x86_64/fpu/Implies: Likewise.
+ * sysdeps/x86_64/fpu/bits/fenv.h: Renamed to ...
+ * sysdeps/x86/fpu/bits/fenv.h: This.
+
* sysdeps/i386/i486/bits/string.h: Removed.
* sysdeps/x86_64/bits/string.h: Renamed to ...
* sysdeps/x86/bits/string.h: This.
diff --git a/sysdeps/i386/fpu/Implies b/sysdeps/i386/fpu/Implies
new file mode 100644
index 0000000..2b745a3
--- /dev/null
+++ b/sysdeps/i386/fpu/Implies
@@ -0,0 +1 @@
+x86/fpu
diff --git a/sysdeps/i386/fpu/bits/fenv.h b/sysdeps/i386/fpu/bits/fenv.h
deleted file mode 100644
index e71ceb7..0000000
--- a/sysdeps/i386/fpu/bits/fenv.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Copyright (C) 1997-2012 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _FENV_H
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
-#endif
-
-
-/* Define bits representing the exception. We use the bit positions
- of the appropriate bits in the FPU control word. */
-enum
- {
- FE_INVALID = 0x01,
-#define FE_INVALID FE_INVALID
- __FE_DENORM = 0x02,
- FE_DIVBYZERO = 0x04,
-#define FE_DIVBYZERO FE_DIVBYZERO
- FE_OVERFLOW = 0x08,
-#define FE_OVERFLOW FE_OVERFLOW
- FE_UNDERFLOW = 0x10,
-#define FE_UNDERFLOW FE_UNDERFLOW
- FE_INEXACT = 0x20
-#define FE_INEXACT FE_INEXACT
- };
-
-#define FE_ALL_EXCEPT \
- (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-
-/* The ix87 FPU supports all of the four defined rounding modes. We
- use again the bit positions in the FPU control word as the values
- for the appropriate macros. */
-enum
- {
- FE_TONEAREST = 0,
-#define FE_TONEAREST FE_TONEAREST
- FE_DOWNWARD = 0x400,
-#define FE_DOWNWARD FE_DOWNWARD
- FE_UPWARD = 0x800,
-#define FE_UPWARD FE_UPWARD
- FE_TOWARDZERO = 0xc00
-#define FE_TOWARDZERO FE_TOWARDZERO
- };
-
-
-/* Type representing exception flags. */
-typedef unsigned short int fexcept_t;
-
-
-/* Type representing floating-point environment. This function corresponds
- to the layout of the block written by the `fstenv'. */
-typedef struct
- {
- unsigned short int __control_word;
- unsigned short int __unused1;
- unsigned short int __status_word;
- unsigned short int __unused2;
- unsigned short int __tags;
- unsigned short int __unused3;
- unsigned int __eip;
- unsigned short int __cs_selector;
- unsigned int __opcode:11;
- unsigned int __unused4:5;
- unsigned int __data_offset;
- unsigned short int __data_selector;
- unsigned short int __unused5;
- }
-fenv_t;
-
-/* If the default argument is used we use this value. */
-#define FE_DFL_ENV ((const fenv_t *) -1)
-
-#ifdef __USE_GNU
-/* Floating-point environment where none of the exception is masked. */
-# define FE_NOMASK_ENV ((const fenv_t *) -2)
-#endif
-
-
-#ifdef __USE_EXTERN_INLINES
-__BEGIN_DECLS
-
-/* Optimized versions. */
-extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
-__extern_inline int
-__NTH (feraiseexcept (int __excepts))
-{
- if (__builtin_constant_p (__excepts)
- && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0)
- {
- if ((FE_INVALID & __excepts) != 0)
- {
- /* One example of a invalid operation is 0.0 / 0.0. */
- float __f = 0.0;
-
-# ifdef __SSE_MATH__
- __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
-# else
- __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
- : "=t" (__f) : "0" (__f));
-# endif
- (void) &__f;
- }
- if ((FE_DIVBYZERO & __excepts) != 0)
- {
- float __f = 1.0;
- float __g = 0.0;
-
-# ifdef __SSE_MATH__
- __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
-# else
- __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
- : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
-# endif
- (void) &__f;
- }
-
- return 0;
- }
-
- return __feraiseexcept_renamed (__excepts);
-}
-
-__END_DECLS
-#endif
diff --git a/sysdeps/x86_64/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h
similarity index 100%
rename from sysdeps/x86_64/fpu/bits/fenv.h
rename to sysdeps/x86/fpu/bits/fenv.h
diff --git a/sysdeps/x86_64/fpu/Implies b/sysdeps/x86_64/fpu/Implies
new file mode 100644
index 0000000..2b745a3
--- /dev/null
+++ b/sysdeps/x86_64/fpu/Implies
@@ -0,0 +1 @@
+x86/fpu
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a90fef4f84c5ec399bfdd9d1630e6ffe14b3d209
commit a90fef4f84c5ec399bfdd9d1630e6ffe14b3d209
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:24:28 2012 -0700
Use x86_64 bits/string.h for i386 and x86_64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index 8f8cbaa..03739eb 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,10 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/i386/i486/bits/string.h: Removed.
+ * sysdeps/x86_64/bits/string.h: Renamed to ...
+ * sysdeps/x86/bits/string.h: This.
+
* sysdeps/i386/i486/bits/string.h: Copy to ...
* sysdeps/x86_64/bits/string.h: Here.
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
deleted file mode 100644
index a5edf51..0000000
--- a/sysdeps/i386/i486/bits/string.h
+++ /dev/null
@@ -1,1975 +0,0 @@
-/* Optimized, inlined string functions. i486 version.
- Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2007,2011,2012
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* The ix86 processors can access unaligned multi-byte variables. */
-#define _STRING_ARCH_unaligned 1
-
-
-/* We only provide optimizations if the user selects them and if
- GNU CC is used. */
-#if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
- && defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__
-
-#ifndef __STRING_INLINE
-# ifndef __extern_inline
-# define __STRING_INLINE inline
-# else
-# define __STRING_INLINE __extern_inline
-# endif
-#endif
-
-/* The macros are used in some of the optimized implementations below. */
-#define __STRING_SMALL_GET16(src, idx) \
- ((((const unsigned char *) (src))[idx + 1] << 8) \
- | ((const unsigned char *) (src))[idx])
-#define __STRING_SMALL_GET32(src, idx) \
- (((((const unsigned char *) (src))[idx + 3] << 8 \
- | ((const unsigned char *) (src))[idx + 2]) << 8 \
- | ((const unsigned char *) (src))[idx + 1]) << 8 \
- | ((const unsigned char *) (src))[idx])
-
-
-/* Copy N bytes of SRC to DEST. */
-#define _HAVE_STRING_ARCH_memcpy 1
-#define memcpy(dest, src, n) \
- (__extension__ (__builtin_constant_p (n) \
- ? __memcpy_c ((dest), (src), (n)) \
- : __memcpy_g ((dest), (src), (n))))
-#define __memcpy_c(dest, src, n) \
- ((n) == 0 \
- ? (dest) \
- : (((n) % 4 == 0) \
- ? __memcpy_by4 (dest, src, n) \
- : (((n) % 2 == 0) \
- ? __memcpy_by2 (dest, src, n) \
- : __memcpy_g (dest, src, n))))
-
-__STRING_INLINE void *__memcpy_by4 (void *__dest, const void *__src,
- size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by4 (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__n / 4)
- : "memory", "cc");
- return __dest;
-}
-
-__STRING_INLINE void *__memcpy_by2 (void *__dest, const void *__src,
- size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by2 (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__n / 2)
- : "memory", "cc");
- return __dest;
-}
-
-__STRING_INLINE void *__memcpy_g (void *__dest, const void *__src, size_t __n);
-
-__STRING_INLINE void *
-__memcpy_g (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register void *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=&c" (__d0), "=&D" (__d1), "=&S" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__tmp), "2" (__src),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src)
- : "cc");
- return __dest;
-}
-
-#define _HAVE_STRING_ARCH_memmove 1
-#ifndef _FORCE_INLINES
-/* Copy N bytes of SRC to DEST, guaranteeing
- correct behavior for overlapping strings. */
-#define memmove(dest, src, n) __memmove_g (dest, src, n)
-
-__STRING_INLINE void *__memmove_g (void *, const void *, size_t)
- __asm__ ("memmove");
-
-__STRING_INLINE void *
-__memmove_g (void *__dest, const void *__src, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register void *__tmp = __dest;
- if (__dest < __src)
- __asm__ __volatile__
- ("cld\n\t"
- "rep; movsb"
- : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__src), "2" (__tmp),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
- else
- __asm__ __volatile__
- ("std\n\t"
- "rep; movsb\n\t"
- "cld"
- : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
- : "0" (__n), "1" (__n - 1 + (const char *) __src),
- "2" (__n - 1 + (char *) __tmp),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
- return __dest;
-}
-#endif
-
-/* Compare N bytes of S1 and S2. */
-#define _HAVE_STRING_ARCH_memcmp 1
-#ifndef _FORCE_INLINES
-# ifndef __PIC__
-/* gcc has problems to spill registers when using PIC. */
-__STRING_INLINE int
-memcmp (const void *__s1, const void *__s2, size_t __n)
-{
- register unsigned long int __d0, __d1, __d2;
- register int __res;
- __asm__ __volatile__
- ("cld\n\t"
- "testl %3,%3\n\t"
- "repe; cmpsb\n\t"
- "je 1f\n\t"
- "sbbl %0,%0\n\t"
- "orl $1,%0\n"
- "1:"
- : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
- : "0" (0), "1" (__s1), "2" (__s2), "3" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
- : "cc");
- return __res;
-}
-# endif
-#endif
-
-/* Set N bytes of S to C. */
-#define _HAVE_STRING_ARCH_memset 1
-#define _USE_STRING_ARCH_memset 1
-#define memset(s, c, n) \
- (__extension__ (__builtin_constant_p (n) && (n) <= 16 \
- ? ((n) == 1 \
- ? __memset_c1 ((s), (c)) \
- : __memset_gc ((s), (c), (n))) \
- : (__builtin_constant_p (c) \
- ? (__builtin_constant_p (n) \
- ? __memset_ccn ((s), (c), (n)) \
- : memset ((s), (c), (n))) \
- : (__builtin_constant_p (n) \
- ? __memset_gcn ((s), (c), (n)) \
- : memset ((s), (c), (n))))))
-
-#define __memset_c1(s, c) ({ void *__s = (s); \
- *((unsigned char *) __s) = (unsigned char) (c); \
- __s; })
-
-#define __memset_gc(s, c, n) \
- ({ void *__s = (s); \
- union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- } *__u = __s; \
- unsigned int __c = ((unsigned int) ((unsigned char) (c))) * 0x01010101; \
- \
- /* We apply a trick here. `gcc' would implement the following \
- assignments using immediate operands. But this uses to much \
- memory (7, instead of 4 bytes). So we force the value in a \
- registers. */ \
- if ((n) == 3 || (n) >= 5) \
- __asm__ __volatile__ ("" : "=r" (__c) : "0" (__c)); \
- \
- /* This `switch' statement will be removed at compile-time. */ \
- switch (n) \
- { \
- case 15: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 11: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 7: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 3: \
- __u->__usi = (unsigned short int) __c; \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = (unsigned char) __c; \
- break; \
- \
- case 14: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 10: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 6: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 2: \
- __u->__usi = (unsigned short int) __c; \
- break; \
- \
- case 13: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 9: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 5: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 1: \
- __u->__uc = (unsigned char) __c; \
- break; \
- \
- case 16: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 12: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 8: \
- __u->__ui = __c; \
- __u = __extension__ ((void *) __u + 4); \
- case 4: \
- __u->__ui = __c; \
- case 0: \
- break; \
- } \
- \
- __s; })
-
-#define __memset_ccn(s, c, n) \
- (((n) % 4 == 0) \
- ? __memset_ccn_by4 (s, ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
- n) \
- : (((n) % 2 == 0) \
- ? __memset_ccn_by2 (s, \
- ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
- n) \
- : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_ccn_by4 (void *__s, unsigned int __c,
- size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
-{
- register void *__tmp = __s;
- register unsigned long int __d0;
-#ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "rep; stosl"
- : "=&a" (__c), "=&D" (__tmp), "=&c" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-#else
- __asm__ __volatile__
- ("1:\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- : "=&r" (__c), "=&r" (__tmp), "=&r" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-#endif
- return __s;
-}
-
-__STRING_INLINE void *__memset_ccn_by2 (void *__s, unsigned int __c,
- size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __s;
-#ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "rep; stosl\n"
- "stosw"
- : "=&a" (__d0), "=&D" (__tmp), "=&c" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-#else
- __asm__ __volatile__
- ("1:\tmovl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
-#endif
- return __s;
-}
-
-#define __memset_gcn(s, c, n) \
- (((n) % 4 == 0) \
- ? __memset_gcn_by4 (s, c, n) \
- : (((n) % 2 == 0) \
- ? __memset_gcn_by2 (s, c, n) \
- : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_gcn_by4 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by4 (void *__s, int __c, size_t __n)
-{
- register void *__tmp = __s;
- register unsigned long int __d0;
- __asm__ __volatile__
- ("movb %b0,%h0\n"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- : "=&q" (__c), "=&r" (__tmp), "=&r" (__d0),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
- return __s;
-}
-
-__STRING_INLINE void *__memset_gcn_by2 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by2 (void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register void *__tmp = __s;
- __asm__ __volatile__
- ("movb %b0,%h0\n\t"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
- : "cc");
- return __s;
-}
-
-
-/* Search N bytes of S for C. */
-#define _HAVE_STRING_ARCH_memchr 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE void *
-memchr (const void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0;
-#ifdef __i686__
- register unsigned long int __d1;
-#endif
- register unsigned char *__res;
- if (__n == 0)
- return NULL;
-#ifdef __i686__
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "cmovne %2,%0"
- : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
- : "a" (__c), "0" (__s), "1" (__n), "2" (1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-#else
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "je 1f\n\t"
- "movl $1,%0\n"
- "1:"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s), "1" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-#endif
- return __res - 1;
-}
-#endif
-
-#define _HAVE_STRING_ARCH_memrchr 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE void *__memrchr (const void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memrchr (const void *__s, int __c, size_t __n)
-{
- register unsigned long int __d0;
-# ifdef __i686__
- register unsigned long int __d1;
-# endif
- register void *__res;
- if (__n == 0)
- return NULL;
-# ifdef __i686__
- __asm__ __volatile__
- ("std\n\t"
- "repne; scasb\n\t"
- "cmovne %2,%0\n\t"
- "cld\n\t"
- "incl %0"
- : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
- : "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# else
- __asm__ __volatile__
- ("std\n\t"
- "repne; scasb\n\t"
- "je 1f\n\t"
- "orl $-1,%0\n"
- "1:\tcld\n\t"
- "incl %0"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s + __n - 1), "1" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
- : "cc");
-# endif
- return __res;
-}
-# ifdef __USE_GNU
-# define memrchr(s, c, n) __memrchr ((s), (c), (n))
-# endif
-#endif
-
-/* Return pointer to C in S. */
-#define _HAVE_STRING_ARCH_rawmemchr 1
-__STRING_INLINE void *__rawmemchr (const void *__s, int __c);
-
-#ifndef _FORCE_INLINES
-__STRING_INLINE void *
-__rawmemchr (const void *__s, int __c)
-{
- register unsigned long int __d0;
- register unsigned char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- : "=D" (__res), "=&c" (__d0)
- : "a" (__c), "0" (__s), "1" (0xffffffff),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-# ifdef __USE_GNU
-__STRING_INLINE void *
-rawmemchr (const void *__s, int __c)
-{
- return __rawmemchr (__s, __c);
-}
-# endif /* use GNU */
-#endif
-
-
-/* Return the length of S. */
-#define _HAVE_STRING_ARCH_strlen 1
-#define strlen(str) \
- (__extension__ (__builtin_constant_p (str) \
- ? __builtin_strlen (str) \
- : __strlen_g (str)))
-__STRING_INLINE size_t __strlen_g (const char *__str);
-
-__STRING_INLINE size_t
-__strlen_g (const char *__str)
-{
- register char __dummy;
- register const char *__tmp = __str;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%b1\n\t"
- "leal 1(%0),%0\n\t"
- "testb %b1,%b1\n\t"
- "jne 1b"
- : "=r" (__tmp), "=&q" (__dummy)
- : "0" (__str),
- "m" ( *(struct { char __x[0xfffffff]; } *)__str)
- : "cc" );
- return __tmp - __str - 1;
-}
-
-
-/* Copy SRC to DEST. */
-#define _HAVE_STRING_ARCH_strcpy 1
-#define strcpy(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \
- ? __strcpy_a_small ((dest), (src), strlen (src) + 1) \
- : (char *) memcpy ((char *) (dest), \
- (const char *) (src), \
- strlen (src) + 1)) \
- : __strcpy_g ((dest), (src))))
-
-#define __strcpy_a_small(dest, src, srclen) \
- (__extension__ ({ char *__dest = (dest); \
- union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- char __c; \
- } *__u = (void *) __dest; \
- switch (srclen) \
- { \
- case 1: \
- __u->__uc = '\0'; \
- break; \
- case 2: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- break; \
- case 3: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 4: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- break; \
- case 5: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__uc = '\0'; \
- break; \
- case 6: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- break; \
- case 7: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 8: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__ui = __STRING_SMALL_GET32 (src, 4); \
- break; \
- } \
- (char *) __dest; }))
-
-__STRING_INLINE char *__strcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcpy_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest;
- register char __dummy;
- __asm__ __volatile__
- (
- "1:\n\t"
- "movb (%0),%b2\n\t"
- "leal 1(%0),%0\n\t"
- "movb %b2,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__src), "1" (__tmp),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "cc");
- return __dest;
-}
-
-
-#ifdef __USE_GNU
-# define _HAVE_STRING_ARCH_stpcpy 1
-/* Copy SRC to DEST. */
-# define __stpcpy(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? (strlen (src) + 1 <= 8 \
- ? __stpcpy_a_small ((dest), (src), strlen (src) + 1) \
- : __stpcpy_c ((dest), (src), strlen (src) + 1)) \
- : __stpcpy_g ((dest), (src))))
-# define __stpcpy_c(dest, src, srclen) \
- ((srclen) % 4 == 0 \
- ? __mempcpy_by4 (dest, src, srclen) - 1 \
- : ((srclen) % 2 == 0 \
- ? __mempcpy_by2 (dest, src, srclen) - 1 \
- : __mempcpy_byn (dest, src, srclen) - 1))
-
-/* In glibc itself we use this symbol for namespace reasons. */
-# define stpcpy(dest, src) __stpcpy ((dest), (src))
-
-# define __stpcpy_a_small(dest, src, srclen) \
- (__extension__ ({ union { \
- unsigned int __ui; \
- unsigned short int __usi; \
- unsigned char __uc; \
- char __c; \
- } *__u = (void *) (dest); \
- switch (srclen) \
- { \
- case 1: \
- __u->__uc = '\0'; \
- break; \
- case 2: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 1); \
- break; \
- case 3: \
- __u->__usi = __STRING_SMALL_GET16 (src, 0); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 4: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 3); \
- break; \
- case 5: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__uc = '\0'; \
- break; \
- case 6: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 1); \
- break; \
- case 7: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__usi = __STRING_SMALL_GET16 (src, 4); \
- __u = __extension__ ((void *) __u + 2); \
- __u->__uc = '\0'; \
- break; \
- case 8: \
- __u->__ui = __STRING_SMALL_GET32 (src, 0); \
- __u = __extension__ ((void *) __u + 4); \
- __u->__ui = __STRING_SMALL_GET32 (src, 4); \
- __u = __extension__ ((void *) __u + 3); \
- break; \
- } \
- (char *) __u; }))
-
-__STRING_INLINE char *__mempcpy_by4 (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by4 (char *__dest, const char *__src, size_t __srclen)
-{
- register char *__tmp = __dest;
- register unsigned long int __d0, __d1;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 4)
- : "memory", "cc");
- return __tmp;
-}
-
-__STRING_INLINE char *__mempcpy_by2 (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by2 (char *__dest, const char *__src, size_t __srclen)
-{
- register char *__tmp = __dest;
- register unsigned long int __d0, __d1;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)"
- : "=&q" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- return __tmp + 2;
-}
-
-__STRING_INLINE char *__mempcpy_byn (char *__dest, const char *__src,
- size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_byn (char *__dest, const char *__src, size_t __srclen)
-{
- register unsigned long __d0, __d1;
- register char *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%%ecx\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "0" (__tmp), "1" (__srclen), "2" (__src),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- return __tmp;
-}
-
-__STRING_INLINE char *__stpcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__stpcpy_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest;
- register char __dummy;
- __asm__ __volatile__
- (
- "1:\n\t"
- "movb (%0),%b2\n\t"
- "leal 1(%0),%0\n\t"
- "movb %b2,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=&r" (__src), "=r" (__tmp), "=&q" (__dummy),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__src), "1" (__tmp),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "cc");
- return __tmp - 1;
-}
-#endif
-
-
-/* Copy no more than N characters of SRC to DEST. */
-#define _HAVE_STRING_ARCH_strncpy 1
-#define strncpy(dest, src, n) \
- (__extension__ (__builtin_constant_p (src) \
- ? ((strlen (src) + 1 >= ((size_t) (n)) \
- ? (char *) memcpy ((char *) (dest), \
- (const char *) (src), n) \
- : __strncpy_cg ((dest), (src), strlen (src) + 1, n))) \
- : __strncpy_gg ((dest), (src), n)))
-#define __strncpy_cg(dest, src, srclen, n) \
- (((srclen) % 4 == 0) \
- ? __strncpy_by4 (dest, src, srclen, n) \
- : (((srclen) % 2 == 0) \
- ? __strncpy_by2 (dest, src, srclen, n) \
- : __strncpy_byn (dest, src, srclen, n)))
-
-__STRING_INLINE char *__strncpy_by4 (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by4 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register char *__tmp = __dest;
- register int __dummy1, __dummy2;
- __asm__ __volatile__
- ("1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- : "=&r" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 4),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_by2 (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by2 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register char *__tmp = __dest;
- register int __dummy1, __dummy2;
- __asm__ __volatile__
- ("shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\n\t"
- "movl (%2),%0\n\t"
- "leal 4(%2),%2\n\t"
- "movl %0,(%1)\n\t"
- "leal 4(%1),%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\n\t"
- "movw (%2),%w0\n\t"
- "movw %w0,(%1)\n\t"
- : "=&q" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp + 2, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_byn (char *__dest, const char __src[],
- size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_byn (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
- register unsigned long int __d0, __d1;
- register char *__tmp = __dest;
- __asm__ __volatile__
- ("cld\n\t"
- "shrl $1,%1\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\n\t"
- "shrl $1,%1\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\n\t"
- "rep; movsl"
- : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
- "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
- : "1" (__srclen), "0" (__tmp),"2" (__src),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- (void) memset (__tmp, '\0', __n - __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strncpy_gg (char *__dest, const char *__src,
- size_t __n);
-
-__STRING_INLINE char *
-__strncpy_gg (char *__dest, const char *__src, size_t __n)
-{
- register char *__tmp = __dest;
- register char __dummy;
- if (__n > 0)
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%2\n\t"
- "incl %0\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "je 3f\n\t"
- "testb %2,%2\n\t"
- "jne 1b\n\t"
- "2:\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "jne 2b\n\t"
- "3:"
- : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy), "=&r" (__n)
- : "0" (__src), "1" (__tmp), "3" (__n)
- : "memory", "cc");
-
- return __dest;
-}
-
-
-/* Append SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strcat 1
-#define strcat(dest, src) \
- (__extension__ (__builtin_constant_p (src) \
- ? __strcat_c ((dest), (src), strlen (src) + 1) \
- : __strcat_g ((dest), (src))))
-
-__STRING_INLINE char *__strcat_c (char *__dest, const char __src[],
- size_t __srclen);
-
-__STRING_INLINE char *
-__strcat_c (char *__dest, const char __src[], size_t __srclen)
-{
-#ifdef __i686__
- register unsigned long int __d0;
- register char *__tmp;
- __asm__ __volatile__
- ("repne; scasb"
- : "=D" (__tmp), "=&c" (__d0),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__dest), "1" (0xffffffff), "a" (0),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
- --__tmp;
-#else
- register char *__tmp = __dest - 1;
- __asm__ __volatile__
- ("1:\n\t"
- "incl %0\n\t"
- "cmpb $0,(%0)\n\t"
- "jne 1b\n"
- : "=r" (__tmp),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "0" (__tmp),
- "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
- : "cc");
-#endif
- (void) memcpy (__tmp, __src, __srclen);
- return __dest;
-}
-
-__STRING_INLINE char *__strcat_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcat_g (char *__dest, const char *__src)
-{
- register char *__tmp = __dest - 1;
- register char __dummy;
- __asm__ __volatile__
- ("1:\n\t"
- "incl %1\n\t"
- "cmpb $0,(%1)\n\t"
- "jne 1b\n"
- "2:\n\t"
- "movb (%2),%b0\n\t"
- "incl %2\n\t"
- "movb %b0,(%1)\n\t"
- "incl %1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n"
- : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src),
- "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
- : "1" (__tmp), "2" (__src),
- "m" ( *(struct { char __x[0xfffffff]; } *)__src)
- : "memory", "cc");
- return __dest;
-}
-
-
-/* Append no more than N characters from SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strncat 1
-#define strncat(dest, src, n) \
- (__extension__ ({ char *__dest = (dest); \
- __builtin_constant_p (src) && __builtin_constant_p (n) \
- ? (strlen (src) < ((size_t) (n)) \
- ? strcat (__dest, (src)) \
- : (*(char *)__mempcpy (strchr (__dest, '\0'), \
- (const char *) (src), \
- (n)) = 0, __dest)) \
- : __strncat_g (__dest, (src), (n)); }))
-
-__STRING_INLINE char *__strncat_g (char *__dest, const char __src[],
- size_t __n);
-
-__STRING_INLINE char *
-__strncat_g (char *__dest, const char __src[], size_t __n)
-{
- register char *__tmp = __dest;
- register char __dummy;
-#ifdef __i686__
- __asm__ __volatile__
- ("repne; scasb\n"
- "movl %4, %3\n\t"
- "decl %1\n\t"
- "1:\n\t"
- "subl $1,%3\n\t"
- "jc 2f\n\t"
- "movb (%2),%b0\n\t"
- "movsb\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n\t"
- "decl %1\n"
- "2:\n\t"
- "movb $0,(%1)"
- : "=&a" (__dummy), "=&D" (__tmp), "=&S" (__src), "=&c" (__n)
- : "g" (__n), "0" (0), "1" (__tmp), "2" (__src), "3" (0xffffffff)
- : "memory", "cc");
-#else
- --__tmp;
- __asm__ __volatile__
- ("1:\n\t"
- "cmpb $0,1(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "jne 1b\n"
- "2:\n\t"
- "subl $1,%3\n\t"
- "jc 3f\n\t"
- "movb (%2),%b0\n\t"
- "leal 1(%2),%2\n\t"
- "movb %b0,(%1)\n\t"
- "leal 1(%1),%1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n\t"
- "decl %1\n"
- "3:\n\t"
- "movb $0,(%1)"
- : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src), "=&r" (__n)
- : "1" (__tmp), "2" (__src), "3" (__n)
- : "memory", "cc");
-#endif
- return __dest;
-}
-
-
-/* Compare S1 and S2. */
-#define _HAVE_STRING_ARCH_strcmp 1
-#define strcmp(s1, s2) \
- (__extension__ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
- && (sizeof ((s1)[0]) != 1 || strlen (s1) >= 4) \
- && (sizeof ((s2)[0]) != 1 || strlen (s2) >= 4) \
- ? memcmp ((const char *) (s1), (const char *) (s2), \
- (strlen (s1) < strlen (s2) \
- ? strlen (s1) : strlen (s2)) + 1) \
- : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \
- && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \
- ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \
- ? __strcmp_cc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s1)) \
- : __strcmp_cg ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s1))) \
- : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \
- && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \
- ? (__builtin_constant_p (s1) \
- ? __strcmp_cc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s2)) \
- : __strcmp_gc ((const unsigned char *) (s1), \
- (const unsigned char *) (s2), \
- strlen (s2))) \
- : __strcmp_gg ((s1), (s2))))))
-
-#define __strcmp_cc(s1, s2, l) \
- (__extension__ ({ register int __result = (s1)[0] - (s2)[0]; \
- if (l > 0 && __result == 0) \
- { \
- __result = (s1)[1] - (s2)[1]; \
- if (l > 1 && __result == 0) \
- { \
- __result = (s1)[2] - (s2)[2]; \
- if (l > 2 && __result == 0) \
- __result = (s1)[3] - (s2)[3]; \
- } \
- } \
- __result; }))
-
-#define __strcmp_cg(s1, s2, l1) \
- (__extension__ ({ const unsigned char *__s2 = (s2); \
- register int __result = (s1)[0] - __s2[0]; \
- if (l1 > 0 && __result == 0) \
- { \
- __result = (s1)[1] - __s2[1]; \
- if (l1 > 1 && __result == 0) \
- { \
- __result = (s1)[2] - __s2[2]; \
- if (l1 > 2 && __result == 0) \
- __result = (s1)[3] - __s2[3]; \
- } \
- } \
- __result; }))
-
-#define __strcmp_gc(s1, s2, l2) \
- (__extension__ ({ const unsigned char *__s1 = (s1); \
- register int __result = __s1[0] - (s2)[0]; \
- if (l2 > 0 && __result == 0) \
- { \
- __result = __s1[1] - (s2)[1]; \
- if (l2 > 1 && __result == 0) \
- { \
- __result = __s1[2] - (s2)[2]; \
- if (l2 > 2 && __result == 0) \
- __result = __s1[3] - (s2)[3]; \
- } \
- } \
- __result; }))
-
-__STRING_INLINE int __strcmp_gg (const char *__s1, const char *__s2);
-
-__STRING_INLINE int
-__strcmp_gg (const char *__s1, const char *__s2)
-{
- register int __res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%1),%b0\n\t"
- "leal 1(%1),%1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 2f\n\t"
- "leal 1(%2),%2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "movl $1,%0\n\t"
- "jb 3f\n\t"
- "negl %0\n"
- "3:"
- : "=q" (__res), "=&r" (__s1), "=&r" (__s2)
- : "1" (__s1), "2" (__s2),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s1),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s2)
- : "cc");
- return __res;
-}
-
-
-/* Compare N characters of S1 and S2. */
-#define _HAVE_STRING_ARCH_strncmp 1
-#define strncmp(s1, s2, n) \
- (__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n)) \
- ? strcmp ((s1), (s2)) \
- : (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
- ? strcmp ((s1), (s2)) \
- : __strncmp_g ((s1), (s2), (n)))))
-
-__STRING_INLINE int __strncmp_g (const char *__s1, const char *__s2,
- size_t __n);
-
-__STRING_INLINE int
-__strncmp_g (const char *__s1, const char *__s2, size_t __n)
-{
- register int __res;
- __asm__ __volatile__
- ("1:\n\t"
- "subl $1,%3\n\t"
- "jc 2f\n\t"
- "movb (%1),%b0\n\t"
- "incl %1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 3f\n\t"
- "incl %2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n"
- "2:\n\t"
- "xorl %0,%0\n\t"
- "jmp 4f\n"
- "3:\n\t"
- "movl $1,%0\n\t"
- "jb 4f\n\t"
- "negl %0\n"
- "4:"
- : "=q" (__res), "=&r" (__s1), "=&r" (__s2), "=&r" (__n)
- : "1" (__s1), "2" (__s2), "3" (__n),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
- "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
- : "cc");
- return __res;
-}
-
-
-/* Find the first occurrence of C in S. */
-#define _HAVE_STRING_ARCH_strchr 1
-#define _USE_STRING_ARCH_strchr 1
-#define strchr(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? ((c) == '\0' \
- ? (char *) __rawmemchr ((s), (c)) \
- : __strchr_c ((s), ((c) & 0xff) << 8)) \
- : __strchr_g ((s), (c))))
-
-__STRING_INLINE char *__strchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-
-/* Find the first occurrence of C in S or the final NUL byte. */
-#define _HAVE_STRING_ARCH_strchrnul 1
-#define __strchrnul(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? ((c) == '\0' \
- ? (char *) __rawmemchr ((s), c) \
- : __strchrnul_c ((s), ((c) & 0xff) << 8)) \
- : __strchrnul_g ((s), c)))
-
-__STRING_INLINE char *__strchrnul_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_c (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "decl %0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strchrnul_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_g (const char *__s, int __c)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "1:\n\t"
- "movb (%0),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "leal 1(%0),%0\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "decl %0\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-#ifdef __USE_GNU
-# define strchrnul(s, c) __strchrnul ((s), (c))
-#endif
-
-
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-/* Find the first occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_index 1
-# define index(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strchr_c ((s), ((c) & 0xff) << 8) \
- : __strchr_g ((s), (c))))
-#endif
-
-
-/* Find the last occurrence of C in S. */
-#define _HAVE_STRING_ARCH_strrchr 1
-#define strrchr(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strrchr_c ((s), ((c) & 0xff) << 8) \
- : __strrchr_g ((s), (c))))
-
-#ifdef __i686__
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %h2,%b2\n\t"
- "cmove %1,%0\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (1), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("movb %b2,%h2\n"
- "cld\n\t"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %h2,%b2\n\t"
- "cmove %1,%0\n\t"
- "testb %b2,%b2\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (1), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res - 1;
-}
-#else
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %%ah,%%al\n\t"
- "jne 2f\n\t"
- "leal -1(%%esi),%0\n"
- "2:\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b"
- : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (0), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
- register unsigned long int __d0, __d1;
- register char *__res;
- __asm__ __volatile__
- ("movb %%al,%%ah\n"
- "cld\n\t"
- "1:\n\t"
- "lodsb\n\t"
- "cmpb %%ah,%%al\n\t"
- "jne 2f\n\t"
- "leal -1(%%esi),%0\n"
- "2:\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b"
- : "=r" (__res), "=&S" (__d0), "=&a" (__d1)
- : "0" (0), "1" (__s), "2" (__c),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return __res;
-}
-#endif
-
-
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-/* Find the last occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_rindex 1
-# define rindex(s, c) \
- (__extension__ (__builtin_constant_p (c) \
- ? __strrchr_c ((s), ((c) & 0xff) << 8) \
- : __strrchr_g ((s), (c))))
-#endif
-
-
-/* Return the length of the initial segment of S which
- consists entirely of characters not in REJECT. */
-#define _HAVE_STRING_ARCH_strcspn 1
-#define strcspn(s, reject) \
- (__extension__ (__builtin_constant_p (reject) && sizeof ((reject)[0]) == 1 \
- ? ((reject)[0] == '\0' \
- ? strlen (s) \
- : ((reject)[1] == '\0' \
- ? __strcspn_c1 ((s), (((reject)[0] << 8) & 0xff00)) \
- : __strcspn_cg ((s), (reject), strlen (reject)))) \
- : __strcspn_g ((s), (reject))))
-
-__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
-
-#ifndef _FORCE_INLINES
-__STRING_INLINE size_t
-__strcspn_c1 (const char *__s, int __reject)
-{
- register unsigned long int __d0;
- register char *__res;
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%%al\n\t"
- "leal 1(%0),%0\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n"
- "2:"
- : "=r" (__res), "=&a" (__d0)
- : "0" (__s), "1" (__reject),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return (__res - 1) - __s;
-}
-#endif
-
-__STRING_INLINE size_t __strcspn_cg (const char *__s, const char __reject[],
- size_t __reject_len);
-
-__STRING_INLINE size_t
-__strcspn_cg (const char *__s, const char __reject[], size_t __reject_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "d" (__reject), "g" (__reject_len)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strcspn_g (const char *__s, const char *__reject);
-#ifdef __PIC__
-
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "movl %4,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %4,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "r" (__reject), "0" (__s), "1" (0), "2" (0xffffffff)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-#else
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__reject), "b" (__reject)
- /* Clobber memory, otherwise GCC cannot handle this. */
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-#endif
-
-
-/* Return the length of the initial segment of S which
- consists entirely of characters in ACCEPT. */
-#define _HAVE_STRING_ARCH_strspn 1
-#define strspn(s, accept) \
- (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
- ? ((accept)[0] == '\0' \
- ? ((void) (s), 0) \
- : ((accept)[1] == '\0' \
- ? __strspn_c1 ((s), (((accept)[0] << 8 ) & 0xff00)) \
- : __strspn_cg ((s), (accept), strlen (accept)))) \
- : __strspn_g ((s), (accept))))
-
-#ifndef _FORCE_INLINES
-__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
-
-__STRING_INLINE size_t
-__strspn_c1 (const char *__s, int __accept)
-{
- register unsigned long int __d0;
- register char *__res;
- /* Please note that __accept never can be '\0'. */
- __asm__ __volatile__
- ("1:\n\t"
- "movb (%0),%b1\n\t"
- "leal 1(%0),%0\n\t"
- "cmpb %h1,%b1\n\t"
- "je 1b"
- : "=r" (__res), "=&q" (__d0)
- : "0" (__s), "1" (__accept),
- "m" ( *(struct { char __x[0xfffffff]; } *)__s)
- : "cc");
- return (__res - 1) - __s;
-}
-#endif
-
-__STRING_INLINE size_t __strspn_cg (const char *__s, const char __accept[],
- size_t __accept_len);
-
-__STRING_INLINE size_t
-__strspn_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "g" (__accept), "g" (__accept_len),
- /* Since we do not know how large the memory we access it, use a
- really large amount. */
- "m" ( *(struct { char __x[0xfffffff]; } *)__s),
- "m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
- : "cc");
- return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strspn_g (const char *__s, const char *__accept);
-#ifdef __PIC__
-
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2;
- register const char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-#else
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register const char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "je 1b\n"
- "2:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept), "b" (__accept)
- : "memory", "cc");
- return (__res - 1) - __s;
-}
-#endif
-
-
-/* Find the first occurrence in S of any character in ACCEPT. */
-#define _HAVE_STRING_ARCH_strpbrk 1
-#define strpbrk(s, accept) \
- (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
- ? ((accept)[0] == '\0' \
- ? ((void) (s), (char *) 0) \
- : ((accept)[1] == '\0' \
- ? strchr ((s), (accept)[0]) \
- : __strpbrk_cg ((s), (accept), strlen (accept)))) \
- : __strpbrk_g ((s), (accept))))
-
-__STRING_INLINE char *__strpbrk_cg (const char *__s, const char __accept[],
- size_t __accept_len);
-
-__STRING_INLINE char *
-__strpbrk_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %5,%%edi\n\t"
- "movl %6,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "0" (__s), "d" (__accept), "g" (__accept_len)
- : "memory", "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strpbrk_g (const char *__s, const char *__accept);
-#ifdef __PIC__
-
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("pushl %%ebx\n\t"
- "movl %%edx,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%ebx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:\n\t"
- "popl %%ebx"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
- : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff)
- : "memory", "cc");
- return __res;
-}
-#else
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register char *__res;
- __asm__ __volatile__
- ("movl %%ebx,%%edi\n\t"
- "cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "leal -1(%%ecx),%%edx\n"
- "1:\n\t"
- "lodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne; scasb\n\t"
- "jne 1b\n\t"
- "decl %0\n\t"
- "jmp 3f\n"
- "2:\n\t"
- "xorl %0,%0\n"
- "3:"
- : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&d" (__d2), "=&D" (__d3)
- : "0" (__s), "1" (0), "2" (0xffffffff), "b" (__accept)
- : "memory", "cc");
- return __res;
-}
-#endif
-
-
-/* Find the first occurrence of NEEDLE in HAYSTACK. */
-#define _HAVE_STRING_ARCH_strstr 1
-#define strstr(haystack, needle) \
- (__extension__ (__builtin_constant_p (needle) && sizeof ((needle)[0]) == 1 \
- ? ((needle)[0] == '\0' \
- ? (haystack) \
- : ((needle)[1] == '\0' \
- ? strchr ((haystack), (needle)[0]) \
- : __strstr_cg ((haystack), (needle), \
- strlen (needle)))) \
- : __strstr_g ((haystack), (needle))))
-
-/* Please note that this function need not handle NEEDLEs with a
- length shorter than two. */
-__STRING_INLINE char *__strstr_cg (const char *__haystack,
- const char __needle[],
- size_t __needle_len);
-
-__STRING_INLINE char *
-__strstr_cg (const char *__haystack, const char __needle[],
- size_t __needle_len)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n" \
- "1:\n\t"
- "movl %6,%%edi\n\t"
- "movl %5,%%eax\n\t"
- "movl %4,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t"
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%5\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:"
- : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
- : "g" (__needle_len), "1" (__haystack), "d" (__needle)
- : "memory", "cc");
- return __res;
-}
-
-__STRING_INLINE char *__strstr_g (const char *__haystack,
- const char *__needle);
-#ifdef __PIC__
-
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
- register unsigned long int __d0, __d1, __d2;
- register char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "pushl %%ebx\n\t"
- "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
- "movl %%ecx,%%ebx\n"
- "1:\n\t"
- "movl %%edx,%%edi\n\t"
- "movl %%esi,%%eax\n\t"
- "movl %%ebx,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t" /* also works for empty string, see above */
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%%esi\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:\n\t"
- "popl %%ebx"
- : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
- "d" (__needle)
- : "memory", "cc");
- return __res;
-}
-#else
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
- register unsigned long int __d0, __d1, __d2, __d3;
- register char *__res;
- __asm__ __volatile__
- ("cld\n\t"
- "repne; scasb\n\t"
- "notl %%ecx\n\t"
- "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
- "movl %%ecx,%%edx\n"
- "1:\n\t"
- "movl %%ebx,%%edi\n\t"
- "movl %%esi,%%eax\n\t"
- "movl %%edx,%%ecx\n\t"
- "repe; cmpsb\n\t"
- "je 2f\n\t" /* also works for empty string, see above */
- "cmpb $0,-1(%%esi)\n\t"
- "leal 1(%%eax),%%esi\n\t"
- "jne 1b\n\t"
- "xorl %%eax,%%eax\n"
- "2:"
- : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
- "b" (__needle)
- : "memory", "cc");
- return __res;
-}
-#endif
-
-
-/* Bit find functions. We define only the i686 version since for the other
- processors gcc generates good code. */
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-# ifdef __i686__
-# define _HAVE_STRING_ARCH_ffs 1
-# define ffs(word) (__builtin_constant_p (word) \
- ? __builtin_ffs (word) \
- : ({ int __cnt, __tmp; \
- __asm__ __volatile__ \
- ("bsfl %2,%0\n\t" \
- "cmovel %1,%0" \
- : "=&r" (__cnt), "=r" (__tmp) \
- : "rm" (word), "1" (-1)); \
- __cnt + 1; }))
-
-# ifndef ffsl
-# define ffsl(word) ffs(word)
-# endif
-# endif /* i686 */
-#endif /* BSD || X/Open */
-
-#ifndef _FORCE_INLINES
-# undef __STRING_INLINE
-#endif
-
-#endif /* use string inlines && GNU CC */
diff --git a/sysdeps/x86_64/bits/string.h b/sysdeps/x86/bits/string.h
similarity index 100%
rename from sysdeps/x86_64/bits/string.h
rename to sysdeps/x86/bits/string.h
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b314099ccf98d612ef26afd19bb86ebb6bbc51a8
commit b314099ccf98d612ef26afd19bb86ebb6bbc51a8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:22:23 2012 -0700
Copy i486 bits/string.h to x86_64 bits/string.h
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index 2a55c84..8f8cbaa 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,9 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/i386/i486/bits/string.h: Copy to ...
+ * sysdeps/x86_64/bits/string.h: Here.
+
* sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h: Renamed to ...
* sysdeps/unix/sysv/linux/x86/bits/sigcontext.h: This.
diff --git a/sysdeps/x86_64/bits/string.h b/sysdeps/x86_64/bits/string.h
index 0ca5fe2..e7ee1cc 100644
--- a/sysdeps/x86_64/bits/string.h
+++ b/sysdeps/x86_64/bits/string.h
@@ -1,5 +1,5 @@
-/* Optimized, inlined string functions. AMD x86-64 version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+/* Optimized, inlined string functions. i486/x86-64 version.
+ Copyright (C) 2001-2012 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
@@ -23,3 +23,1962 @@
/* Currently the only purpose of this file is to tell the generic inline
macros that unaligned memory access is possible for x86-64. */
#define _STRING_ARCH_unaligned 1
+
+#if !defined __x86_64__ && (defined __i486__ || defined __pentium__ \
+ || defined __pentiumpro__ || defined __pentium4__ \
+ || defined __nocona__ || defined __atom__ \
+ || defined __core2__ || defined __corei7__ \
+ || defined __k6__ || defined __geode__ \
+ || defined __k8__ || defined __athlon__ \
+ || defined __amdfam10__)
+
+/* We only provide optimizations if the user selects them and if
+ GNU CC is used. */
+# if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
+ && defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__
+
+# ifndef __STRING_INLINE
+# ifndef __extern_inline
+# define __STRING_INLINE inline
+# else
+# define __STRING_INLINE __extern_inline
+# endif
+# endif
+
+/* The macros are used in some of the optimized implementations below. */
+# define __STRING_SMALL_GET16(src, idx) \
+ ((((const unsigned char *) (src))[idx + 1] << 8) \
+ | ((const unsigned char *) (src))[idx])
+# define __STRING_SMALL_GET32(src, idx) \
+ (((((const unsigned char *) (src))[idx + 3] << 8 \
+ | ((const unsigned char *) (src))[idx + 2]) << 8 \
+ | ((const unsigned char *) (src))[idx + 1]) << 8 \
+ | ((const unsigned char *) (src))[idx])
+
+
+/* Copy N bytes of SRC to DEST. */
+# define _HAVE_STRING_ARCH_memcpy 1
+# define memcpy(dest, src, n) \
+ (__extension__ (__builtin_constant_p (n) \
+ ? __memcpy_c ((dest), (src), (n)) \
+ : __memcpy_g ((dest), (src), (n))))
+# define __memcpy_c(dest, src, n) \
+ ((n) == 0 \
+ ? (dest) \
+ : (((n) % 4 == 0) \
+ ? __memcpy_by4 (dest, src, n) \
+ : (((n) % 2 == 0) \
+ ? __memcpy_by2 (dest, src, n) \
+ : __memcpy_g (dest, src, n))))
+
+__STRING_INLINE void *__memcpy_by4 (void *__dest, const void *__src,
+ size_t __n);
+
+__STRING_INLINE void *
+__memcpy_by4 (void *__dest, const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1;
+ register void *__tmp = __dest;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b"
+ : "=&r" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
+ : "1" (__tmp), "2" (__src), "3" (__n / 4)
+ : "memory", "cc");
+ return __dest;
+}
+
+__STRING_INLINE void *__memcpy_by2 (void *__dest, const void *__src,
+ size_t __n);
+
+__STRING_INLINE void *
+__memcpy_by2 (void *__dest, const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1;
+ register void *__tmp = __dest;
+ __asm__ __volatile__
+ ("shrl $1,%3\n\t"
+ "jz 2f\n" /* only a word */
+ "1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b\n"
+ "2:\n\t"
+ "movw (%2),%w0\n\t"
+ "movw %w0,(%1)"
+ : "=&q" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
+ : "1" (__tmp), "2" (__src), "3" (__n / 2)
+ : "memory", "cc");
+ return __dest;
+}
+
+__STRING_INLINE void *__memcpy_g (void *__dest, const void *__src, size_t __n);
+
+__STRING_INLINE void *
+__memcpy_g (void *__dest, const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register void *__tmp = __dest;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "shrl $1,%%ecx\n\t"
+ "jnc 1f\n\t"
+ "movsb\n"
+ "1:\n\t"
+ "shrl $1,%%ecx\n\t"
+ "jnc 2f\n\t"
+ "movsw\n"
+ "2:\n\t"
+ "rep; movsl"
+ : "=&c" (__d0), "=&D" (__d1), "=&S" (__d2),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
+ : "0" (__n), "1" (__tmp), "2" (__src),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__src)
+ : "cc");
+ return __dest;
+}
+
+# define _HAVE_STRING_ARCH_memmove 1
+# ifndef _FORCE_INLINES
+/* Copy N bytes of SRC to DEST, guaranteeing
+ correct behavior for overlapping strings. */
+# define memmove(dest, src, n) __memmove_g (dest, src, n)
+
+__STRING_INLINE void *__memmove_g (void *, const void *, size_t)
+ __asm__ ("memmove");
+
+__STRING_INLINE void *
+__memmove_g (void *__dest, const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register void *__tmp = __dest;
+ if (__dest < __src)
+ __asm__ __volatile__
+ ("cld\n\t"
+ "rep; movsb"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
+ : "0" (__n), "1" (__src), "2" (__tmp),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
+ else
+ __asm__ __volatile__
+ ("std\n\t"
+ "rep; movsb\n\t"
+ "cld"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
+ : "0" (__n), "1" (__n - 1 + (const char *) __src),
+ "2" (__n - 1 + (char *) __tmp),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
+ return __dest;
+}
+# endif
+
+/* Compare N bytes of S1 and S2. */
+# define _HAVE_STRING_ARCH_memcmp 1
+# ifndef _FORCE_INLINES
+# ifndef __PIC__
+/* gcc has problems to spill registers when using PIC. */
+__STRING_INLINE int
+memcmp (const void *__s1, const void *__s2, size_t __n)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register int __res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "testl %3,%3\n\t"
+ "repe; cmpsb\n\t"
+ "je 1f\n\t"
+ "sbbl %0,%0\n\t"
+ "orl $1,%0\n"
+ "1:"
+ : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
+ : "0" (0), "1" (__s1), "2" (__s2), "3" (__n),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
+ : "cc");
+ return __res;
+}
+# endif
+# endif
+
+/* Set N bytes of S to C. */
+# define _HAVE_STRING_ARCH_memset 1
+# define _USE_STRING_ARCH_memset 1
+# define memset(s, c, n) \
+ (__extension__ (__builtin_constant_p (n) && (n) <= 16 \
+ ? ((n) == 1 \
+ ? __memset_c1 ((s), (c)) \
+ : __memset_gc ((s), (c), (n))) \
+ : (__builtin_constant_p (c) \
+ ? (__builtin_constant_p (n) \
+ ? __memset_ccn ((s), (c), (n)) \
+ : memset ((s), (c), (n))) \
+ : (__builtin_constant_p (n) \
+ ? __memset_gcn ((s), (c), (n)) \
+ : memset ((s), (c), (n))))))
+
+# define __memset_c1(s, c) ({ void *__s = (s); \
+ *((unsigned char *) __s) = (unsigned char) (c); \
+ __s; })
+
+# define __memset_gc(s, c, n) \
+ ({ void *__s = (s); \
+ union { \
+ unsigned int __ui; \
+ unsigned short int __usi; \
+ unsigned char __uc; \
+ } *__u = __s; \
+ unsigned int __c = ((unsigned int) ((unsigned char) (c))) * 0x01010101; \
+ \
+ /* We apply a trick here. `gcc' would implement the following \
+ assignments using immediate operands. But this uses to much \
+ memory (7, instead of 4 bytes). So we force the value in a \
+ registers. */ \
+ if ((n) == 3 || (n) >= 5) \
+ __asm__ __volatile__ ("" : "=r" (__c) : "0" (__c)); \
+ \
+ /* This `switch' statement will be removed at compile-time. */ \
+ switch (n) \
+ { \
+ case 15: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 11: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 7: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 3: \
+ __u->__usi = (unsigned short int) __c; \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = (unsigned char) __c; \
+ break; \
+ \
+ case 14: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 10: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 6: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 2: \
+ __u->__usi = (unsigned short int) __c; \
+ break; \
+ \
+ case 13: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 9: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 5: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 1: \
+ __u->__uc = (unsigned char) __c; \
+ break; \
+ \
+ case 16: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 12: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 8: \
+ __u->__ui = __c; \
+ __u = __extension__ ((void *) __u + 4); \
+ case 4: \
+ __u->__ui = __c; \
+ case 0: \
+ break; \
+ } \
+ \
+ __s; })
+
+# define __memset_ccn(s, c, n) \
+ (((n) % 4 == 0) \
+ ? __memset_ccn_by4 (s, ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
+ n) \
+ : (((n) % 2 == 0) \
+ ? __memset_ccn_by2 (s, \
+ ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
+ n) \
+ : memset (s, c, n)))
+
+__STRING_INLINE void *__memset_ccn_by4 (void *__s, unsigned int __c,
+ size_t __n);
+
+__STRING_INLINE void *
+__memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
+{
+ register void *__tmp = __s;
+ register unsigned long int __d0;
+# ifdef __i686__
+ __asm__ __volatile__
+ ("cld\n\t"
+ "rep; stosl"
+ : "=&a" (__c), "=&D" (__tmp), "=&c" (__d0),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+# else
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movl %0,(%1)\n\t"
+ "addl $4,%1\n\t"
+ "decl %2\n\t"
+ "jnz 1b\n"
+ : "=&r" (__c), "=&r" (__tmp), "=&r" (__d0),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+# endif
+ return __s;
+}
+
+__STRING_INLINE void *__memset_ccn_by2 (void *__s, unsigned int __c,
+ size_t __n);
+
+__STRING_INLINE void *
+__memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
+{
+ register unsigned long int __d0, __d1;
+ register void *__tmp = __s;
+# ifdef __i686__
+ __asm__ __volatile__
+ ("cld\n\t"
+ "rep; stosl\n"
+ "stosw"
+ : "=&a" (__d0), "=&D" (__tmp), "=&c" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+# else
+ __asm__ __volatile__
+ ("1:\tmovl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %2\n\t"
+ "jnz 1b\n"
+ "movw %w0,(%1)"
+ : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+#endif
+ return __s;
+}
+
+# define __memset_gcn(s, c, n) \
+ (((n) % 4 == 0) \
+ ? __memset_gcn_by4 (s, c, n) \
+ : (((n) % 2 == 0) \
+ ? __memset_gcn_by2 (s, c, n) \
+ : memset (s, c, n)))
+
+__STRING_INLINE void *__memset_gcn_by4 (void *__s, int __c, size_t __n);
+
+__STRING_INLINE void *
+__memset_gcn_by4 (void *__s, int __c, size_t __n)
+{
+ register void *__tmp = __s;
+ register unsigned long int __d0;
+ __asm__ __volatile__
+ ("movb %b0,%h0\n"
+ "pushw %w0\n\t"
+ "shll $16,%0\n\t"
+ "popw %w0\n"
+ "1:\n\t"
+ "movl %0,(%1)\n\t"
+ "addl $4,%1\n\t"
+ "decl %2\n\t"
+ "jnz 1b\n"
+ : "=&q" (__c), "=&r" (__tmp), "=&r" (__d0),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+ return __s;
+}
+
+__STRING_INLINE void *__memset_gcn_by2 (void *__s, int __c, size_t __n);
+
+__STRING_INLINE void *
+__memset_gcn_by2 (void *__s, int __c, size_t __n)
+{
+ register unsigned long int __d0, __d1;
+ register void *__tmp = __s;
+ __asm__ __volatile__
+ ("movb %b0,%h0\n\t"
+ "pushw %w0\n\t"
+ "shll $16,%0\n\t"
+ "popw %w0\n"
+ "1:\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %2\n\t"
+ "jnz 1b\n"
+ "movw %w0,(%1)"
+ : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
+ : "cc");
+ return __s;
+}
+
+
+/* Search N bytes of S for C. */
+# define _HAVE_STRING_ARCH_memchr 1
+# ifndef _FORCE_INLINES
+__STRING_INLINE void *
+memchr (const void *__s, int __c, size_t __n)
+{
+ register unsigned long int __d0;
+# ifdef __i686__
+ register unsigned long int __d1;
+# endif
+ register unsigned char *__res;
+ if (__n == 0)
+ return NULL;
+# ifdef __i686__
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "cmovne %2,%0"
+ : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
+ : "a" (__c), "0" (__s), "1" (__n), "2" (1),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "cc");
+# else
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "je 1f\n\t"
+ "movl $1,%0\n"
+ "1:"
+ : "=D" (__res), "=&c" (__d0)
+ : "a" (__c), "0" (__s), "1" (__n),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "cc");
+# endif
+ return __res - 1;
+}
+# endif
+
+# define _HAVE_STRING_ARCH_memrchr 1
+# ifndef _FORCE_INLINES
+__STRING_INLINE void *__memrchr (const void *__s, int __c, size_t __n);
+
+__STRING_INLINE void *
+__memrchr (const void *__s, int __c, size_t __n)
+{
+ register unsigned long int __d0;
+# ifdef __i686__
+ register unsigned long int __d1;
+# endif
+ register void *__res;
+ if (__n == 0)
+ return NULL;
+# ifdef __i686__
+ __asm__ __volatile__
+ ("std\n\t"
+ "repne; scasb\n\t"
+ "cmovne %2,%0\n\t"
+ "cld\n\t"
+ "incl %0"
+ : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
+ : "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "cc");
+# else
+ __asm__ __volatile__
+ ("std\n\t"
+ "repne; scasb\n\t"
+ "je 1f\n\t"
+ "orl $-1,%0\n"
+ "1:\tcld\n\t"
+ "incl %0"
+ : "=D" (__res), "=&c" (__d0)
+ : "a" (__c), "0" (__s + __n - 1), "1" (__n),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
+ : "cc");
+# endif
+ return __res;
+}
+# ifdef __USE_GNU
+# define memrchr(s, c, n) __memrchr ((s), (c), (n))
+# endif
+# endif
+
+/* Return pointer to C in S. */
+# define _HAVE_STRING_ARCH_rawmemchr 1
+__STRING_INLINE void *__rawmemchr (const void *__s, int __c);
+
+# ifndef _FORCE_INLINES
+__STRING_INLINE void *
+__rawmemchr (const void *__s, int __c)
+{
+ register unsigned long int __d0;
+ register unsigned char *__res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ : "=D" (__res), "=&c" (__d0)
+ : "a" (__c), "0" (__s), "1" (0xffffffff),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res - 1;
+}
+# ifdef __USE_GNU
+__STRING_INLINE void *
+rawmemchr (const void *__s, int __c)
+{
+ return __rawmemchr (__s, __c);
+}
+# endif /* use GNU */
+# endif
+
+
+/* Return the length of S. */
+# define _HAVE_STRING_ARCH_strlen 1
+# define strlen(str) \
+ (__extension__ (__builtin_constant_p (str) \
+ ? __builtin_strlen (str) \
+ : __strlen_g (str)))
+__STRING_INLINE size_t __strlen_g (const char *__str);
+
+__STRING_INLINE size_t
+__strlen_g (const char *__str)
+{
+ register char __dummy;
+ register const char *__tmp = __str;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%b1\n\t"
+ "leal 1(%0),%0\n\t"
+ "testb %b1,%b1\n\t"
+ "jne 1b"
+ : "=r" (__tmp), "=&q" (__dummy)
+ : "0" (__str),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__str)
+ : "cc" );
+ return __tmp - __str - 1;
+}
+
+
+/* Copy SRC to DEST. */
+# define _HAVE_STRING_ARCH_strcpy 1
+# define strcpy(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \
+ ? __strcpy_a_small ((dest), (src), strlen (src) + 1) \
+ : (char *) memcpy ((char *) (dest), \
+ (const char *) (src), \
+ strlen (src) + 1)) \
+ : __strcpy_g ((dest), (src))))
+
+# define __strcpy_a_small(dest, src, srclen) \
+ (__extension__ ({ char *__dest = (dest); \
+ union { \
+ unsigned int __ui; \
+ unsigned short int __usi; \
+ unsigned char __uc; \
+ char __c; \
+ } *__u = (void *) __dest; \
+ switch (srclen) \
+ { \
+ case 1: \
+ __u->__uc = '\0'; \
+ break; \
+ case 2: \
+ __u->__usi = __STRING_SMALL_GET16 (src, 0); \
+ break; \
+ case 3: \
+ __u->__usi = __STRING_SMALL_GET16 (src, 0); \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = '\0'; \
+ break; \
+ case 4: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ break; \
+ case 5: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__uc = '\0'; \
+ break; \
+ case 6: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__usi = __STRING_SMALL_GET16 (src, 4); \
+ break; \
+ case 7: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__usi = __STRING_SMALL_GET16 (src, 4); \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = '\0'; \
+ break; \
+ case 8: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__ui = __STRING_SMALL_GET32 (src, 4); \
+ break; \
+ } \
+ (char *) __dest; }))
+
+__STRING_INLINE char *__strcpy_g (char *__dest, const char *__src);
+
+__STRING_INLINE char *
+__strcpy_g (char *__dest, const char *__src)
+{
+ register char *__tmp = __dest;
+ register char __dummy;
+ __asm__ __volatile__
+ (
+ "1:\n\t"
+ "movb (%0),%b2\n\t"
+ "leal 1(%0),%0\n\t"
+ "movb %b2,(%1)\n\t"
+ "leal 1(%1),%1\n\t"
+ "testb %b2,%b2\n\t"
+ "jne 1b"
+ : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy),
+ "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
+ : "0" (__src), "1" (__tmp),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__src)
+ : "cc");
+ return __dest;
+}
+
+
+# ifdef __USE_GNU
+# define _HAVE_STRING_ARCH_stpcpy 1
+/* Copy SRC to DEST. */
+# define __stpcpy(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? (strlen (src) + 1 <= 8 \
+ ? __stpcpy_a_small ((dest), (src), strlen (src) + 1) \
+ : __stpcpy_c ((dest), (src), strlen (src) + 1)) \
+ : __stpcpy_g ((dest), (src))))
+# define __stpcpy_c(dest, src, srclen) \
+ ((srclen) % 4 == 0 \
+ ? __mempcpy_by4 (dest, src, srclen) - 1 \
+ : ((srclen) % 2 == 0 \
+ ? __mempcpy_by2 (dest, src, srclen) - 1 \
+ : __mempcpy_byn (dest, src, srclen) - 1))
+
+/* In glibc itself we use this symbol for namespace reasons. */
+# define stpcpy(dest, src) __stpcpy ((dest), (src))
+
+# define __stpcpy_a_small(dest, src, srclen) \
+ (__extension__ ({ union { \
+ unsigned int __ui; \
+ unsigned short int __usi; \
+ unsigned char __uc; \
+ char __c; \
+ } *__u = (void *) (dest); \
+ switch (srclen) \
+ { \
+ case 1: \
+ __u->__uc = '\0'; \
+ break; \
+ case 2: \
+ __u->__usi = __STRING_SMALL_GET16 (src, 0); \
+ __u = __extension__ ((void *) __u + 1); \
+ break; \
+ case 3: \
+ __u->__usi = __STRING_SMALL_GET16 (src, 0); \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = '\0'; \
+ break; \
+ case 4: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 3); \
+ break; \
+ case 5: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__uc = '\0'; \
+ break; \
+ case 6: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__usi = __STRING_SMALL_GET16 (src, 4); \
+ __u = __extension__ ((void *) __u + 1); \
+ break; \
+ case 7: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__usi = __STRING_SMALL_GET16 (src, 4); \
+ __u = __extension__ ((void *) __u + 2); \
+ __u->__uc = '\0'; \
+ break; \
+ case 8: \
+ __u->__ui = __STRING_SMALL_GET32 (src, 0); \
+ __u = __extension__ ((void *) __u + 4); \
+ __u->__ui = __STRING_SMALL_GET32 (src, 4); \
+ __u = __extension__ ((void *) __u + 3); \
+ break; \
+ } \
+ (char *) __u; }))
+
+__STRING_INLINE char *__mempcpy_by4 (char *__dest, const char *__src,
+ size_t __srclen);
+
+__STRING_INLINE char *
+__mempcpy_by4 (char *__dest, const char *__src, size_t __srclen)
+{
+ register char *__tmp = __dest;
+ register unsigned long int __d0, __d1;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b"
+ : "=&r" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1)
+ : "1" (__tmp), "2" (__src), "3" (__srclen / 4)
+ : "memory", "cc");
+ return __tmp;
+}
+
+__STRING_INLINE char *__mempcpy_by2 (char *__dest, const char *__src,
+ size_t __srclen);
+
+__STRING_INLINE char *
+__mempcpy_by2 (char *__dest, const char *__src, size_t __srclen)
+{
+ register char *__tmp = __dest;
+ register unsigned long int __d0, __d1;
+ __asm__ __volatile__
+ ("shrl $1,%3\n\t"
+ "jz 2f\n" /* only a word */
+ "1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b\n"
+ "2:\n\t"
+ "movw (%2),%w0\n\t"
+ "movw %w0,(%1)"
+ : "=&q" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
+ : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ return __tmp + 2;
+}
+
+__STRING_INLINE char *__mempcpy_byn (char *__dest, const char *__src,
+ size_t __srclen);
+
+__STRING_INLINE char *
+__mempcpy_byn (char *__dest, const char *__src, size_t __srclen)
+{
+ register unsigned long __d0, __d1;
+ register char *__tmp = __dest;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "shrl $1,%%ecx\n\t"
+ "jnc 1f\n\t"
+ "movsb\n"
+ "1:\n\t"
+ "shrl $1,%%ecx\n\t"
+ "jnc 2f\n\t"
+ "movsw\n"
+ "2:\n\t"
+ "rep; movsl"
+ : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
+ : "0" (__tmp), "1" (__srclen), "2" (__src),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ return __tmp;
+}
+
+__STRING_INLINE char *__stpcpy_g (char *__dest, const char *__src);
+
+__STRING_INLINE char *
+__stpcpy_g (char *__dest, const char *__src)
+{
+ register char *__tmp = __dest;
+ register char __dummy;
+ __asm__ __volatile__
+ (
+ "1:\n\t"
+ "movb (%0),%b2\n\t"
+ "leal 1(%0),%0\n\t"
+ "movb %b2,(%1)\n\t"
+ "leal 1(%1),%1\n\t"
+ "testb %b2,%b2\n\t"
+ "jne 1b"
+ : "=&r" (__src), "=r" (__tmp), "=&q" (__dummy),
+ "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
+ : "0" (__src), "1" (__tmp),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__src)
+ : "cc");
+ return __tmp - 1;
+}
+# endif
+
+
+/* Copy no more than N characters of SRC to DEST. */
+# define _HAVE_STRING_ARCH_strncpy 1
+# define strncpy(dest, src, n) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? ((strlen (src) + 1 >= ((size_t) (n)) \
+ ? (char *) memcpy ((char *) (dest), \
+ (const char *) (src), n) \
+ : __strncpy_cg ((dest), (src), strlen (src) + 1, n))) \
+ : __strncpy_gg ((dest), (src), n)))
+# define __strncpy_cg(dest, src, srclen, n) \
+ (((srclen) % 4 == 0) \
+ ? __strncpy_by4 (dest, src, srclen, n) \
+ : (((srclen) % 2 == 0) \
+ ? __strncpy_by2 (dest, src, srclen, n) \
+ : __strncpy_byn (dest, src, srclen, n)))
+
+__STRING_INLINE char *__strncpy_by4 (char *__dest, const char __src[],
+ size_t __srclen, size_t __n);
+
+__STRING_INLINE char *
+__strncpy_by4 (char *__dest, const char __src[], size_t __srclen, size_t __n)
+{
+ register char *__tmp = __dest;
+ register int __dummy1, __dummy2;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b"
+ : "=&r" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
+ "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
+ : "1" (__tmp), "2" (__src), "3" (__srclen / 4),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ (void) memset (__tmp, '\0', __n - __srclen);
+ return __dest;
+}
+
+__STRING_INLINE char *__strncpy_by2 (char *__dest, const char __src[],
+ size_t __srclen, size_t __n);
+
+__STRING_INLINE char *
+__strncpy_by2 (char *__dest, const char __src[], size_t __srclen, size_t __n)
+{
+ register char *__tmp = __dest;
+ register int __dummy1, __dummy2;
+ __asm__ __volatile__
+ ("shrl $1,%3\n\t"
+ "jz 2f\n" /* only a word */
+ "1:\n\t"
+ "movl (%2),%0\n\t"
+ "leal 4(%2),%2\n\t"
+ "movl %0,(%1)\n\t"
+ "leal 4(%1),%1\n\t"
+ "decl %3\n\t"
+ "jnz 1b\n"
+ "2:\n\t"
+ "movw (%2),%w0\n\t"
+ "movw %w0,(%1)\n\t"
+ : "=&q" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
+ "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
+ : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ (void) memset (__tmp + 2, '\0', __n - __srclen);
+ return __dest;
+}
+
+__STRING_INLINE char *__strncpy_byn (char *__dest, const char __src[],
+ size_t __srclen, size_t __n);
+
+__STRING_INLINE char *
+__strncpy_byn (char *__dest, const char __src[], size_t __srclen, size_t __n)
+{
+ register unsigned long int __d0, __d1;
+ register char *__tmp = __dest;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "shrl $1,%1\n\t"
+ "jnc 1f\n\t"
+ "movsb\n"
+ "1:\n\t"
+ "shrl $1,%1\n\t"
+ "jnc 2f\n\t"
+ "movsw\n"
+ "2:\n\t"
+ "rep; movsl"
+ : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
+ "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
+ : "1" (__srclen), "0" (__tmp),"2" (__src),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ (void) memset (__tmp, '\0', __n - __srclen);
+ return __dest;
+}
+
+__STRING_INLINE char *__strncpy_gg (char *__dest, const char *__src,
+ size_t __n);
+
+__STRING_INLINE char *
+__strncpy_gg (char *__dest, const char *__src, size_t __n)
+{
+ register char *__tmp = __dest;
+ register char __dummy;
+ if (__n > 0)
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%2\n\t"
+ "incl %0\n\t"
+ "movb %2,(%1)\n\t"
+ "incl %1\n\t"
+ "decl %3\n\t"
+ "je 3f\n\t"
+ "testb %2,%2\n\t"
+ "jne 1b\n\t"
+ "2:\n\t"
+ "movb %2,(%1)\n\t"
+ "incl %1\n\t"
+ "decl %3\n\t"
+ "jne 2b\n\t"
+ "3:"
+ : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy), "=&r" (__n)
+ : "0" (__src), "1" (__tmp), "3" (__n)
+ : "memory", "cc");
+
+ return __dest;
+}
+
+
+/* Append SRC onto DEST. */
+# define _HAVE_STRING_ARCH_strcat 1
+# define strcat(dest, src) \
+ (__extension__ (__builtin_constant_p (src) \
+ ? __strcat_c ((dest), (src), strlen (src) + 1) \
+ : __strcat_g ((dest), (src))))
+
+__STRING_INLINE char *__strcat_c (char *__dest, const char __src[],
+ size_t __srclen);
+
+__STRING_INLINE char *
+__strcat_c (char *__dest, const char __src[], size_t __srclen)
+{
+# ifdef __i686__
+ register unsigned long int __d0;
+ register char *__tmp;
+ __asm__ __volatile__
+ ("repne; scasb"
+ : "=D" (__tmp), "=&c" (__d0),
+ "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
+ : "0" (__dest), "1" (0xffffffff), "a" (0),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+ --__tmp;
+# else
+ register char *__tmp = __dest - 1;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "incl %0\n\t"
+ "cmpb $0,(%0)\n\t"
+ "jne 1b\n"
+ : "=r" (__tmp),
+ "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
+ : "0" (__tmp),
+ "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
+ : "cc");
+# endif
+ (void) memcpy (__tmp, __src, __srclen);
+ return __dest;
+}
+
+__STRING_INLINE char *__strcat_g (char *__dest, const char *__src);
+
+__STRING_INLINE char *
+__strcat_g (char *__dest, const char *__src)
+{
+ register char *__tmp = __dest - 1;
+ register char __dummy;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "incl %1\n\t"
+ "cmpb $0,(%1)\n\t"
+ "jne 1b\n"
+ "2:\n\t"
+ "movb (%2),%b0\n\t"
+ "incl %2\n\t"
+ "movb %b0,(%1)\n\t"
+ "incl %1\n\t"
+ "testb %b0,%b0\n\t"
+ "jne 2b\n"
+ : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src),
+ "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
+ : "1" (__tmp), "2" (__src),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__src)
+ : "memory", "cc");
+ return __dest;
+}
+
+
+/* Append no more than N characters from SRC onto DEST. */
+# define _HAVE_STRING_ARCH_strncat 1
+# define strncat(dest, src, n) \
+ (__extension__ ({ char *__dest = (dest); \
+ __builtin_constant_p (src) && __builtin_constant_p (n) \
+ ? (strlen (src) < ((size_t) (n)) \
+ ? strcat (__dest, (src)) \
+ : (*(char *)__mempcpy (strchr (__dest, '\0'), \
+ (const char *) (src), \
+ (n)) = 0, __dest)) \
+ : __strncat_g (__dest, (src), (n)); }))
+
+__STRING_INLINE char *__strncat_g (char *__dest, const char __src[],
+ size_t __n);
+
+__STRING_INLINE char *
+__strncat_g (char *__dest, const char __src[], size_t __n)
+{
+ register char *__tmp = __dest;
+ register char __dummy;
+# ifdef __i686__
+ __asm__ __volatile__
+ ("repne; scasb\n"
+ "movl %4, %3\n\t"
+ "decl %1\n\t"
+ "1:\n\t"
+ "subl $1,%3\n\t"
+ "jc 2f\n\t"
+ "movb (%2),%b0\n\t"
+ "movsb\n\t"
+ "testb %b0,%b0\n\t"
+ "jne 1b\n\t"
+ "decl %1\n"
+ "2:\n\t"
+ "movb $0,(%1)"
+ : "=&a" (__dummy), "=&D" (__tmp), "=&S" (__src), "=&c" (__n)
+ : "g" (__n), "0" (0), "1" (__tmp), "2" (__src), "3" (0xffffffff)
+ : "memory", "cc");
+# else
+ --__tmp;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "cmpb $0,1(%1)\n\t"
+ "leal 1(%1),%1\n\t"
+ "jne 1b\n"
+ "2:\n\t"
+ "subl $1,%3\n\t"
+ "jc 3f\n\t"
+ "movb (%2),%b0\n\t"
+ "leal 1(%2),%2\n\t"
+ "movb %b0,(%1)\n\t"
+ "leal 1(%1),%1\n\t"
+ "testb %b0,%b0\n\t"
+ "jne 2b\n\t"
+ "decl %1\n"
+ "3:\n\t"
+ "movb $0,(%1)"
+ : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src), "=&r" (__n)
+ : "1" (__tmp), "2" (__src), "3" (__n)
+ : "memory", "cc");
+#endif
+ return __dest;
+}
+
+
+/* Compare S1 and S2. */
+# define _HAVE_STRING_ARCH_strcmp 1
+# define strcmp(s1, s2) \
+ (__extension__ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
+ && (sizeof ((s1)[0]) != 1 || strlen (s1) >= 4) \
+ && (sizeof ((s2)[0]) != 1 || strlen (s2) >= 4) \
+ ? memcmp ((const char *) (s1), (const char *) (s2), \
+ (strlen (s1) < strlen (s2) \
+ ? strlen (s1) : strlen (s2)) + 1) \
+ : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \
+ && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \
+ ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \
+ ? __strcmp_cc ((const unsigned char *) (s1), \
+ (const unsigned char *) (s2), \
+ strlen (s1)) \
+ : __strcmp_cg ((const unsigned char *) (s1), \
+ (const unsigned char *) (s2), \
+ strlen (s1))) \
+ : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \
+ && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \
+ ? (__builtin_constant_p (s1) \
+ ? __strcmp_cc ((const unsigned char *) (s1), \
+ (const unsigned char *) (s2), \
+ strlen (s2)) \
+ : __strcmp_gc ((const unsigned char *) (s1), \
+ (const unsigned char *) (s2), \
+ strlen (s2))) \
+ : __strcmp_gg ((s1), (s2))))))
+
+# define __strcmp_cc(s1, s2, l) \
+ (__extension__ ({ register int __result = (s1)[0] - (s2)[0]; \
+ if (l > 0 && __result == 0) \
+ { \
+ __result = (s1)[1] - (s2)[1]; \
+ if (l > 1 && __result == 0) \
+ { \
+ __result = (s1)[2] - (s2)[2]; \
+ if (l > 2 && __result == 0) \
+ __result = (s1)[3] - (s2)[3]; \
+ } \
+ } \
+ __result; }))
+
+# define __strcmp_cg(s1, s2, l1) \
+ (__extension__ ({ const unsigned char *__s2 = (s2); \
+ register int __result = (s1)[0] - __s2[0]; \
+ if (l1 > 0 && __result == 0) \
+ { \
+ __result = (s1)[1] - __s2[1]; \
+ if (l1 > 1 && __result == 0) \
+ { \
+ __result = (s1)[2] - __s2[2]; \
+ if (l1 > 2 && __result == 0) \
+ __result = (s1)[3] - __s2[3]; \
+ } \
+ } \
+ __result; }))
+
+# define __strcmp_gc(s1, s2, l2) \
+ (__extension__ ({ const unsigned char *__s1 = (s1); \
+ register int __result = __s1[0] - (s2)[0]; \
+ if (l2 > 0 && __result == 0) \
+ { \
+ __result = __s1[1] - (s2)[1]; \
+ if (l2 > 1 && __result == 0) \
+ { \
+ __result = __s1[2] - (s2)[2]; \
+ if (l2 > 2 && __result == 0) \
+ __result = __s1[3] - (s2)[3]; \
+ } \
+ } \
+ __result; }))
+
+__STRING_INLINE int __strcmp_gg (const char *__s1, const char *__s2);
+
+__STRING_INLINE int
+__strcmp_gg (const char *__s1, const char *__s2)
+{
+ register int __res;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%1),%b0\n\t"
+ "leal 1(%1),%1\n\t"
+ "cmpb %b0,(%2)\n\t"
+ "jne 2f\n\t"
+ "leal 1(%2),%2\n\t"
+ "testb %b0,%b0\n\t"
+ "jne 1b\n\t"
+ "xorl %0,%0\n\t"
+ "jmp 3f\n"
+ "2:\n\t"
+ "movl $1,%0\n\t"
+ "jb 3f\n\t"
+ "negl %0\n"
+ "3:"
+ : "=q" (__res), "=&r" (__s1), "=&r" (__s2)
+ : "1" (__s1), "2" (__s2),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s1),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s2)
+ : "cc");
+ return __res;
+}
+
+
+/* Compare N characters of S1 and S2. */
+# define _HAVE_STRING_ARCH_strncmp 1
+# define strncmp(s1, s2, n) \
+ (__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n)) \
+ ? strcmp ((s1), (s2)) \
+ : (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
+ ? strcmp ((s1), (s2)) \
+ : __strncmp_g ((s1), (s2), (n)))))
+
+__STRING_INLINE int __strncmp_g (const char *__s1, const char *__s2,
+ size_t __n);
+
+__STRING_INLINE int
+__strncmp_g (const char *__s1, const char *__s2, size_t __n)
+{
+ register int __res;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "subl $1,%3\n\t"
+ "jc 2f\n\t"
+ "movb (%1),%b0\n\t"
+ "incl %1\n\t"
+ "cmpb %b0,(%2)\n\t"
+ "jne 3f\n\t"
+ "incl %2\n\t"
+ "testb %b0,%b0\n\t"
+ "jne 1b\n"
+ "2:\n\t"
+ "xorl %0,%0\n\t"
+ "jmp 4f\n"
+ "3:\n\t"
+ "movl $1,%0\n\t"
+ "jb 4f\n\t"
+ "negl %0\n"
+ "4:"
+ : "=q" (__res), "=&r" (__s1), "=&r" (__s2), "=&r" (__n)
+ : "1" (__s1), "2" (__s2), "3" (__n),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
+ "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
+ : "cc");
+ return __res;
+}
+
+
+/* Find the first occurrence of C in S. */
+# define _HAVE_STRING_ARCH_strchr 1
+# define _USE_STRING_ARCH_strchr 1
+# define strchr(s, c) \
+ (__extension__ (__builtin_constant_p (c) \
+ ? ((c) == '\0' \
+ ? (char *) __rawmemchr ((s), (c)) \
+ : __strchr_c ((s), ((c) & 0xff) << 8)) \
+ : __strchr_g ((s), (c))))
+
+__STRING_INLINE char *__strchr_c (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strchr_c (const char *__s, int __c)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%%al\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "je 2f\n\t"
+ "leal 1(%0),%0\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b\n\t"
+ "xorl %0,%0\n"
+ "2:"
+ : "=r" (__res), "=&a" (__d0)
+ : "0" (__s), "1" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+
+__STRING_INLINE char *__strchr_g (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strchr_g (const char *__s, int __c)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ __asm__ __volatile__
+ ("movb %%al,%%ah\n"
+ "1:\n\t"
+ "movb (%0),%%al\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "je 2f\n\t"
+ "leal 1(%0),%0\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b\n\t"
+ "xorl %0,%0\n"
+ "2:"
+ : "=r" (__res), "=&a" (__d0)
+ : "0" (__s), "1" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+
+
+/* Find the first occurrence of C in S or the final NUL byte. */
+# define _HAVE_STRING_ARCH_strchrnul 1
+# define __strchrnul(s, c) \
+ (__extension__ (__builtin_constant_p (c) \
+ ? ((c) == '\0' \
+ ? (char *) __rawmemchr ((s), c) \
+ : __strchrnul_c ((s), ((c) & 0xff) << 8)) \
+ : __strchrnul_g ((s), c)))
+
+__STRING_INLINE char *__strchrnul_c (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strchrnul_c (const char *__s, int __c)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%%al\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "je 2f\n\t"
+ "leal 1(%0),%0\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b\n\t"
+ "decl %0\n"
+ "2:"
+ : "=r" (__res), "=&a" (__d0)
+ : "0" (__s), "1" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+
+__STRING_INLINE char *__strchrnul_g (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strchrnul_g (const char *__s, int __c)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ __asm__ __volatile__
+ ("movb %%al,%%ah\n"
+ "1:\n\t"
+ "movb (%0),%%al\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "je 2f\n\t"
+ "leal 1(%0),%0\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b\n\t"
+ "decl %0\n"
+ "2:"
+ : "=r" (__res), "=&a" (__d0)
+ : "0" (__s), "1" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+# ifdef __USE_GNU
+# define strchrnul(s, c) __strchrnul ((s), (c))
+# endif
+
+
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Find the first occurrence of C in S. This is the BSD name. */
+# define _HAVE_STRING_ARCH_index 1
+# define index(s, c) \
+ (__extension__ (__builtin_constant_p (c) \
+ ? __strchr_c ((s), ((c) & 0xff) << 8) \
+ : __strchr_g ((s), (c))))
+# endif
+
+
+/* Find the last occurrence of C in S. */
+# define _HAVE_STRING_ARCH_strrchr 1
+# define strrchr(s, c) \
+ (__extension__ (__builtin_constant_p (c) \
+ ? __strrchr_c ((s), ((c) & 0xff) << 8) \
+ : __strrchr_g ((s), (c))))
+
+# ifdef __i686__
+__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strrchr_c (const char *__s, int __c)
+{
+ register unsigned long int __d0, __d1;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "cmpb %h2,%b2\n\t"
+ "cmove %1,%0\n\t"
+ "testb %b2,%b2\n\t"
+ "jne 1b"
+ : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
+ : "0" (1), "1" (__s), "2" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res - 1;
+}
+
+__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strrchr_g (const char *__s, int __c)
+{
+ register unsigned long int __d0, __d1;
+ register char *__res;
+ __asm__ __volatile__
+ ("movb %b2,%h2\n"
+ "cld\n\t"
+ "1:\n\t"
+ "lodsb\n\t"
+ "cmpb %h2,%b2\n\t"
+ "cmove %1,%0\n\t"
+ "testb %b2,%b2\n\t"
+ "jne 1b"
+ : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
+ : "0" (1), "1" (__s), "2" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res - 1;
+}
+# else
+__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strrchr_c (const char *__s, int __c)
+{
+ register unsigned long int __d0, __d1;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "jne 2f\n\t"
+ "leal -1(%%esi),%0\n"
+ "2:\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b"
+ : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
+ : "0" (0), "1" (__s), "2" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+
+__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
+
+__STRING_INLINE char *
+__strrchr_g (const char *__s, int __c)
+{
+ register unsigned long int __d0, __d1;
+ register char *__res;
+ __asm__ __volatile__
+ ("movb %%al,%%ah\n"
+ "cld\n\t"
+ "1:\n\t"
+ "lodsb\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "jne 2f\n\t"
+ "leal -1(%%esi),%0\n"
+ "2:\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b"
+ : "=r" (__res), "=&S" (__d0), "=&a" (__d1)
+ : "0" (0), "1" (__s), "2" (__c),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return __res;
+}
+# endif
+
+
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Find the last occurrence of C in S. This is the BSD name. */
+# define _HAVE_STRING_ARCH_rindex 1
+# define rindex(s, c) \
+ (__extension__ (__builtin_constant_p (c) \
+ ? __strrchr_c ((s), ((c) & 0xff) << 8) \
+ : __strrchr_g ((s), (c))))
+# endif
+
+
+/* Return the length of the initial segment of S which
+ consists entirely of characters not in REJECT. */
+# define _HAVE_STRING_ARCH_strcspn 1
+# define strcspn(s, reject) \
+ (__extension__ (__builtin_constant_p (reject) && sizeof ((reject)[0]) == 1 \
+ ? ((reject)[0] == '\0' \
+ ? strlen (s) \
+ : ((reject)[1] == '\0' \
+ ? __strcspn_c1 ((s), (((reject)[0] << 8) & 0xff00)) \
+ : __strcspn_cg ((s), (reject), strlen (reject)))) \
+ : __strcspn_g ((s), (reject))))
+
+__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
+
+# ifndef _FORCE_INLINES
+__STRING_INLINE size_t
+__strcspn_c1 (const char *__s, int __reject)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%%al\n\t"
+ "leal 1(%0),%0\n\t"
+ "cmpb %%ah,%%al\n\t"
+ "je 2f\n\t"
+ "testb %%al,%%al\n\t"
+ "jne 1b\n"
+ "2:"
+ : "=r" (__res), "=&a" (__d0)
+ : "0" (__s), "1" (__reject),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return (__res - 1) - __s;
+}
+# endif
+
+__STRING_INLINE size_t __strcspn_cg (const char *__s, const char __reject[],
+ size_t __reject_len);
+
+__STRING_INLINE size_t
+__strcspn_cg (const char *__s, const char __reject[], size_t __reject_len)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register const char *__res;
+ __asm__ __volatile__
+ ("cld\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %5,%%edi\n\t"
+ "movl %6,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n"
+ "2:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "0" (__s), "d" (__reject), "g" (__reject_len)
+ : "memory", "cc");
+ return (__res - 1) - __s;
+}
+
+__STRING_INLINE size_t __strcspn_g (const char *__s, const char *__reject);
+# ifdef __PIC__
+
+__STRING_INLINE size_t
+__strcspn_g (const char *__s, const char *__reject)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register const char *__res;
+ __asm__ __volatile__
+ ("pushl %%ebx\n\t"
+ "movl %4,%%edi\n\t"
+ "cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%ebx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %4,%%edi\n\t"
+ "movl %%ebx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n"
+ "2:\n\t"
+ "popl %%ebx"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "r" (__reject), "0" (__s), "1" (0), "2" (0xffffffff)
+ : "memory", "cc");
+ return (__res - 1) - __s;
+}
+# else
+__STRING_INLINE size_t
+__strcspn_g (const char *__s, const char *__reject)
+{
+ register unsigned long int __d0, __d1, __d2, __d3;
+ register const char *__res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%edx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %%ebx,%%edi\n\t"
+ "movl %%edx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n"
+ "2:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
+ : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__reject), "b" (__reject)
+ /* Clobber memory, otherwise GCC cannot handle this. */
+ : "memory", "cc");
+ return (__res - 1) - __s;
+}
+# endif
+
+
+/* Return the length of the initial segment of S which
+ consists entirely of characters in ACCEPT. */
+# define _HAVE_STRING_ARCH_strspn 1
+# define strspn(s, accept) \
+ (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
+ ? ((accept)[0] == '\0' \
+ ? ((void) (s), 0) \
+ : ((accept)[1] == '\0' \
+ ? __strspn_c1 ((s), (((accept)[0] << 8 ) & 0xff00)) \
+ : __strspn_cg ((s), (accept), strlen (accept)))) \
+ : __strspn_g ((s), (accept))))
+
+# ifndef _FORCE_INLINES
+__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
+
+__STRING_INLINE size_t
+__strspn_c1 (const char *__s, int __accept)
+{
+ register unsigned long int __d0;
+ register char *__res;
+ /* Please note that __accept never can be '\0'. */
+ __asm__ __volatile__
+ ("1:\n\t"
+ "movb (%0),%b1\n\t"
+ "leal 1(%0),%0\n\t"
+ "cmpb %h1,%b1\n\t"
+ "je 1b"
+ : "=r" (__res), "=&q" (__d0)
+ : "0" (__s), "1" (__accept),
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s)
+ : "cc");
+ return (__res - 1) - __s;
+}
+# endif
+
+__STRING_INLINE size_t __strspn_cg (const char *__s, const char __accept[],
+ size_t __accept_len);
+
+__STRING_INLINE size_t
+__strspn_cg (const char *__s, const char __accept[], size_t __accept_len)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register const char *__res;
+ __asm__ __volatile__
+ ("cld\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %5,%%edi\n\t"
+ "movl %6,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "je 1b\n"
+ "2:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "0" (__s), "g" (__accept), "g" (__accept_len),
+ /* Since we do not know how large the memory we access it, use a
+ really large amount. */
+ "m" ( *(struct { char __x[0xfffffff]; } *)__s),
+ "m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
+ : "cc");
+ return (__res - 1) - __s;
+}
+
+__STRING_INLINE size_t __strspn_g (const char *__s, const char *__accept);
+# ifdef __PIC__
+
+__STRING_INLINE size_t
+__strspn_g (const char *__s, const char *__accept)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register const char *__res;
+ __asm__ __volatile__
+ ("pushl %%ebx\n\t"
+ "cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%ebx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %%edx,%%edi\n\t"
+ "movl %%ebx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "je 1b\n"
+ "2:\n\t"
+ "popl %%ebx"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept)
+ : "memory", "cc");
+ return (__res - 1) - __s;
+}
+# else
+__STRING_INLINE size_t
+__strspn_g (const char *__s, const char *__accept)
+{
+ register unsigned long int __d0, __d1, __d2, __d3;
+ register const char *__res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%edx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %%ebx,%%edi\n\t"
+ "movl %%edx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "je 1b\n"
+ "2:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
+ : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept), "b" (__accept)
+ : "memory", "cc");
+ return (__res - 1) - __s;
+}
+# endif
+
+
+/* Find the first occurrence in S of any character in ACCEPT. */
+# define _HAVE_STRING_ARCH_strpbrk 1
+# define strpbrk(s, accept) \
+ (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
+ ? ((accept)[0] == '\0' \
+ ? ((void) (s), (char *) 0) \
+ : ((accept)[1] == '\0' \
+ ? strchr ((s), (accept)[0]) \
+ : __strpbrk_cg ((s), (accept), strlen (accept)))) \
+ : __strpbrk_g ((s), (accept))))
+
+__STRING_INLINE char *__strpbrk_cg (const char *__s, const char __accept[],
+ size_t __accept_len);
+
+__STRING_INLINE char *
+__strpbrk_cg (const char *__s, const char __accept[], size_t __accept_len)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %5,%%edi\n\t"
+ "movl %6,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n\t"
+ "decl %0\n\t"
+ "jmp 3f\n"
+ "2:\n\t"
+ "xorl %0,%0\n"
+ "3:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "0" (__s), "d" (__accept), "g" (__accept_len)
+ : "memory", "cc");
+ return __res;
+}
+
+__STRING_INLINE char *__strpbrk_g (const char *__s, const char *__accept);
+# ifdef __PIC__
+
+__STRING_INLINE char *
+__strpbrk_g (const char *__s, const char *__accept)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register char *__res;
+ __asm__ __volatile__
+ ("pushl %%ebx\n\t"
+ "movl %%edx,%%edi\n\t"
+ "cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%ebx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %%edx,%%edi\n\t"
+ "movl %%ebx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n\t"
+ "decl %0\n\t"
+ "jmp 3f\n"
+ "2:\n\t"
+ "xorl %0,%0\n"
+ "3:\n\t"
+ "popl %%ebx"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
+ : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff)
+ : "memory", "cc");
+ return __res;
+}
+# else
+__STRING_INLINE char *
+__strpbrk_g (const char *__s, const char *__accept)
+{
+ register unsigned long int __d0, __d1, __d2, __d3;
+ register char *__res;
+ __asm__ __volatile__
+ ("movl %%ebx,%%edi\n\t"
+ "cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "leal -1(%%ecx),%%edx\n"
+ "1:\n\t"
+ "lodsb\n\t"
+ "testb %%al,%%al\n\t"
+ "je 2f\n\t"
+ "movl %%ebx,%%edi\n\t"
+ "movl %%edx,%%ecx\n\t"
+ "repne; scasb\n\t"
+ "jne 1b\n\t"
+ "decl %0\n\t"
+ "jmp 3f\n"
+ "2:\n\t"
+ "xorl %0,%0\n"
+ "3:"
+ : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&d" (__d2), "=&D" (__d3)
+ : "0" (__s), "1" (0), "2" (0xffffffff), "b" (__accept)
+ : "memory", "cc");
+ return __res;
+}
+# endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+# define _HAVE_STRING_ARCH_strstr 1
+# define strstr(haystack, needle) \
+ (__extension__ (__builtin_constant_p (needle) && sizeof ((needle)[0]) == 1 \
+ ? ((needle)[0] == '\0' \
+ ? (haystack) \
+ : ((needle)[1] == '\0' \
+ ? strchr ((haystack), (needle)[0]) \
+ : __strstr_cg ((haystack), (needle), \
+ strlen (needle)))) \
+ : __strstr_g ((haystack), (needle))))
+
+/* Please note that this function need not handle NEEDLEs with a
+ length shorter than two. */
+__STRING_INLINE char *__strstr_cg (const char *__haystack,
+ const char __needle[],
+ size_t __needle_len);
+
+__STRING_INLINE char *
+__strstr_cg (const char *__haystack, const char __needle[],
+ size_t __needle_len)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n" \
+ "1:\n\t"
+ "movl %6,%%edi\n\t"
+ "movl %5,%%eax\n\t"
+ "movl %4,%%ecx\n\t"
+ "repe; cmpsb\n\t"
+ "je 2f\n\t"
+ "cmpb $0,-1(%%esi)\n\t"
+ "leal 1(%%eax),%5\n\t"
+ "jne 1b\n\t"
+ "xorl %%eax,%%eax\n"
+ "2:"
+ : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
+ : "g" (__needle_len), "1" (__haystack), "d" (__needle)
+ : "memory", "cc");
+ return __res;
+}
+
+__STRING_INLINE char *__strstr_g (const char *__haystack,
+ const char *__needle);
+# ifdef __PIC__
+
+__STRING_INLINE char *
+__strstr_g (const char *__haystack, const char *__needle)
+{
+ register unsigned long int __d0, __d1, __d2;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "pushl %%ebx\n\t"
+ "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
+ "movl %%ecx,%%ebx\n"
+ "1:\n\t"
+ "movl %%edx,%%edi\n\t"
+ "movl %%esi,%%eax\n\t"
+ "movl %%ebx,%%ecx\n\t"
+ "repe; cmpsb\n\t"
+ "je 2f\n\t" /* also works for empty string, see above */
+ "cmpb $0,-1(%%esi)\n\t"
+ "leal 1(%%eax),%%esi\n\t"
+ "jne 1b\n\t"
+ "xorl %%eax,%%eax\n"
+ "2:\n\t"
+ "popl %%ebx"
+ : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
+ : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
+ "d" (__needle)
+ : "memory", "cc");
+ return __res;
+}
+# else
+__STRING_INLINE char *
+__strstr_g (const char *__haystack, const char *__needle)
+{
+ register unsigned long int __d0, __d1, __d2, __d3;
+ register char *__res;
+ __asm__ __volatile__
+ ("cld\n\t"
+ "repne; scasb\n\t"
+ "notl %%ecx\n\t"
+ "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */
+ "movl %%ecx,%%edx\n"
+ "1:\n\t"
+ "movl %%ebx,%%edi\n\t"
+ "movl %%esi,%%eax\n\t"
+ "movl %%edx,%%ecx\n\t"
+ "repe; cmpsb\n\t"
+ "je 2f\n\t" /* also works for empty string, see above */
+ "cmpb $0,-1(%%esi)\n\t"
+ "leal 1(%%eax),%%esi\n\t"
+ "jne 1b\n\t"
+ "xorl %%eax,%%eax\n"
+ "2:"
+ : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2), "=&d" (__d3)
+ : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
+ "b" (__needle)
+ : "memory", "cc");
+ return __res;
+}
+# endif
+
+
+/* Bit find functions. We define only the i686 version since for the other
+ processors gcc generates good code. */
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# ifdef __i686__
+# define _HAVE_STRING_ARCH_ffs 1
+# define ffs(word) (__builtin_constant_p (word) \
+ ? __builtin_ffs (word) \
+ : ({ int __cnt, __tmp; \
+ __asm__ __volatile__ \
+ ("bsfl %2,%0\n\t" \
+ "cmovel %1,%0" \
+ : "=&r" (__cnt), "=r" (__tmp) \
+ : "rm" (word), "1" (-1)); \
+ __cnt + 1; }))
+
+# ifndef ffsl
+# define ffsl(word) ffs(word)
+# endif
+# endif /* i686 */
+# endif /* BSD || X/Open */
+
+# ifndef _FORCE_INLINES
+# undef __STRING_INLINE
+# endif
+
+# endif /* use string inlines && GNU CC */
+
+#endif
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e50542e225d9089e7c941747d9f30ad7cc5c3c79
commit e50542e225d9089e7c941747d9f30ad7cc5c3c79
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:21:23 2012 -0700
Use x86_64 bits/sigcontext.h for i386 and x86_64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index cc423c8..2a55c84 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,9 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h: This.
+
* sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (FP_XSTATE_MAGIC1):
New macro from Linux kernel 3.4.0.
(FP_XSTATE_MAGIC2): Likewise.
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
rename to sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ce642617f9aa48ed2324b460fba2d2ae09379b92
commit ce642617f9aa48ed2324b460fba2d2ae09379b92
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:19:59 2012 -0700
Update x86_64 bits/sigcontext.h from kernel 3.4.0
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index e1a3d36..cc423c8 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,6 +1,16 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (FP_XSTATE_MAGIC1):
+ New macro from Linux kernel 3.4.0.
+ (FP_XSTATE_MAGIC2): Likewise.
+ (FP_XSTATE_MAGIC2_SIZE): Likewise.
+ (X86_FXSR_MAGIC): New macro from Linux i386 kernel.
+ (struct _fpx_sw_bytes): New struct.
+ (struct _xsave_hdr): Likewise.
+ (struct _ymmh_state): Likewise.
+ (struct _xstate): Likewise.
+
* sysdeps/unix/sysv/linux/i386/sys/debugreg.h: Removed.
* sysdeps/unix/sysv/linux/i386/sys/reg.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Renamed to ...
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
index d9ba716..06f36cb 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
@@ -22,6 +22,19 @@
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
+#define FP_XSTATE_MAGIC1 0x46505853U
+#define FP_XSTATE_MAGIC2 0x46505845U
+#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
+
+struct _fpx_sw_bytes
+{
+ __uint32_t magic1;
+ __uint32_t extended_size;
+ __uint64_t xstate_bv;
+ __uint32_t xstate_size;
+ __uint32_t padding[7];
+};
+
struct _fpreg
{
unsigned short significand[4];
@@ -75,6 +88,8 @@ struct _fpstate
# define sigcontext_struct sigcontext
#endif
+#define X86_FXSR_MAGIC 0x0000
+
struct sigcontext
{
unsigned short gs, __gsh;
@@ -157,4 +172,23 @@ struct sigcontext
#endif /* __x86_64__ */
+struct _xsave_hdr
+{
+ __uint64_t xstate_bv;
+ __uint64_t reserved1[2];
+ __uint64_t reserved2[5];
+};
+
+struct _ymmh_state
+{
+ __uint32_t ymmh_space[64];
+};
+
+struct _xstate
+{
+ struct _fpstate fpstate;
+ struct _xsave_hdr xstate_hdr;
+ struct _ymmh_state ymmh;
+};
+
#endif /* _BITS_SIGCONTEXT_H */
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=eb699a284af2d7c96e7e06296bcc8a2120355144
commit eb699a284af2d7c96e7e06296bcc8a2120355144
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:18:47 2012 -0700
Use x86_64 bits/{debugreg,reg}.h for i386 and x86-64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index bdd8971..e1a3d36 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,5 +1,13 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
+ [BZ #14117]
+ * sysdeps/unix/sysv/linux/i386/sys/debugreg.h: Removed.
+ * sysdeps/unix/sysv/linux/i386/sys/reg.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/debugreg.h: This.
+ * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/reg.h: This.
+
[BZ #14050]
[BZ #14117]
* sysdeps/i386/fpu/bits/mathinline.h: Merged with ...
diff --git a/sysdeps/unix/sysv/linux/i386/sys/debugreg.h b/sysdeps/unix/sysv/linux/i386/sys/debugreg.h
deleted file mode 100644
index ac1926b..0000000
--- a/sysdeps/unix/sysv/linux/i386/sys/debugreg.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright (C) 1998, 2000 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_DEBUGREG_H
-#define _SYS_DEBUGREG_H 1
-
-/* Indicate the register numbers for a number of the specific
- debug registers. Registers 0-3 contain the addresses we wish to trap on */
-#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
-#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
-
-#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
-#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
-
-/* Define a few things for the status register. We can use this to determine
- which debugging register was responsible for the trap. The other bits
- are either reserved or not of interest to us. */
-
-#define DR_TRAP0 (0x1) /* db0 */
-#define DR_TRAP1 (0x2) /* db1 */
-#define DR_TRAP2 (0x4) /* db2 */
-#define DR_TRAP3 (0x8) /* db3 */
-
-#define DR_STEP (0x4000) /* single-step */
-#define DR_SWITCH (0x8000) /* task switch */
-
-/* Now define a bunch of things for manipulating the control register.
- The top two bytes of the control register consist of 4 fields of 4
- bits - each field corresponds to one of the four debug registers,
- and indicates what types of access we trap on, and how large the data
- field is that we are looking at */
-
-#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
-#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
-
-#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
-#define DR_RW_WRITE (0x1)
-#define DR_RW_READ (0x3)
-
-#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
-#define DR_LEN_2 (0x4)
-#define DR_LEN_4 (0xC)
-
-/* The low byte to the control register determine which registers are
- enabled. There are 4 fields of two bits. One bit is "local", meaning
- that the processor will reset the bit after a task switch and the other
- is global meaning that we have to explicitly reset the bit. With linux,
- you can use either one, since we explicitly zero the register when we enter
- kernel mode. */
-
-#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
-#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
-#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
-
-#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
-#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
-
-/* The second byte to the control register has a few special things.
-
- On the i386, you should set the DR_LOCAL_SLOWDOWN or
- DR_GLOBAL_SLOWDOWN bits if you want to know exactly which
- instruction triggered the watchpoint. Setting these bits causes
- the processor to run more slowly, but leaving them clear makes it
- treat watchpoint hits as imprecise exceptions, so you can't
- reliably determine which instruction caused the hit.
-
- The i486 and all later IA-32 processors ignore DR_LOCAL_SLOWDOWN
- and DR_GLOBAL_SLOWDOWN. They always report the exception
- precisely, except in some rare cases, which the user can't do
- anything about. */
-
-#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
-#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
-#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
-
-#endif /* sys/debugreg.h */
diff --git a/sysdeps/unix/sysv/linux/i386/sys/reg.h b/sysdeps/unix/sysv/linux/i386/sys/reg.h
deleted file mode 100644
index b993f99..0000000
--- a/sysdeps/unix/sysv/linux/i386/sys/reg.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (C) 1998 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_REG_H
-#define _SYS_REG_H 1
-
-/* Index into an array of 4 byte integers returned from ptrace for
- * location of the users' stored general purpose registers. */
-
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS 13
-#define EFL 14
-#define UESP 15
-#define SS 16
-
-#endif /* _SYS_REG_H */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h b/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
rename to sysdeps/unix/sysv/linux/x86/sys/debugreg.h
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/reg.h b/sysdeps/unix/sysv/linux/x86/sys/reg.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/sys/reg.h
rename to sysdeps/unix/sysv/linux/x86/sys/reg.h
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a9e932588e8054db3505ff3bdf90e6c8262825d1
commit a9e932588e8054db3505ff3bdf90e6c8262825d1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:17:07 2012 -0700
Merge i386 bits/mathinline.h with x86_64 bits/mathinline.h
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index 26ccfb6..bdd8971 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,5 +1,10 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
+ [BZ #14050]
+ [BZ #14117]
+ * sysdeps/i386/fpu/bits/mathinline.h: Merged with ...
+ * sysdeps/x86_64/fpu/bits/mathinline.h: This.
+
[BZ #14117]
* sysdeps/unix/sysv/linux/i386/sys/io.h: Removed.
* sysdeps/unix/sysv/linux/x86_64/sys/io.h: Renamed to ...
diff --git a/sysdeps/x86_64/fpu/bits/mathinline.h b/sysdeps/x86_64/fpu/bits/mathinline.h
index 7cfe688..7919d1e 100644
--- a/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
-/* Inline math functions for x86-64.
- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+/* Inline math functions for i387 and SSE.
+ Copyright (C) 1995-2012 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
@@ -27,35 +27,125 @@
#endif
+#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+/* GCC 2.97 and up have builtins that actually can be used. */
+# if !__GNUC_PREREQ (2,97)
+/* ISO C99 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. */
+# undef isgreater
+# undef isgreaterequal
+# undef isless
+# undef islessequal
+# undef islessgreater
+# undef isunordered
+# ifdef __i686__
+/* For the PentiumPro and more recent processors we can provide
+ better code. */
+# define isgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; seta %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# define isgreaterequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setae %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isless(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; seta %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
+ __result; })
+
+# define islessequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setae %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \
+ __result; })
+
+# define islessgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setne %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isunordered(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip %%st(1), %%st; setp %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# else
+/* This is the dumb, portable code for i386 and above. */
+# define isgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isgreaterequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isless(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define islessequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define islessgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+
+# define isunordered(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucompp; fnstsw; sahf; setp %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+ __result; })
+# endif /* __i686__ */
+# endif /* GCC 2.97 */
+
/* 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_PREREQ (2, 8) && defined __USE_ISOC99
+# if __GNUC_PREREQ (2, 8) && defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Test for negative number. Used in the signbit() macro. */
__MATH_INLINE int
__NTH (__signbitf (float __x))
{
-# ifndef __x86_64__
+# ifndef __x86_64__
__extension__ union { float __f; int __i; } __u = { __f: __x };
return __u.__i < 0;
-# else
+# else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x8;
-# endif
+# endif
}
__MATH_INLINE int
__NTH (__signbit (double __x))
{
-# ifndef __x86_64__
+# ifndef __x86_64__
__extension__ union { double __d; int __i[2]; } __u = { __d: __x };
return __u.__i[1] < 0;
-# else
+# else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x80;
-# endif
+# endif
}
__MATH_INLINE int
__NTH (__signbitl (long double __x))
@@ -65,19 +155,23 @@ __NTH (__signbitl (long double __x))
}
__END_NAMESPACE_C99
+# endif
#endif
-#if __GNUC_PREREQ (2, 8) && !__GNUC_PREREQ (3, 4) \
- && !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_PREREQ (2, 8)
+# if !__GNUC_PREREQ (3, 4) && !defined __NO_MATH_INLINES \
+ && defined __OPTIMIZE__
/* GCC 3.4 introduced builtins for all functions below, so
there's no need to define any of these inline functions. */
-# ifdef __USE_ISOC99
+# ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Round to nearest integer. */
-# ifdef __SSE_MATH__
+# ifdef __SSE_MATH__
__MATH_INLINE long int
__NTH (lrintf (float __x))
{
@@ -89,8 +183,8 @@ __NTH (lrintf (float __x))
__asm __volatile__ ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
return __res;
}
-# endif
-# ifdef __SSE2_MATH__
+# endif
+# ifdef __SSE2_MATH__
__MATH_INLINE long int
__NTH (lrint (double __x))
{
@@ -102,8 +196,8 @@ __NTH (lrint (double __x))
__asm __volatile__ ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
return __res;
}
-# endif
-# ifdef __x86_64__
+# endif
+# ifdef __x86_64__
__MATH_INLINE long long int
__NTH (llrintf (float __x))
{
@@ -126,68 +220,68 @@ __NTH (llrint (double __x))
__asm __volatile__ ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
return __res;
}
-# endif
+# endif
-# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 \
- && defined __SSE2_MATH__
+# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 \
+ && defined __SSE2_MATH__
/* Determine maximum of two values. */
__MATH_INLINE float
__NTH (fmaxf (float __x, float __y))
{
-# ifdef __AVX__
+# ifdef __AVX__
float __res;
__asm ("vmaxss %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
return __res;
-# else
+# else
__asm ("maxss %1, %0" : "+x" (__x) : "xm" (__y));
return __x;
-# endif
+# endif
}
__MATH_INLINE double
__NTH (fmax (double __x, double __y))
{
-# ifdef __AVX__
+# ifdef __AVX__
float __res;
__asm ("vmaxsd %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
return __res;
-# else
+# else
__asm ("maxsd %1, %0" : "+x" (__x) : "xm" (__y));
return __x;
-# endif
+# endif
}
/* Determine minimum of two values. */
__MATH_INLINE float
__NTH (fminf (float __x, float __y))
{
-# ifdef __AVX__
+# ifdef __AVX__
float __res;
__asm ("vminss %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
return __res;
-# else
+# else
__asm ("minss %1, %0" : "+x" (__x) : "xm" (__y));
return __x;
-# endif
+# endif
}
__MATH_INLINE double
__NTH (fmin (double __x, double __y))
{
-# ifdef __AVX__
+# ifdef __AVX__
float __res;
__asm ("vminsd %2, %1, %0" : "=x" (__res) : "x" (x), "xm" (__y));
return __res;
-# else
+# else
__asm ("minsd %1, %0" : "+x" (__x) : "xm" (__y));
return __x;
-# endif
+# endif
}
-# endif
+# endif
__END_NAMESPACE_C99
-# endif
+# endif
-# if defined __SSE4_1__ && defined __SSE2_MATH__
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+# if defined __SSE4_1__ && defined __SSE2_MATH__
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Round to nearest integer. */
@@ -214,7 +308,7 @@ __NTH (rintf (float __x))
return __res;
}
-# ifdef __USE_ISOC99
+# ifdef __USE_ISOC99
/* Round to nearest integer without raising inexact exception. */
__MATH_INLINE double
__NTH (nearbyint (double __x))
@@ -238,10 +332,10 @@ __NTH (nearbyintf (float __x))
__asm __volatile__ ("roundss $0xc, %1, %0" : "=x" (__res) : "xm" (__x));
return __res;
}
-# endif
+# endif
__END_NAMESPACE_C99
-# endif
+# endif
__BEGIN_NAMESPACE_STD
/* Smallest integral value not less than X. */
@@ -284,6 +378,590 @@ __NTH (floorf (float __x))
return __res;
}
__END_NAMESPACE_C99
+# endif
# endif
-#endif
+# if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+ && !defined __SSE_MATH__ && defined __OPTIMIZE__)
+/* Not used by SSE math. */
+
+/* The inline functions do not set errno or raise necessarily the
+ correct exceptions. */
+# undef math_errhandling
+
+/* A macro to define float, double, and long double versions of various
+ math functions for the ix87 FPU. FUNC is the function name (which will
+ be suffixed with f and l for the float and long double version,
+ respectively). OP is the name of the FPU operation.
+ We define two sets of macros. The set with the additional NP
+ doesn't add a prototype declaration. */
+
+# if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathop(func, op) \
+ __inline_mathop_ (double, func, op) \
+ __inline_mathop_ (float, __CONCAT(func,f), op) \
+ __inline_mathop_ (long double, __CONCAT(func,l), op)
+# define __inline_mathopNP(func, op) \
+ __inline_mathopNP_ (double, func, op) \
+ __inline_mathopNP_ (float, __CONCAT(func,f), op) \
+ __inline_mathopNP_ (long double, __CONCAT(func,l), op)
+# else
+# define __inline_mathop(func, op) \
+ __inline_mathop_ (double, func, op)
+# define __inline_mathopNP(func, op) \
+ __inline_mathopNP_ (double, func, op)
+# endif
+
+# define __inline_mathop_(float_type, func, op) \
+ __inline_mathop_decl_ (float_type, func, op, "0" (__x))
+# define __inline_mathopNP_(float_type, func, op) \
+ __inline_mathop_declNP_ (float_type, func, op, "0" (__x))
+
+
+# if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathop_decl(func, op, params...) \
+ __inline_mathop_decl_ (double, func, op, params) \
+ __inline_mathop_decl_ (float, __CONCAT(func,f), op, params) \
+ __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params)
+# define __inline_mathop_declNP(func, op, params...) \
+ __inline_mathop_declNP_ (double, func, op, params) \
+ __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params) \
+ __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params)
+# else
+# define __inline_mathop_decl(func, op, params...) \
+ __inline_mathop_decl_ (double, func, op, params)
+# define __inline_mathop_declNP(func, op, params...) \
+ __inline_mathop_declNP_ (double, func, op, params)
+# endif
+
+# define __inline_mathop_decl_(float_type, func, op, params...) \
+ __MATH_INLINE float_type func (float_type) __THROW; \
+ __inline_mathop_declNP_ (float_type, func, op, params)
+
+# define __inline_mathop_declNP_(float_type, func, op, params...) \
+ __MATH_INLINE float_type __NTH (func (float_type __x)) \
+ { \
+ register float_type __result; \
+ __asm __volatile__ (op : "=t" (__result) : params); \
+ return __result; \
+ }
+
+
+# if defined __USE_MISC || defined __USE_ISOC99
+# define __inline_mathcode(func, arg, code) \
+ __inline_mathcode_ (double, func, arg, code) \
+ __inline_mathcode_ (float, __CONCAT(func,f), arg, code) \
+ __inline_mathcode_ (long double, __CONCAT(func,l), arg, code)
+# define __inline_mathcodeNP(func, arg, code) \
+ __inline_mathcodeNP_ (double, func, arg, code) \
+ __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code) \
+ __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+ __inline_mathcode2_ (double, func, arg1, arg2, code) \
+ __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code) \
+ __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code)
+# define __inline_mathcodeNP2(func, arg1, arg2, code) \
+ __inline_mathcodeNP2_ (double, func, arg1, arg2, code) \
+ __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code) \
+ __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
+# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
+ __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) \
+ __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \
+ __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
+# else
+# define __inline_mathcode(func, arg, code) \
+ __inline_mathcode_ (double, func, (arg), code)
+# define __inline_mathcodeNP(func, arg, code) \
+ __inline_mathcodeNP_ (double, func, (arg), code)
+# define __inline_mathcode2(func, arg1, arg2, code) \
+ __inline_mathcode2_ (double, func, arg1, arg2, code)
+# define __inline_mathcodeNP2(func, arg1, arg2, code) \
+ __inline_mathcodeNP2_ (double, func, arg1, arg2, code)
+# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
+ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)
+# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
+ __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)
+# endif
+
+# define __inline_mathcode_(float_type, func, arg, code) \
+ __MATH_INLINE float_type func (float_type) __THROW; \
+ __inline_mathcodeNP_(float_type, func, arg, code)
+
+# define __inline_mathcodeNP_(float_type, func, arg, code) \
+ __MATH_INLINE float_type __NTH (func (float_type arg)) \
+ { \
+ code; \
+ }
+
+
+# define __inline_mathcode2_(float_type, func, arg1, arg2, code) \
+ __MATH_INLINE float_type func (float_type, float_type) __THROW; \
+ __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code)
+
+# define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \
+ __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2)) \
+ { \
+ code; \
+ }
+
+# define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \
+ __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \
+ __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code)
+
+# define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \
+ __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2, \
+ float_type arg3)) \
+ { \
+ code; \
+ }
+# endif
+
+
+# if !defined __SSE_MATH__ && !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* Miscellaneous functions. Not used by SSE math. */
+
+/* __FAST_MATH__ is defined by gcc -ffast-math. */
+# ifdef __FAST_MATH__
+# ifdef __USE_GNU
+# define __sincos_code \
+ register long double __cosr; \
+ register long double __sinr; \
+ register unsigned int __swtmp; \
+ __asm __volatile__ \
+ ("fsincos\n\t" \
+ "fnstsw %w2\n\t" \
+ "testl $0x400, %2\n\t" \
+ "jz 1f\n\t" \
+ "fldpi\n\t" \
+ "fadd %%st(0)\n\t" \
+ "fxch %%st(1)\n\t" \
+ "2: fprem1\n\t" \
+ "fnstsw %w2\n\t" \
+ "testl $0x400, %2\n\t" \
+ "jnz 2b\n\t" \
+ "fstp %%st(1)\n\t" \
+ "fsincos\n\t" \
+ "1:" \
+ : "=t" (__cosr), "=u" (__sinr), "=a" (__swtmp) : "0" (__x)); \
+ *__sinx = __sinr; \
+ *__cosx = __cosr
+
+__MATH_INLINE void
+__NTH (__sincos (double __x, double *__sinx, double *__cosx))
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void
+__NTH (__sincosf (float __x, float *__sinx, float *__cosx))
+{
+ __sincos_code;
+}
+
+__MATH_INLINE void
+__NTH (__sincosl (long double __x, long double *__sinx, long double *__cosx))
+{
+ __sincos_code;
+}
+# endif
+
+
+/* Optimized inline implementation, sometimes with reduced precision
+ and/or argument range. */
+
+# if __GNUC_PREREQ (3, 5)
+# define __expm1_code \
+ register long double __temp; \
+ __temp = __builtin_expm1l (__x); \
+ return __temp ? __temp : __x
+# else
+# define __expm1_code \
+ register long double __value; \
+ register long double __exponent; \
+ register long double __temp; \
+ __asm __volatile__ \
+ ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" \
+ "fmul %%st(1) # x * log2(e)\n\t" \
+ "fst %%st(1)\n\t" \
+ "frndint # int(x * log2(e))\n\t" \
+ "fxch\n\t" \
+ "fsub %%st(1) # fract(x * log2(e))\n\t" \
+ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
+ "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \
+ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
+ __asm __volatile__ \
+ ("fscale # 2^int(x * log2(e))\n\t" \
+ : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \
+ __temp -= 1.0; \
+ __temp += __value; \
+ return __temp ? __temp : __x
+# endif
+__inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
+
+# if __GNUC_PREREQ (3, 4)
+__inline_mathcodeNP_ (long double, __expl, __x, return __builtin_expl (__x))
+# else
+# define __exp_code \
+ register long double __value; \
+ register long double __exponent; \
+ __asm __volatile__ \
+ ("fldl2e # e^x = 2^(x * log2(e))\n\t" \
+ "fmul %%st(1) # x * log2(e)\n\t" \
+ "fst %%st(1)\n\t" \
+ "frndint # int(x * log2(e))\n\t" \
+ "fxch\n\t" \
+ "fsub %%st(1) # fract(x * log2(e))\n\t" \
+ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \
+ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
+ __value += 1.0; \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (__value), "u" (__exponent)); \
+ return __value
+__inline_mathcodeNP (exp, __x, __exp_code)
+__inline_mathcodeNP_ (long double, __expl, __x, __exp_code)
+# endif
+
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP (tan, __x, \
+ register long double __value; \
+ register long double __value2 __attribute__ ((__unused__)); \
+ __asm __volatile__ \
+ ("fptan" \
+ : "=t" (__value2), "=u" (__value) : "0" (__x)); \
+ return __value)
+# endif
+# endif /* __FAST_MATH__ */
+
+
+# if __GNUC_PREREQ (3, 4)
+__inline_mathcodeNP2_ (long double, __atan2l, __y, __x,
+ return __builtin_atan2l (__y, __x))
+# else
+# define __atan2_code \
+ register long double __value; \
+ __asm __volatile__ \
+ ("fpatan" \
+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); \
+ return __value
+# ifdef __FAST_MATH__
+__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
+# endif
+__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)
+# endif
+
+
+# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP2 (fmod, __x, __y, \
+ register long double __value; \
+ __asm __volatile__ \
+ ("1: fprem\n\t" \
+ "fnstsw %%ax\n\t" \
+ "sahf\n\t" \
+ "jp 1b" \
+ : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); \
+ return __value)
+# endif
+
+
+# ifdef __FAST_MATH__
+# if !__GNUC_PREREQ (3,3)
+__inline_mathopNP (sqrt, "fsqrt")
+__inline_mathopNP_ (long double, __sqrtl, "fsqrt")
+# define __libc_sqrtl(n) __sqrtl (n)
+# else
+# define __libc_sqrtl(n) __builtin_sqrtl (n)
+# endif
+# endif
+
+# if __GNUC_PREREQ (2, 8)
+__inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x))
+# if defined __USE_MISC || defined __USE_ISOC99
+__inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x))
+__inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x))
+# endif
+__inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x))
+# else
+__inline_mathop (fabs, "fabs")
+__inline_mathop_ (long double, __fabsl, "fabs")
+# endif
+
+# ifdef __FAST_MATH__
+# if !__GNUC_PREREQ (3, 4)
+/* The argument range of this inline version is reduced. */
+__inline_mathopNP (sin, "fsin")
+/* The argument range of this inline version is reduced. */
+__inline_mathopNP (cos, "fcos")
+
+__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
+# endif
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")
+
+__inline_mathcodeNP (asin, __x, return __atan2l (__x, __libc_sqrtl (1.0 - __x * __x)))
+__inline_mathcodeNP (acos, __x, return __atan2l (__libc_sqrtl (1.0 - __x * __x), __x))
+# endif
+
+# if !__GNUC_PREREQ (3, 4)
+__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")
+# endif
+# endif /* __FAST_MATH__ */
+
+__inline_mathcode_ (long double, __sgn1l, __x, \
+ __extension__ union { long double __xld; unsigned int __xi[3]; } __n = \
+ { __xld: __x }; \
+ __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; \
+ __n.__xi[1] = 0x80000000; \
+ __n.__xi[0] = 0; \
+ return __n.__xld)
+
+
+# ifdef __FAST_MATH__
+/* The argument range of the inline version of sinhl is slightly reduced. */
+__inline_mathcodeNP (sinh, __x, \
+ register long double __exm1 = __expm1l (__fabsl (__x)); \
+ return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x))
+
+__inline_mathcodeNP (cosh, __x, \
+ register long double __ex = __expl (__x); \
+ return 0.5 * (__ex + 1.0 / __ex))
+
+__inline_mathcodeNP (tanh, __x, \
+ register long double __exm1 = __expm1l (-__fabsl (__x + __x)); \
+ return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
+# endif
+
+__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)); \
+ 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)); \
+ return __value)
+
+# ifdef __FAST_MATH__
+# define __ldexp_code \
+ register long double __value; \
+ __asm __volatile__ \
+ ("fscale" \
+ : "=t" (__value) : "0" (__x), "u" ((long double) __y)); \
+ return __value
+
+__MATH_INLINE double
+__NTH (ldexp (double __x, int __y))
+{
+ __ldexp_code;
+}
+# endif
+
+
+/* Optimized versions for some non-standardized functions. */
+# if defined __USE_ISOC99 || defined __USE_MISC
+
+# ifdef __FAST_MATH__
+__inline_mathcodeNP (expm1, __x, __expm1_code)
+
+/* We cannot rely on M_SQRT being defined. So we do it for ourself
+ here. */
+# define __M_SQRT2 1.41421356237309504880L /* sqrt(2) */
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP (log1p, __x, \
+ register long double __value; \
+ if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2) \
+ __value = logl (1.0 + __x); \
+ else \
+ __asm __volatile__ \
+ ("fldln2\n\t" \
+ "fxch\n\t" \
+ "fyl2xp1" \
+ : "=t" (__value) : "0" (__x) : "st(1)"); \
+ return __value)
+# endif
+
+
+/* The argument range of the inline version of asinhl is slightly reduced. */
+__inline_mathcodeNP (asinh, __x, \
+ register long double __y = __fabsl (__x); \
+ return (log1pl (__y * __y / (__libc_sqrtl (__y * __y + 1.0) + 1.0) + __y) \
+ * __sgn1l (__x)))
+
+__inline_mathcodeNP (acosh, __x, \
+ return logl (__x + __libc_sqrtl (__x - 1.0) * __libc_sqrtl (__x + 1.0)))
+
+__inline_mathcodeNP (atanh, __x, \
+ register long double __y = __fabsl (__x); \
+ return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x))
+
+/* The argument range of the inline version of hypotl is slightly reduced. */
+__inline_mathcodeNP2 (hypot, __x, __y,
+ return __libc_sqrtl (__x * __x + __y * __y))
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP(logb, __x, \
+ register long double __value; \
+ register long double __junk; \
+ __asm __volatile__ \
+ ("fxtract\n\t" \
+ : "=t" (__junk), "=u" (__value) : "0" (__x)); \
+ return __value)
+# endif
+
+# endif
+# endif
+
+# ifdef __USE_ISOC99
+# ifdef __FAST_MATH__
+
+# if !__GNUC_PREREQ (3, 5)
+__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)")
+# endif
+
+__MATH_INLINE float
+__NTH (ldexpf (float __x, int __y))
+{
+ __ldexp_code;
+}
+
+__MATH_INLINE long double
+__NTH (ldexpl (long double __x, int __y))
+{
+ __ldexp_code;
+}
+
+__inline_mathopNP (rint, "frndint")
+# endif /* __FAST_MATH__ */
+
+# define __lrint_code \
+ long int __lrintres; \
+ __asm__ __volatile__ \
+ ("fistpl %0" \
+ : "=m" (__lrintres) : "t" (__x) : "st"); \
+ return __lrintres
+__MATH_INLINE long int
+__NTH (lrintf (float __x))
+{
+ __lrint_code;
+}
+__MATH_INLINE long int
+__NTH (lrint (double __x))
+{
+ __lrint_code;
+}
+__MATH_INLINE long int
+__NTH (lrintl (long double __x))
+{
+ __lrint_code;
+}
+# undef __lrint_code
+
+# define __llrint_code \
+ long long int __llrintres; \
+ __asm__ __volatile__ \
+ ("fistpll %0" \
+ : "=m" (__llrintres) : "t" (__x) : "st"); \
+ return __llrintres
+__MATH_INLINE long long int
+__NTH (llrintf (float __x))
+{
+ __llrint_code;
+}
+__MATH_INLINE long long int
+__NTH (llrint (double __x))
+{
+ __llrint_code;
+}
+__MATH_INLINE long long int
+__NTH (llrintl (long double __x))
+{
+ __llrint_code;
+}
+# undef __llrint_code
+
+# endif
+
+
+# ifdef __USE_MISC
+
+# if defined __FAST_MATH__ && !__GNUC_PREREQ (3, 5)
+__inline_mathcodeNP2 (drem, __x, __y, \
+ register double __value; \
+ register int __clobbered; \
+ __asm __volatile__ \
+ ("1: fprem1\n\t" \
+ "fstsw %%ax\n\t" \
+ "sahf\n\t" \
+ "jp 1b" \
+ : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); \
+ return __value)
+# endif
+
+
+/* This function is used in the `isfinite' macro. */
+__MATH_INLINE int
+__NTH (__finite (double __x))
+{
+ return (__extension__
+ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
+ | 0x800fffffu) + 1) >> 31));
+}
+
+# endif /* __USE_MISC */
+
+/* Undefine some of the large macros which are not used anymore. */
+# undef __atan2_code
+# ifdef __FAST_MATH__
+# undef __expm1_code
+# undef __exp_code
+# undef __sincos_code
+# endif /* __FAST_MATH__ */
+
+# endif /* __NO_MATH_INLINES */
+
+
+/* This code is used internally in the GNU libc. Not used by SSE math. */
+# if !defined __SSE_MATH__ && defined __LIBC_INTERNAL_MATH_INLINES
+__inline_mathop (__ieee754_sqrt, "fsqrt")
+__inline_mathcode2 (__ieee754_atan2, __y, __x,
+ register long double __value;
+ __asm __volatile__ ("fpatan\n\t"
+ : "=t" (__value)
+ : "0" (__x), "u" (__y) : "st(1)");
+ return __value;)
+# endif
+
+#endif /* __GNUC__ */
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e0fee8ab4cb0f78cdc322e9a9adec8eeefc7d1f3
commit e0fee8ab4cb0f78cdc322e9a9adec8eeefc7d1f3
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:14:17 2012 -0700
Use x86_64 bits/{io,perm}.h for i386 and x86_64
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
index ffac67e..26ccfb6 100644
--- a/ChangeLog.pr14117
+++ b/ChangeLog.pr14117
@@ -1,5 +1,12 @@
2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
+ * sysdeps/unix/sysv/linux/i386/sys/io.h: Removed.
+ * sysdeps/unix/sysv/linux/x86_64/sys/io.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/io.h: This.
+ * sysdeps/unix/sysv/linux/i386/sys/perm.h: Removed.
+ * sysdeps/unix/sysv/linux/x86_64/sys/perm.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/perm.h: This.
+
* sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
__SSE_MATH__.
diff --git a/sysdeps/unix/sysv/linux/i386/sys/io.h b/sysdeps/unix/sysv/linux/i386/sys/io.h
deleted file mode 100644
index 3ddcee7..0000000
--- a/sysdeps/unix/sysv/linux/i386/sys/io.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Copyright (C) 1996, 2000, 2009 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IO_H
-#define _SYS_IO_H 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-/* If TURN_ON is TRUE, request for permission to do direct i/o on the
- port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
- permission off for that range. This call requires root privileges.
-
- Portability note: not all Linux platforms support this call. Most
- platforms based on the PC I/O architecture probably will, however.
- E.g., Linux/Alpha for Alpha PCs supports this. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
-
-/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to
- access any I/O port is granted. This call requires root
- privileges. */
-extern int iopl (int __level) __THROW;
-
-#if defined __GNUC__ && __GNUC__ >= 2
-
-static __inline unsigned char
-inb (unsigned short int __port)
-{
- unsigned char _v;
-
- __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned char
-inb_p (unsigned short int __port)
-{
- unsigned char _v;
-
- __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned short int
-inw (unsigned short int __port)
-{
- unsigned short _v;
-
- __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned short int
-inw_p (unsigned short int __port)
-{
- unsigned short int _v;
-
- __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned int
-inl (unsigned short int __port)
-{
- unsigned int _v;
-
- __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned int
-inl_p (unsigned short int __port)
-{
- unsigned int _v;
- __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v)
- :"Nd" (__port));
- return _v;
-}
-
-static __inline void
-outb (unsigned char value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (__port));
-}
-
-static __inline void
-outb_p (unsigned char value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-outw (unsigned short int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (__port));
-
-}
-
-static __inline void
-outw_p (unsigned short int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-outl (unsigned int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (__port));
-}
-
-static __inline void
-outl_p (unsigned int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-insb (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insb":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-insw (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-insl (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insl":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsb (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsw (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsl (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-#endif /* GNU C */
-
-__END_DECLS
-#endif /* _SYS_IO_H */
diff --git a/sysdeps/unix/sysv/linux/i386/sys/perm.h b/sysdeps/unix/sysv/linux/i386/sys/perm.h
deleted file mode 100644
index c268681..0000000
--- a/sysdeps/unix/sysv/linux/i386/sys/perm.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1996, 1999 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_PERM_H
-
-#define _SYS_PERM_H 1
-#include <features.h>
-
-__BEGIN_DECLS
-
-/* Set port input/output permissions. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
-
-
-/* Change I/O privilege level. */
-extern int iopl (int __level) __THROW;
-
-__END_DECLS
-
-#endif /* _SYS_PERM_H */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/io.h b/sysdeps/unix/sysv/linux/x86/sys/io.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/sys/io.h
rename to sysdeps/unix/sysv/linux/x86/sys/io.h
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/perm.h b/sysdeps/unix/sysv/linux/x86/sys/perm.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/sys/perm.h
rename to sysdeps/unix/sysv/linux/x86/sys/perm.h
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5d94c271639c19b013a4fe6eab54aa8e95d1a12d
commit 5d94c271639c19b013a4fe6eab54aa8e95d1a12d
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 1 15:13:01 2012 -0700
Check __SSE_MATH__ in feraiseexcept
diff --git a/ChangeLog.pr14117 b/ChangeLog.pr14117
new file mode 100644
index 0000000..ffac67e
--- /dev/null
+++ b/ChangeLog.pr14117
@@ -0,0 +1,5 @@
+2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14117]
+ * sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
+ __SSE_MATH__.
diff --git a/sysdeps/x86_64/fpu/bits/fenv.h b/sysdeps/x86_64/fpu/bits/fenv.h
index bb790c9..b2c01c4 100644
--- a/sysdeps/x86_64/fpu/bits/fenv.h
+++ b/sysdeps/x86_64/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2001,2004,2011,2012 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 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
@@ -109,7 +109,12 @@ __NTH (feraiseexcept (int __excepts))
/* One example of a invalid operation is 0.0 / 0.0. */
float __f = 0.0;
+# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
+# else
+ __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
+ : "=t" (__f) : "0" (__f));
+# endif
(void) &__f;
}
if ((FE_DIVBYZERO & __excepts) != 0)
@@ -117,7 +122,12 @@ __NTH (feraiseexcept (int __excepts))
float __f = 1.0;
float __g = 0.0;
+# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
+# else
+ __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
+ : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
+# endif
(void) &__f;
}
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources