[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r16273 - in /fsf/trunk/libc: ./ math/bits/ stdio-common/ sysdeps/powerpc/ sysdeps/powerpc/powerpc32/power7/ sysdeps/powerpc/...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r16273 - in /fsf/trunk/libc: ./ math/bits/ stdio-common/ sysdeps/powerpc/ sysdeps/powerpc/powerpc32/power7/ sysdeps/powerpc/...
- From: eglibc@xxxxxxxxxx
- Date: Mon, 19 Dec 2011 00:02:26 -0000
Author: eglibc
Date: Mon Dec 19 00:02:24 2011
New Revision: 16273
Log:
Import glibc-mainline for 2011-12-19
Added:
fsf/trunk/libc/sysdeps/powerpc/locale-defines.sym
fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/Makefile
fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/math/bits/math-finite.h
fsf/trunk/libc/stdio-common/vfprintf.c
fsf/trunk/libc/sysdeps/powerpc/Makefile
fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/Makefile
fsf/trunk/libc/time/tzfile.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Dec 19 00:02:24 2011
@@ -1,3 +1,32 @@
+2011-12-17 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #13446]
+ * stdio-common/vfprintf.c (vfprintf): Fix extension of specs array.
+
+2011-11-22 Adhemerval Zanella <azanella@xxxxxxxxxxxxxxxxxx>
+
+ * sysdeps/powerpc/Makefile: Added locale-defines.sym generation.
+ * sysdeps/powerpc/locale-defines.sym: Locale definitions for strcasecmp
+ optimized code.
+ * sysdeps/powerpc/powerpc32/power7/Makefile: New file.
+ * sysdeps/powerpc/powerpc32/power7/strcasecmp.S: New file.
+ * sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S: New file.
+ * sysdeps/powerpc/powerpc64/power7/Makefile: Added unroll-loop option
+ for strncasecmp/strncasecmp_l compilation.
+ * sysdeps/powerpc/powerpc64/power7/strcasecmp.S: New file.
+ * sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S: New file.
+
+2011-12-08 Marek Polacek <mpolacek@xxxxxxxxxx>
+
+ [BZ #13484]
+ * math/bits/math-finite.h: Use __REDIRECT_NTH and __NTH instead
+ of __asm__.
+
+2011-12-17 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #13506]
+ * time/tzfile.c (__tzfile_read): Check values from file header.
+
2011-11-21 Will Schmidt <will_schmidt@xxxxxxxxxxxx>
* powerpc/powerpc32/sysdep.h: Define SETUP_GOT_ACCESS() macro.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Mon Dec 19 00:02:24 2011
@@ -12,7 +12,8 @@
6779, 6783, 9696, 10103, 10709, 11589, 12403, 12847, 12868, 12852, 12874,
12885, 12892, 12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090,
13092, 13114, 13118, 13123, 13134, 13138, 13147, 13150, 13179, 13192,
- 13268, 13276, 13291, 13335, 13337, 13344, 13358, 13367
+ 13268, 13276, 13291, 13335, 13337, 13344, 13358, 13367, 13446, 13472,
+ 13484, 13506
* New program pldd to list loaded object of a process
Implemented by Ulrich Drepper.
@@ -61,7 +62,8 @@
* Optimized strcasecmp and strncasecmp for SSSE3 and SSE4.2 on x86-32.
Implemented by Ulrich Drepper.
-* Optimized nearbyint for PPC. Implemented by Adhemerval Zanella.
+* Optimized nearbyint and strcasecmp for PPC.
+ Implemented by Adhemerval Zanella.
Version 2.14
Modified: fsf/trunk/libc/math/bits/math-finite.h
==============================================================================
--- fsf/trunk/libc/math/bits/math-finite.h (original)
+++ fsf/trunk/libc/math/bits/math-finite.h Mon Dec 19 00:02:24 2011
@@ -22,155 +22,159 @@
#endif
/* acos. */
-extern double acos (double) __asm__ ("__acos_finite");
-extern float acosf (float) __asm__ ("__acosf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double acosl (long double) __asm__ ("__acosl_finite");
+extern double __REDIRECT_NTH (acos, (double), __acos_finite);
+extern float __REDIRECT_NTH (acosf, (float), __acosf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
/* acosh. */
-extern double acosh (double) __asm__ ("__acosh_finite");
-extern float acoshf (float) __asm__ ("__acoshf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double acoshl (long double) __asm__ ("__acoshl_finite");
+extern double __REDIRECT_NTH (acosh, (double), __acosh_finite);
+extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
# endif
#endif
/* asin. */
-extern double asin (double) __asm__ ("__asin_finite");
-extern float asinf (float) __asm__ ("__asinf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double asinl (long double) __asm__ ("__asinl_finite");
+extern double __REDIRECT_NTH (asin, (double), __asin_finite);
+extern float __REDIRECT_NTH (asinf, (float), __asinf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite);
#endif
/* atan2. */
-extern double atan2 (double, double) __asm__ ("__atan2_finite");
-extern float atan2f (float, float) __asm__ ("__atan2f_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double atan2l (long double, long double) __asm__ ("__atan2l_finite");
+extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite);
+extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (atan2l, (long double, long double),
+ __atan2l_finite);
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
/* atanh. */
-extern double atanh (double) __asm__ ("__atanh_finite");
-extern float atanhf (float) __asm__ ("__atanhf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double atanhl (long double) __asm__ ("__atanhl_finite");
+extern double __REDIRECT_NTH (atanh, (double), __atanh_finite);
+extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
# endif
#endif
/* cosh. */
-extern double cosh (double) __asm__ ("__cosh_finite");
-extern float coshf (float) __asm__ ("__coshf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double coshl (long double) __asm__ ("__coshl_finite");
+extern double __REDIRECT_NTH (cosh, (double), __cosh_finite);
+extern float __REDIRECT_NTH (coshf, (float), __coshf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite);
#endif
/* exp. */
-extern double exp (double) __asm__ ("__exp_finite");
-extern float expf (float) __asm__ ("__expf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double expl (long double) __asm__ ("__expl_finite");
+extern double __REDIRECT_NTH (exp, (double), __exp_finite);
+extern float __REDIRECT_NTH (expf, (float), __expf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
#endif
#ifdef __USE_GNU
/* exp10. */
-extern double exp10 (double) __asm__ ("__exp10_finite");
-extern float exp10f (float) __asm__ ("__exp10f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double exp10l (long double) __asm__ ("__exp10l_finite");
+extern double __REDIRECT_NTH (exp10, (double), __exp10_finite);
+extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite);
# endif
/* pow10. */
-extern double pow10 (double) __asm__ ("__exp10_finite");
-extern float pow10f (float) __asm__ ("__exp10f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double pow10l (long double) __asm__ ("__exp10l_finite");
+extern double __REDIRECT_NTH (pow10, (double), __exp10_finite);
+extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite);
# endif
#endif
#ifdef __USE_ISOC99
/* exp2. */
-extern double exp2 (double) __asm__ ("__exp2_finite");
-extern float exp2f (float) __asm__ ("__exp2f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double exp2l (long double) __asm__ ("__exp2l_finite");
+extern double __REDIRECT_NTH (exp2, (double), __exp2_finite);
+extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
# endif
#endif
/* fmod. */
-extern double fmod (double, double) __asm__ ("__fmod_finite");
-extern float fmodf (float, float) __asm__ ("__fmodf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double fmodl (long double, long double) __asm__ ("__fmodl_finite");
+extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite);
+extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (fmodl, (long double, long double),
+ __fmodl_finite);
#endif
#ifdef __USE_ISOC99
/* hypot. */
-extern double hypot (double, double) __asm__ ("__hypot_finite");
-extern float hypotf (float, float) __asm__ ("__hypotf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double hypotl (long double, long double) __asm__ ("__hypotl_finite");
+extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite);
+extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (hypotl, (long double, long double),
+ __hypotl_finite);
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN
/* j0. */
-extern double j0 (double) __asm__ ("__j0_finite");
-extern float j0f (float) __asm__ ("__j0f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double j0l (long double) __asm__ ("__j0l_finite");
+extern double __REDIRECT_NTH (j0, (double), __j0_finite);
+extern float __REDIRECT_NTH (j0f, (float), __j0f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite);
# endif
/* y0. */
-extern double y0 (double) __asm__ ("__y0_finite");
-extern float y0f (float) __asm__ ("__y0f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double y0l (long double) __asm__ ("__y0l_finite");
+extern double __REDIRECT_NTH (y0, (double), __y0_finite);
+extern float __REDIRECT_NTH (y0f, (float), __y0f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite);
# endif
/* j1. */
-extern double j1 (double) __asm__ ("__j1_finite");
-extern float j1f (float) __asm__ ("__j1f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double j1l (long double) __asm__ ("__j1l_finite");
+extern double __REDIRECT_NTH (j1, (double), __j1_finite);
+extern float __REDIRECT_NTH (j1f, (float), __j1f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite);
# endif
/* y1. */
-extern double y1 (double) __asm__ ("__y1_finite");
-extern float y1f (float) __asm__ ("__y1f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double y1l (long double) __asm__ ("__y1l_finite");
+extern double __REDIRECT_NTH (y1, (double), __y1_finite);
+extern float __REDIRECT_NTH (y1f, (float), __y1f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite);
# endif
/* jn. */
-extern double jn (int, double) __asm__ ("__jn_finite");
-extern float jnf (int, float) __asm__ ("__jnf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double jnl (int, long double) __asm__ ("__jnl_finite");
+extern double __REDIRECT_NTH (jn, (int, double), __jn_finite);
+extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite);
# endif
/* yn. */
-extern double yn (int, double) __asm__ ("__yn_finite");
-extern float ynf (int, float) __asm__ ("__ynf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double ynl (int, long double) __asm__ ("__ynl_finite");
+extern double __REDIRECT_NTH (yn, (int, double), __yn_finite);
+extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
# endif
#endif
#ifdef __USE_MISC
/* lgamma_r. */
-extern double lgamma_r (double, int *) __asm__ ("__lgamma_r_finite");
-extern float lgammaf_r (float, int *) __asm__ ("__lgammaf_r_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double lgammal_r (long double, int *) __asm__ ("__lgammal_r_finite");
+extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite);
+extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
+ __lgammal_r_finite);
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
/* lgamma. */
-__extern_always_inline double lgamma (double __d)
+__extern_always_inline double __NTH (lgamma (double __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -179,7 +183,7 @@
return lgamma_r (__d, &signgam);
# endif
}
-__extern_always_inline float lgammaf (float __d)
+__extern_always_inline float __NTH (lgammaf (float __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -189,7 +193,7 @@
# endif
}
# ifdef __MATH_DECLARE_LDOUBLE
-__extern_always_inline long double lgammal (long double __d)
+__extern_always_inline long double __NTH (lgammal (long double __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -203,7 +207,7 @@
#if defined __USE_MISC || defined __USE_XOPEN
/* gamma. */
-__extern_always_inline double gamma (double __d)
+__extern_always_inline double __NTH (gamma (double __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -212,7 +216,7 @@
return lgamma_r (__d, &signgam);
# endif
}
-__extern_always_inline float gammaf (float __d)
+__extern_always_inline float __NTH (gammaf (float __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -222,7 +226,7 @@
# endif
}
# ifdef __MATH_DECLARE_LDOUBLE
-__extern_always_inline long double gammal (long double __d)
+__extern_always_inline long double __NTH (gammal (long double __d))
{
# ifdef __USE_ISOC99
int __local_signgam = 0;
@@ -235,76 +239,79 @@
#endif
/* log. */
-extern double log (double) __asm__ ("__log_finite");
-extern float logf (float) __asm__ ("__logf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double logl (long double) __asm__ ("__logl_finite");
+extern double __REDIRECT_NTH (log, (double), __log_finite);
+extern float __REDIRECT_NTH (logf, (float), __logf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (logl, (long double), __logl_finite);
#endif
/* log10. */
-extern double log10 (double) __asm__ ("__log10_finite");
-extern float log10f (float) __asm__ ("__log10f_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double log10l (long double) __asm__ ("__log10l_finite");
+extern double __REDIRECT_NTH (log10, (double), __log10_finite);
+extern float __REDIRECT_NTH (log10f, (float), __log10f_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
#endif
#ifdef __USE_ISOC99
/* log2. */
-extern double log2 (double) __asm__ ("__log2_finite");
-extern float log2f (float) __asm__ ("__log2f_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double log2l (long double) __asm__ ("__log2l_finite");
+extern double __REDIRECT_NTH (log2, (double), __log2_finite);
+extern float __REDIRECT_NTH (log2f, (float), __log2f_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite);
# endif
#endif
/* pow. */
-extern double pow (double, double) __asm__ ("__pow_finite");
-extern float powf (float, float) __asm__ ("__powf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double powl (long double, long double) __asm__ ("__powl_finite");
+extern double __REDIRECT_NTH (pow, (double, double), __pow_finite);
+extern float __REDIRECT_NTH (powf, (float, float), __powf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (powl, (long double, long double),
+ __powl_finite);
#endif
/* remainder. */
-extern double remainder (double, double) __asm__ ("__remainder_finite");
-extern float remainderf (float, float) __asm__ ("__remainderf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double remainderl (long double, long double) __asm__ ("__remainderl_finite");
+extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite);
+extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (remainderl, (long double, long double),
+ __remainderl_finite);
#endif
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
/* scalb. */
-extern double scalb (double, double) __asm__ ("__scalb_finite");
-extern float scalbf (float, float) __asm__ ("__scalbf_finite");
-# ifdef __MATH_DECLARE_LDOUBLE
-extern long double scalbl (long double, long double) __asm__ ("__scalbl_finite");
+extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite);
+extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite);
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (scalbl, (long double, long double),
+ __scalbl_finite);
# endif
#endif
/* sinh. */
-extern double sinh (double) __asm__ ("__sinh_finite");
-extern float sinhf (float) __asm__ ("__sinhf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double sinhl (long double) __asm__ ("__sinhl_finite");
+extern double __REDIRECT_NTH (sinh, (double), __sinh_finite);
+extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite);
#endif
/* sqrt. */
-extern double sqrt (double) __asm__ ("__sqrt_finite");
-extern float sqrtf (float) __asm__ ("__sqrtf_finite");
-#ifdef __MATH_DECLARE_LDOUBLE
-extern long double sqrtl (long double) __asm__ ("__sqrtl_finite");
+extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite);
+extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite);
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite);
#endif
#ifdef __USE_ISOC99
/* tgamma. */
extern double __gamma_r_finite (double, int *);
-__extern_always_inline double tgamma (double __d)
+__extern_always_inline double __NTH (tgamma (double __d))
{
int __local_signgam = 0;
double __res = __gamma_r_finite (__d, &__local_signgam);
return __local_signgam < 0 ? -__res : __res;
}
extern float __gammaf_r_finite (float, int *);
-__extern_always_inline float tgammaf (float __d)
+__extern_always_inline float __NTH (tgammaf (float __d))
{
int __local_signgam = 0;
float __res = __gammaf_r_finite (__d, &__local_signgam);
@@ -312,7 +319,7 @@
}
# ifdef __MATH_DECLARE_LDOUBLE
extern long double __gammal_r_finite (long double, int *);
-__extern_always_inline long double tgammal (long double __d)
+__extern_always_inline long double __NTH (tgammal (long double __d))
{
int __local_signgam = 0;
long double __res = __gammal_r_finite (__d, &__local_signgam);
Modified: fsf/trunk/libc/stdio-common/vfprintf.c
==============================================================================
--- fsf/trunk/libc/stdio-common/vfprintf.c (original)
+++ fsf/trunk/libc/stdio-common/vfprintf.c Mon Dec 19 00:02:24 2011
@@ -1640,9 +1640,9 @@
/* Array with information about the needed arguments. This has to
be dynamically extensible. */
size_t nspecs = 0;
- size_t nspecs_max = 32; /* A more or less arbitrary start value. */
- struct printf_spec *specs
- = alloca (nspecs_max * sizeof (struct printf_spec));
+ /* A more or less arbitrary start value. */
+ size_t nspecs_size = 32 * sizeof (struct printf_spec);
+ struct printf_spec *specs = alloca (nspecs_size);
/* The number of arguments the format string requests. This will
determine the size of the array needed to store the argument
@@ -1679,15 +1679,14 @@
for (f = lead_str_end; *f != L_('\0'); f = specs[nspecs++].next_fmt)
{
- if (nspecs >= nspecs_max)
+ if (nspecs * sizeof (*specs) >= nspecs_size)
{
/* Extend the array of format specifiers. */
struct printf_spec *old = specs;
- specs = extend_alloca (specs, nspecs_max,
- 2 * nspecs_max * sizeof (*specs));
+ specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size);
/* Copy the old array's elements to the new space. */
- memmove (specs, old, nspecs * sizeof (struct printf_spec));
+ memmove (specs, old, nspecs * sizeof (*specs));
}
/* Parse the format specifier. */
Modified: fsf/trunk/libc/sysdeps/powerpc/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/Makefile (original)
+++ fsf/trunk/libc/sysdeps/powerpc/Makefile Mon Dec 19 00:02:24 2011
@@ -23,4 +23,6 @@
ifeq ($(subdir),csu)
# get offset to rtld_global._dl_hwcap
gen-as-const-headers += rtld-global-offsets.sym
+# get offset to __locale_struct.__ctype_tolower
+gen-as-const-headers += locale-defines.sym
endif
Added: fsf/trunk/libc/sysdeps/powerpc/locale-defines.sym
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/locale-defines.sym (added)
+++ fsf/trunk/libc/sysdeps/powerpc/locale-defines.sym Mon Dec 19 00:02:24 2011
@@ -1,0 +1,5 @@
+#include <locale/localeinfo.h>
+
+--
+
+LOCALE_CTYPE_TOLOWER offsetof (struct __locale_struct, __ctype_tolower)
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/Makefile (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/Makefile Mon Dec 19 00:02:24 2011
@@ -1,0 +1,4 @@
+ifeq ($(subdir),string)
+CFLAGS-strncase.c += -funroll-loops
+CFLAGS-strncase_l.c += -funroll-loops
+endif
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S Mon Dec 19 00:02:24 2011
@@ -1,0 +1,132 @@
+/* Optimized strcasecmp implementation for PowerPC32.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+#include <locale-defines.h>
+
+/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] )
+
+ or if defined USE_IN_EXTENDED_LOCALE_MODEL:
+
+ int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
+ __locale_t loc [r5]) */
+
+#ifndef STRCMP
+# define __STRCMP __strcasecmp
+# define STRCMP strcasecmp
+#endif
+
+ENTRY (BP_SYM (__STRCMP))
+
+#define rRTN r3 /* Return value */
+#define rSTR1 r5 /* 1st string */
+#define rSTR2 r4 /* 2nd string */
+#define rLOCARG r5 /* 3rd argument: locale_t */
+#define rCHAR1 r6 /* Byte readed from 1st string */
+#define rCHAR2 r7 /* Byte readed from 2nd string */
+#define rADDR1 r8 /* Address of tolower(rCHAR1) */
+#define rADDR2 r12 /* Address of tolower(rCHAR2) */
+#define rLWR1 r8 /* Byte tolower(rCHAR1) */
+#define rLWR2 r12 /* Byte tolower(rCHAR2) */
+#define rTMP r0
+#define rGOT r9 /* Address of the Global Offset Table */
+#define rLOC r11 /* Default locale address */
+
+ cmpw cr7, r3, r4
+#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+# ifdef SHARED
+ mflr rTMP
+ bcl 20,31,.L1
+.L1: mflr rGOT
+ addis rGOT, rGOT, _GLOBAL_OFFSET_TABLE_-.L1@ha
+ addi rGOT, rGOT, _GLOBAL_OFFSET_TABLE_-.L1@l
+ lwz rLOC, __libc_tsd_LOCALE@got@tprel(rGOT)
+ add rLOC, rLOC, __libc_tsd_LOCALE@tls
+ lwz rLOC, 0(rLOC)
+ mtlr rTMP
+# else
+ lis rTMP,_GLOBAL_OFFSET_TABLE_@ha
+ la rLOC,_GLOBAL_OFFSET_TABLE_@l(rTMP)
+ lwz rLOC, __libc_tsd_LOCALE@got@tprel(rGOT)
+ add rLOC, rLOC, __libc_tsd_LOCALE@tls
+ lwz rLOC, 0(rLOC)
+# endif /* SHARED */
+#else
+ mr rLOC, rLOCARG
+#endif
+ mr rSTR1, rRTN
+ lwz rLOC, LOCALE_CTYPE_TOLOWER(rLOC)
+ li rRTN, 0
+ beqlr cr7
+
+ /* Unrolling loop for POWER: loads are done with 'lbz' plus
+ offset and string descriptors are only updated in the end
+ of loop unrolling. */
+
+L(loop):
+ lbz rCHAR1, 0(rSTR1) /* Load char from s1 */
+ lbz rCHAR2, 0(rSTR2) /* Load char from s2 */
+ sldi rADDR1, rCHAR1, 2 /* Calculate address for tolower(*s1) */
+ sldi rADDR2, rCHAR2, 2 /* Calculate address for tolower(*s2) */
+ lwzx rLWR1, rLOC, rADDR1 /* Load tolower(*s1) */
+ lwzx rLWR2, rLOC, rADDR2 /* Load tolower(*s2) */
+ cmpwi cr7, rCHAR1, 0 /* *s1 == '\0' ? */
+ subf. r3, rLWR2, rLWR1
+ bnelr
+ beqlr cr7
+ lbz rCHAR1, 1(rSTR1)
+ lbz rCHAR2, 1(rSTR2)
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpwi cr7, rCHAR1, 0
+ subf. r3, rLWR2, rLWR1
+ bnelr
+ beqlr cr7
+ lbz rCHAR1, 2(rSTR1)
+ lbz rCHAR2, 2(rSTR2)
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpwi cr7, rCHAR1, 0
+ subf. r3, rLWR2, rLWR1
+ bnelr
+ beqlr cr7
+ lbz rCHAR1, 3(rSTR1)
+ lbz rCHAR2, 3(rSTR2)
+ /* Increment both string descriptors */
+ addi rSTR1, rSTR1, 4
+ addi rSTR2, rSTR2, 4
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpwi cr7, rCHAR1, 0
+ subf. r3, rLWR2, rLWR1
+ bnelr
+ bne cr7,L(loop)
+ blr
+END (BP_SYM (__STRCMP))
+
+weak_alias (BP_SYM (__STRCMP), BP_SYM (STRCMP))
+libc_hidden_builtin_def (__STRCMP)
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp_l.S Mon Dec 19 00:02:24 2011
@@ -1,0 +1,5 @@
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define STRCMP strcasecmp_l
+#define __STRCMP __strcasecmp_l
+
+#include "strcasecmp.S"
Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/Makefile (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/Makefile Mon Dec 19 00:02:24 2011
@@ -3,3 +3,8 @@
# optimization may require a TOC reference before relocations are resolved.
CFLAGS-rtld.c += -mno-vsx
endif
+
+ifeq ($(subdir),string)
+CFLAGS-strncase.c += -funroll-loops
+CFLAGS-strncase_l.c += -funroll-loops
+endif
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp.S Mon Dec 19 00:02:24 2011
@@ -1,0 +1,125 @@
+/* Optimized strcasecmp implementation for PowerPC64.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <bp-sym.h>
+#include <bp-asm.h>
+#include <locale-defines.h>
+
+/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] )
+
+ or if defined USE_IN_EXTENDED_LOCALE_MODEL:
+
+ int [r3] strcasecmp_l (const char *s1 [r3], const char *s2 [r4],
+ __locale_t loc [r5]) */
+
+#ifndef STRCMP
+# define __STRCMP __strcasecmp
+# define STRCMP strcasecmp
+#endif
+
+ENTRY (BP_SYM (__STRCMP))
+ CALL_MCOUNT 2
+
+#define rRTN r3 /* Return value */
+#define rSTR1 r5 /* 1st string */
+#define rSTR2 r4 /* 2nd string */
+#define rLOCARG r5 /* 3rd argument: locale_t */
+#define rCHAR1 r6 /* Byte readed from 1st string */
+#define rCHAR2 r7 /* Byte readed from 2nd string */
+#define rADDR1 r8 /* Address of tolower(rCHAR1) */
+#define rADDR2 r12 /* Address of tolower(rCHAR2) */
+#define rLWR1 r8 /* Word tolower(rCHAR1) */
+#define rLWR2 r12 /* Word tolower(rCHAR2) */
+#define rTMP r9
+#define rLOC r11 /* Default locale address */
+
+ cmpd cr7, r3, r4
+#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+ ld rTMP, __libc_tsd_LOCALE@got@tprel(r2)
+ add rLOC, rTMP, __libc_tsd_LOCALE@tls
+ ld rLOC, 0(rLOC)
+#else
+ mr rLOC, rLOCARG
+#endif
+ ld rLOC, LOCALE_CTYPE_TOLOWER(rLOC)
+ mr rSTR1, rRTN
+ li rRTN, 0
+ beqlr cr7
+
+
+ /* Unrolling loop for POWER: loads are done with 'lbz' plus
+ offset and string descriptors are only updated in the end
+ of loop unrolling. */
+
+ lbz rCHAR1, 0(rSTR1) /* Load char from s1 */
+ lbz rCHAR2, 0(rSTR2) /* Load char from s2 */
+L(loop):
+ cmpdi rCHAR1, 0 /* *s1 == '\0' ? */
+ sldi rADDR1, rCHAR1, 2 /* Calculate address for tolower(*s1) */
+ sldi rADDR2, rCHAR2, 2 /* Calculate address for tolower(*s2) */
+ lwzx rLWR1, rLOC, rADDR1 /* Load tolower(*s1) */
+ lwzx rLWR2, rLOC, rADDR2 /* Load tolower(*s2) */
+ cmpw cr1, rLWR1, rLWR2 /* r = tolower(*s1) == tolower(*s2) ? */
+ crorc 4*cr1+eq,eq,4*cr1+eq /* (*s1 != '\0') || (r == 1) */
+ beq cr1, L(done)
+ lbz rCHAR1, 1(rSTR1)
+ lbz rCHAR2, 1(rSTR2)
+ cmpdi rCHAR1, 0
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ lbz rCHAR1, 2(rSTR1)
+ lbz rCHAR2, 2(rSTR2)
+ cmpdi rCHAR1, 0
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1, L(done)
+ lbz rCHAR1, 3(rSTR1)
+ lbz rCHAR2, 3(rSTR2)
+ cmpdi rCHAR1, 0
+ /* Increment both string descriptors */
+ addi rSTR1, rSTR1, 4
+ addi rSTR2, rSTR2, 4
+ sldi rADDR1, rCHAR1, 2
+ sldi rADDR2, rCHAR2, 2
+ lwzx rLWR1, rLOC, rADDR1
+ lwzx rLWR2, rLOC, rADDR2
+ cmpw cr1, rLWR1, rLWR2
+ crorc 4*cr1+eq,eq,4*cr1+eq
+ beq cr1,L(done)
+ lbz rCHAR1, 0(rSTR1) /* Load char from s1 */
+ lbz rCHAR2, 0(rSTR2) /* Load char from s2 */
+ b L(loop)
+L(done):
+ subf r0, rLWR2, rLWR1
+ extsw rRTN, r0
+ blr
+END (BP_SYM (__STRCMP))
+
+weak_alias (BP_SYM (__STRCMP), BP_SYM (STRCMP))
+libc_hidden_builtin_def (__STRCMP)
Added: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S (added)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/strcasecmp_l.S Mon Dec 19 00:02:24 2011
@@ -1,0 +1,5 @@
+#define USE_IN_EXTENDED_LOCALE_MODEL
+#define STRCMP strcasecmp_l
+#define __STRCMP __strcasecmp_l
+
+#include "strcasecmp.S"
Modified: fsf/trunk/libc/time/tzfile.c
==============================================================================
--- fsf/trunk/libc/time/tzfile.c (original)
+++ fsf/trunk/libc/time/tzfile.c Mon Dec 19 00:02:24 2011
@@ -234,23 +234,58 @@
goto read_again;
}
+ if (__builtin_expect (num_transitions
+ > ((SIZE_MAX - (__alignof__ (struct ttinfo) - 1))
+ / (sizeof (time_t) + 1)), 0))
+ goto lose;
total_size = num_transitions * (sizeof (time_t) + 1);
total_size = ((total_size + __alignof__ (struct ttinfo) - 1)
& ~(__alignof__ (struct ttinfo) - 1));
types_idx = total_size;
- total_size += num_types * sizeof (struct ttinfo) + chars;
+ if (__builtin_expect (num_types
+ > (SIZE_MAX - total_size) / sizeof (struct ttinfo), 0))
+ goto lose;
+ total_size += num_types * sizeof (struct ttinfo);
+ if (__builtin_expect (chars > SIZE_MAX - total_size, 0))
+ goto lose;
+ total_size += chars;
+ if (__builtin_expect (__alignof__ (struct leap) - 1
+ > SIZE_MAX - total_size, 0))
+ goto lose;
total_size = ((total_size + __alignof__ (struct leap) - 1)
& ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size;
+ if (__builtin_expect (num_leaps
+ > (SIZE_MAX - total_size) / sizeof (struct leap), 0))
+ goto lose;
total_size += num_leaps * sizeof (struct leap);
- tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
- ? st.st_size - (ftello (f)
- + num_transitions * (8 + 1)
- + num_types * 6
- + chars
- + num_leaps * 12
- + num_isstd
- + num_isgmt) - 1 : 0);
+ tzspec_len = 0;
+ if (sizeof (time_t) == 8 && trans_width == 8)
+ {
+ off_t rem = st.st_size - ftello (f);
+ if (__builtin_expect (rem < 0
+ || (size_t) rem < (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars), 0))
+ goto lose;
+ tzspec_len = (size_t) rem - (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars);
+ if (__builtin_expect (num_leaps > SIZE_MAX / 12
+ || tzspec_len < num_leaps * 12, 0))
+ goto lose;
+ tzspec_len -= num_leaps * 12;
+ if (__builtin_expect (tzspec_len < num_isstd, 0))
+ goto lose;
+ tzspec_len -= num_isstd;
+ if (__builtin_expect (tzspec == 0 || tzspec_len - 1 < num_isgmt, 0))
+ goto lose;
+ tzspec_len -= num_isgmt + 1;
+ if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))
+ goto lose;
+ }
+ if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0))
+ goto lose;
/* Allocate enough memory including the extra block requested by the
caller. */
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits