This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/i486/multiarch updated. glibc-2.22-153-gb93765b
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 25 Aug 2015 13:52:18 -0000
- Subject: GNU C Library master sources branch hjl/i486/multiarch updated. glibc-2.22-153-gb93765b
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/i486/multiarch has been updated
via b93765b062511ac7c611895c062247e9619904e8 (commit)
from 536b8e1ceb50633d59fb386af6b7c295cee49e40 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b93765b062511ac7c611895c062247e9619904e8
commit b93765b062511ac7c611895c062247e9619904e8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Aug 25 06:51:45 2015 -0700
Add i386 wcslen multiarch functions
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 57cd608..3e078b7 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -1,4 +1,3 @@
ifeq ($(subdir),wcsmbs)
-sysdep_routines += wcslen-sse2 wcslen-c \
- wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
+sysdep_routines += wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/wcslen.S
deleted file mode 100644
index 7740404..0000000
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Multiple versions of wcslen
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2011-2015 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- 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/>. */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(__wcslen)
- .type __wcslen, @gnu_indirect_function
- LOAD_GOT_AND_RTLD_GLOBAL_RO
- LOAD_FUNC_GOT_EAX (__wcslen_ia32)
- HAS_CPU_FEATURE (SSE2)
- jz 2f
- LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2: ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
-#endif
diff --git a/sysdeps/i386/multiarch/Makefile b/sysdeps/i386/multiarch/Makefile
index 76e0820..1e96e7f 100644
--- a/sysdeps/i386/multiarch/Makefile
+++ b/sysdeps/i386/multiarch/Makefile
@@ -51,7 +51,8 @@ endif
ifeq ($(subdir),wcsmbs)
sysdep_routines += wcschr-i386 wcschr-sse2 wcsrchr-i386 wcsrchr-sse2 \
- wcscmp-i386 wcscmp-sse2 wcscpy-i386 wcscpy-ssse3
+ wcscmp-i386 wcscmp-sse2 wcscpy-i386 wcscpy-ssse3 \
+ wcslen-i386 wcslen-sse2
endif
ifeq (mathyes,$(subdir)$(config-cflags-avx))
diff --git a/sysdeps/i386/multiarch/ifunc-impl-list.c b/sysdeps/i386/multiarch/ifunc-impl-list.c
index 795771d..545d3fa 100644
--- a/sysdeps/i386/multiarch/ifunc-impl-list.c
+++ b/sysdeps/i386/multiarch/ifunc-impl-list.c
@@ -336,13 +336,11 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__wcscpy_ssse3)
IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_i386))
-#if 0
/* Support sysdeps/i386/i686/multiarch/wcslen.S. */
IFUNC_IMPL (i, name, wcslen,
IFUNC_IMPL_ADD (array, i, wcslen, HAS_CPU_FEATURE (SSE2),
__wcslen_sse2)
- IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_ia32))
-#endif
+ IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_i386))
/* Support sysdeps/i386/i686/multiarch/wcsrchr.S. */
IFUNC_IMPL (i, name, wcsrchr,
diff --git a/sysdeps/i386/i686/multiarch/wcslen-c.c b/sysdeps/i386/multiarch/wcslen-i386.c
similarity index 50%
rename from sysdeps/i386/i686/multiarch/wcslen-c.c
rename to sysdeps/i386/multiarch/wcslen-i386.c
index a335dc0..9c7b94e 100644
--- a/sysdeps/i386/i686/multiarch/wcslen-c.c
+++ b/sysdeps/i386/multiarch/wcslen-i386.c
@@ -1,9 +1,9 @@
#include <wchar.h>
#if IS_IN (libc)
-# define WCSLEN __wcslen_ia32
+# define WCSLEN __wcslen_i386
#endif
-extern __typeof (wcslen) __wcslen_ia32;
+extern __typeof (wcslen) __wcslen_i386;
#include "wcsmbs/wcslen.c"
diff --git a/sysdeps/i386/i686/multiarch/wcslen-sse2.S b/sysdeps/i386/multiarch/wcslen-sse2.S
similarity index 100%
rename from sysdeps/i386/i686/multiarch/wcslen-sse2.S
rename to sysdeps/i386/multiarch/wcslen-sse2.S
diff --git a/sysdeps/i386/multiarch/wcslen.c b/sysdeps/i386/multiarch/wcslen.c
new file mode 100644
index 0000000..4a7970e
--- /dev/null
+++ b/sysdeps/i386/multiarch/wcslen.c
@@ -0,0 +1,50 @@
+/* Multiple versions of wcslen.
+ All versions must be listed in ifunc-impl-list.c.
+ Copyright (C) 2015 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/>. */
+
+/* Define multiple versions only for the definition in libc. */
+#if IS_IN (libc)
+/* Redefine wcslen so that the compiler won't complain about the type
+ mismatch with the IFUNC selector in strong_alias, below. */
+# undef wcslen
+# define wcslen __redirect_wcslen
+# include <wchar.h>
+# undef wcslen
+
+# include <init-arch.h>
+
+extern __typeof (__redirect_wcslen) __wcslen_i386 attribute_hidden;
+extern __typeof (__redirect_wcslen) __wcslen_sse2 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+extern __typeof (__redirect_wcslen) __wcslen;
+extern void *wcslen_ifunc (void) __asm__ ("__wcslen");
+
+void *
+wcslen_ifunc (void)
+{
+ if (HAS_CPU_FEATURE (SSE2))
+ return __wcslen_sse2;
+
+ return __wcslen_i386;
+}
+__asm__ (".type __wcslen, %gnu_indirect_function");
+
+weak_alias (__wcslen, wcslen)
+#endif
-----------------------------------------------------------------------
Summary of changes:
sysdeps/i386/i686/multiarch/Makefile | 3 +-
sysdeps/i386/i686/multiarch/wcslen.S | 37 --------------------
sysdeps/i386/multiarch/Makefile | 3 +-
sysdeps/i386/multiarch/ifunc-impl-list.c | 4 +--
.../wcslen-c.c => multiarch/wcslen-i386.c} | 4 +-
sysdeps/i386/{i686 => }/multiarch/wcslen-sse2.S | 0
sysdeps/i386/multiarch/{wcscmp.c => wcslen.c} | 28 +++++++-------
7 files changed, 20 insertions(+), 59 deletions(-)
delete mode 100644 sysdeps/i386/i686/multiarch/wcslen.S
rename sysdeps/i386/{i686/multiarch/wcslen-c.c => multiarch/wcslen-i386.c} (50%)
rename sysdeps/i386/{i686 => }/multiarch/wcslen-sse2.S (100%)
copy sysdeps/i386/multiarch/{wcscmp.c => wcslen.c} (68%)
hooks/post-receive
--
GNU C Library master sources