[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r9054 - in /fsf/trunk/libc: ./ sysdeps/x86_64/multiarch/
- To: commits@xxxxxxxxxx
- Subject: [commits] r9054 - in /fsf/trunk/libc: ./ sysdeps/x86_64/multiarch/
- From: eglibc@xxxxxxxxxx
- Date: Wed, 07 Oct 2009 07:03:59 -0000
Author: eglibc
Date: Wed Oct 7 00:03:58 2009
New Revision: 9054
Log:
Import glibc-mainline for 2009-10-07
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
fsf/trunk/libc/sysdeps/x86_64/multiarch/strcasestr-c.c
fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr-c.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Oct 7 00:03:58 2009
@@ -1,3 +1,18 @@
+2009-10-06 Roland McGrath <roland@xxxxxxxxxx>
+
+ * sysdeps/x86_64/multiarch/strstr-c.c
+ [! SHARED]: Omit libc_hidden_builtin_def fiddling.
+
+ * sysdeps/x86_64/multiarch/strcasestr-c.c: Remove
+ libc_hidden_builtin_def fiddling, does not apply to strcasestr at all.
+
+ * sysdeps/x86_64/multiarch/init-arch.h
+ [NOT_IN_libc] (__get_cpu_features): Define it as a macro.
+ (HAS_CPU_FEATURE): New macro.
+ (HAS_SSE2, HAS_POPCOUNT, HAS_SSE4_2, HAS_FMA): Use it.
+ * sysdeps/x86_64/multiarch/init-arch.c
+ (__get_cpu_features): #undef it before definition.
+
2009-10-05 Andreas Schwab <schwab@xxxxxxxxxx>
* locale/C-time.c: Revert week-1stday back to 19971130 and set
Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c Wed Oct 7 00:03:58 2009
@@ -77,6 +77,7 @@
__cpu_features.kind = arch_kind_other;
}
+#undef __get_cpu_features
const struct cpu_features *
__get_cpu_features (void)
Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h Wed Oct 7 00:03:58 2009
@@ -58,30 +58,16 @@
extern const struct cpu_features *__get_cpu_features (void)
__attribute__ ((const));
+#ifndef NOT_IN_libc
+# define __get_cpu_features() (&__cpu_features)
+#endif
+
+#define HAS_CPU_FEATURE(idx, reg, bit) \
+ ((__get_cpu_features ()->cpuid[idx].reg & (1 << (bit))) != 0)
+
/* Following are the feature tests used throughout libc. */
-#ifndef NOT_IN_libc
-# define HAS_SSE2 \
- ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx & (1 << 26)) != 0)
-
-# define HAS_POPCOUNT \
- ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
-
-# define HAS_SSE4_2 \
- ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 20)) != 0)
-
-# define HAS_FMA \
- ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 12)) != 0)
-#else
-# define HAS_SSE2 \
- ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].edx & (1 << 26)) != 0)
-
-# define HAS_POPCOUNT \
- ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
-
-# define HAS_SSE4_2 \
- ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 20)) != 0)
-
-# define HAS_FMA \
- ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 12)) != 0)
-#endif
+#define HAS_SSE2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, edx, 26)
+#define HAS_POPCOUNT HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 23)
+#define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 20)
+#define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 12)
Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strcasestr-c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strcasestr-c.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strcasestr-c.c Wed Oct 7 00:03:58 2009
@@ -1,9 +1,6 @@
#include "init-arch.h"
#define STRCASESTR __strcasestr_sse2
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
- __hidden_ver1 (__strcasestr_sse2, __GI_strcasestr, __strcasestr_sse2);
#include "string/strcasestr.c"
Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr-c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr-c.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strstr-c.c Wed Oct 7 00:03:58 2009
@@ -1,9 +1,11 @@
#include "init-arch.h"
#define STRSTR __strstr_sse2
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
+#ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
__hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
+#endif
#include "string/strstr.c"