This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/i486/multiarch updated. glibc-2.22-138-g48e5634


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  48e5634a92b89667cad3ddc72a663cbf732f9e5f (commit)
      from  51004aa7cd598b2a798c7389a15cf6c8b388c274 (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=48e5634a92b89667cad3ddc72a663cbf732f9e5f

commit 48e5634a92b89667cad3ddc72a663cbf732f9e5f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Aug 23 12:47:24 2015 -0700

    Add i386 strchr multiarch functions

diff --git a/sysdeps/i386/i586/multiarch/rtld-strchr.S b/sysdeps/i386/i586/multiarch/rtld-strchr.S
new file mode 100644
index 0000000..a26da1c
--- /dev/null
+++ b/sysdeps/i386/i586/multiarch/rtld-strchr.S
@@ -0,0 +1,19 @@
+/* strchr for ld.so
+   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/>.  */
+
+#include <sysdeps/i386/i586/strchr.S>
diff --git a/sysdeps/i386/i586/multiarch/strchr-i586.S b/sysdeps/i386/i586/multiarch/strchr-i586.S
new file mode 100644
index 0000000..48e71aa
--- /dev/null
+++ b/sysdeps/i386/i586/multiarch/strchr-i586.S
@@ -0,0 +1,7 @@
+#include <sysdeps/i386/multiarch/strchr-i586.S>
+
+#ifdef SHARED
+	.globl __GI_strchr
+	.hidden __GI_strchr
+	__GI_strchr = __strchr_i586
+#endif
diff --git a/sysdeps/i386/i586/multiarch/strchr.c b/sysdeps/i386/i586/multiarch/strchr.c
new file mode 100644
index 0000000..61c2f14
--- /dev/null
+++ b/sysdeps/i386/i586/multiarch/strchr.c
@@ -0,0 +1 @@
+#include <sysdeps/i386/multiarch/strchr.c>
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 830c77d..788dccb 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -1,7 +1,7 @@
 ifeq ($(subdir),string)
 sysdep_routines += varshift \
 		   strlen-sse2 strlen-sse2-bsf \
-		   strchr-sse2 strrchr-sse2 strchr-sse2-bsf strrchr-sse2-bsf \
+		   strrchr-sse2 strrchr-sse2-bsf \
 		   strnlen-sse2 strnlen-c
 ifeq (yes,$(config-cflags-sse4))
 sysdep_routines += strcspn-c strpbrk-c strspn-c
diff --git a/sysdeps/i386/i686/multiarch/strchr-i586.S b/sysdeps/i386/i686/multiarch/strchr-i586.S
new file mode 100644
index 0000000..9d841c9
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/strchr-i586.S
@@ -0,0 +1 @@
+/* Dummy file.  */
diff --git a/sysdeps/i386/i686/multiarch/strchr.S b/sysdeps/i386/i686/multiarch/strchr.S
deleted file mode 100644
index 6b46565..0000000
--- a/sysdeps/i386/i686/multiarch/strchr.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Multiple versions of strchr
-   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(strchr)
-	.type	strchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strchr_sse2_bsf)
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strchr_sse2)
-2:	ret
-END(strchr)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __strchr_ia32, @function; \
-	.globl __strchr_ia32; \
-	.p2align 4; \
-	__strchr_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __strchr_ia32, .-__strchr_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_strchr; __GI_strchr = __strchr_ia32
-#endif
-
-#include "../../i586/strchr.S"
diff --git a/sysdeps/i386/multiarch/Makefile b/sysdeps/i386/multiarch/Makefile
index ac8ff80..20c8166 100644
--- a/sysdeps/i386/multiarch/Makefile
+++ b/sysdeps/i386/multiarch/Makefile
@@ -33,7 +33,8 @@ sysdep_routines += bcopy-i386 bcopy-i686 bcopy-sse2-unaligned \
 		   strncase_l-ssse3 \
 		   strncmp-i386 strncmp-ssse3 strncmp-sse4 \
 		   strcat-i486 strcat-sse2 strcat-ssse3 \
-		   strncat-i386 strncat-sse2 strncat-ssse3
+		   strncat-i386 strncat-sse2 strncat-ssse3 \
+		   strchr-i386 strchr-i586 strchr-sse2-bsf strchr-sse2
 endif
 
 ifeq (mathyes,$(subdir)$(config-cflags-avx))
diff --git a/sysdeps/i386/multiarch/rtld-strchr.S b/sysdeps/i386/multiarch/rtld-strchr.S
new file mode 100644
index 0000000..a032fdb
--- /dev/null
+++ b/sysdeps/i386/multiarch/rtld-strchr.S
@@ -0,0 +1,19 @@
+/* strchr for ld.so
+   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/>.  */
+
+#include <sysdeps/i386/strchr.S>
diff --git a/sysdeps/i386/multiarch/strchr-i386.S b/sysdeps/i386/multiarch/strchr-i386.S
new file mode 100644
index 0000000..a5bfe79
--- /dev/null
+++ b/sysdeps/i386/multiarch/strchr-i386.S
@@ -0,0 +1,15 @@
+#include <init-arch.h>
+#define strchr __strchr_i386
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, aliasname)
+#include <sysdeps/i386/strchr.S>
+
+#if defined SHARED && MINIMUM_ISA != 586
+	.globl __GI_strchr
+	.hidden __GI_strchr
+	__GI_strchr = __strchr_i386
+#endif
diff --git a/sysdeps/i386/multiarch/strchr-i586.S b/sysdeps/i386/multiarch/strchr-i586.S
new file mode 100644
index 0000000..74263b0
--- /dev/null
+++ b/sysdeps/i386/multiarch/strchr-i586.S
@@ -0,0 +1,9 @@
+#include <init-arch.h>
+#define strchr __strchr_i586
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#undef libc_hidden_def
+#define libc_hidden_def(name)
+#undef weak_alias
+#define weak_alias(name, aliasname)
+#include <sysdeps/i386/i586/strchr.S>
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S b/sysdeps/i386/multiarch/strchr-sse2-bsf.S
similarity index 100%
rename from sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
rename to sysdeps/i386/multiarch/strchr-sse2-bsf.S
diff --git a/sysdeps/i386/i686/multiarch/strchr-sse2.S b/sysdeps/i386/multiarch/strchr-sse2.S
similarity index 100%
rename from sysdeps/i386/i686/multiarch/strchr-sse2.S
rename to sysdeps/i386/multiarch/strchr-sse2.S
diff --git a/sysdeps/i386/multiarch/strchr.c b/sysdeps/i386/multiarch/strchr.c
new file mode 100644
index 0000000..015b51c
--- /dev/null
+++ b/sysdeps/i386/multiarch/strchr.c
@@ -0,0 +1,60 @@
+/* Multiple versions of strchr
+   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)
+# define _HAVE_STRING_ARCH_strchr
+/* Redefine strchr so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+# undef strchr
+# define strchr __redirect_strchr
+# include <string.h>
+# undef strchr
+
+# include <init-arch.h>
+
+extern __typeof (__redirect_strchr) __strchr_i386 attribute_hidden;
+extern __typeof (__redirect_strchr) __strchr_i586 attribute_hidden;
+extern __typeof (__redirect_strchr) __strchr_sse2 attribute_hidden;
+extern __typeof (__redirect_strchr) __strchr_sse2_bsf attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__redirect_strchr) strchr;
+extern void *strchr_ifunc (void) __asm__ ("strchr");
+
+void *
+strchr_ifunc (void)
+{
+  if (HAS_CPU_FEATURE (SSE2))
+    {
+      if (HAS_ARCH_FEATURE (Slow_BSF))
+	return __strchr_sse2;
+      else
+	return __strchr_sse2_bsf;
+    }
+
+  if (USE_I586)
+    return __strchr_i586;
+  else
+    return __strchr_i386;
+}
+__asm__ (".type strchr, %gnu_indirect_function");
+weak_alias (strchr, index)
+#endif

-----------------------------------------------------------------------

Summary of changes:
 sysdeps/i386/i586/multiarch/rtld-strchr.S          |   19 ++++++
 sysdeps/i386/i586/multiarch/strchr-i586.S          |    7 ++
 sysdeps/i386/i586/multiarch/strchr.c               |    1 +
 sysdeps/i386/i686/multiarch/Makefile               |    2 +-
 .../i686/multiarch/{bcopy-i386.S => strchr-i586.S} |    0
 sysdeps/i386/i686/multiarch/strchr.S               |   57 -------------------
 sysdeps/i386/multiarch/Makefile                    |    3 +-
 sysdeps/i386/multiarch/rtld-strchr.S               |   19 ++++++
 sysdeps/i386/multiarch/strchr-i386.S               |   15 +++++
 sysdeps/i386/multiarch/strchr-i586.S               |    9 +++
 .../i386/{i686 => }/multiarch/strchr-sse2-bsf.S    |    0
 sysdeps/i386/{i686 => }/multiarch/strchr-sse2.S    |    0
 sysdeps/i386/multiarch/strchr.c                    |   60 ++++++++++++++++++++
 13 files changed, 133 insertions(+), 59 deletions(-)
 create mode 100644 sysdeps/i386/i586/multiarch/rtld-strchr.S
 create mode 100644 sysdeps/i386/i586/multiarch/strchr-i586.S
 create mode 100644 sysdeps/i386/i586/multiarch/strchr.c
 copy sysdeps/i386/i686/multiarch/{bcopy-i386.S => strchr-i586.S} (100%)
 delete mode 100644 sysdeps/i386/i686/multiarch/strchr.S
 create mode 100644 sysdeps/i386/multiarch/rtld-strchr.S
 create mode 100644 sysdeps/i386/multiarch/strchr-i386.S
 create mode 100644 sysdeps/i386/multiarch/strchr-i586.S
 rename sysdeps/i386/{i686 => }/multiarch/strchr-sse2-bsf.S (100%)
 rename sysdeps/i386/{i686 => }/multiarch/strchr-sse2.S (100%)
 create mode 100644 sysdeps/i386/multiarch/strchr.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]