[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r15197 - in /fsf/trunk/libc: ./ elf/ nptl/ nptl/sysdeps/unix/sysv/linux/ nptl/sysdeps/unix/sysv/linux/sparc/ nptl/sysdeps/un...
- To: commits@xxxxxxxxxx
- Subject: [commits] r15197 - in /fsf/trunk/libc: ./ elf/ nptl/ nptl/sysdeps/unix/sysv/linux/ nptl/sysdeps/unix/sysv/linux/sparc/ nptl/sysdeps/un...
- From: eglibc@xxxxxxxxxx
- Date: Tue, 06 Sep 2011 07:02:26 -0000
Author: eglibc
Date: Tue Sep 6 00:02:24 2011
New Revision: 15197
Log:
Import glibc-mainline for 2011-09-06
Added:
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c
fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp.S
fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_fabs.S
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu/
fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu/Implies
fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
fsf/trunk/libc/sysdeps/x86_64/wcscmp.S
Removed:
fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_fabs.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/elf/dl-misc.c
fsf/trunk/libc/elf/pldd-xx.c
fsf/trunk/libc/elf/pldd.c
fsf/trunk/libc/nptl/ChangeLog
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
fsf/trunk/libc/po/ja.po
fsf/trunk/libc/posix/glob.h
fsf/trunk/libc/posix/spawn.c
fsf/trunk/libc/posix/spawn_int.h
fsf/trunk/libc/posix/spawni.c
fsf/trunk/libc/posix/spawnp.c
fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
fsf/trunk/libc/sysdeps/mach/hurd/spawni.c
fsf/trunk/libc/sysdeps/posix/spawni.c
fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_fabsf.S
fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.c
fsf/trunk/libc/sysdeps/x86_64/multiarch/Makefile
fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr.S
fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr.S
fsf/trunk/libc/wcsmbs/wcscmp.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Sep 6 00:02:24 2011
@@ -1,3 +1,92 @@
+2011-09-06 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h: Add entry for getcpu
+ syscall on x86-64.
+ * sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Use real
+ syscall.
+ * sysdeps/unix/sysv/linux/x86_64/time.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S [!SHARED]: Use real
+ syscall if possible.
+
+2011-09-05 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * elf/pldd.c (get_process_info): Don't read whole ELF header, just
+ e_ident. Don't pass to find_mapsXX.
+ * elf/pldd-xx.c (find_mapsXX): Remove second parameter.
+
+2011-07-20 Liubov Dmitrieva <liubov.dmitrieva@xxxxxxxxx>
+
+ * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
+ strchr-sse2-no-bsf strrchr-sse2-no-bsf
+ * sysdeps/x86_64/multiarch/strchr.S: Update.
+ Check bit_slow_BSF bit.
+ * sysdeps/x86_64/multiarch/strrchr.S: Likewise.
+ * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: New file.
+ * sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S: New file.
+
+2011-09-05 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #13134]
+ * sysdeps/posix/spawni.c (script_execute): Define only for compatibility
+ before glibc 2.15.
+ (tryshell): Define.
+ (__spawni): Change last parameter to be flag. Test
+ SPAWN_XFLAGS_USE_PATH flag to use path or not.
+ Don't try to use shell unless SPAWN_XFLAGS_TRY_SHELL is set.
+ * sysdeps/mach/hurd/spawni.c: Change last parameter and adjust user.
+ * posix/spawni.c: Likewise.
+ * posix/spawn.c: Add compat version which passed SPAWN_XFLAGS_TRY_SHELL.
+ * posix/spawnp.c: Likewise. Change normal version to use
+ SPAWN_XFLAGS_USE_PATH.
+ * posix/spawn_int.c: Define SPAWN_XFLAGS_USE_PATH and
+ SPAWN_XFLAGS_TRY_SHELL.
+
+ [BZ #13150]
+ * posix/glob.h: Remove gcc 1.x support.
+
+ [BZ #13068]
+ * elf/dl-misc.c (_dl_sysdep_read_whole_file): Use O_CLOEXEC.
+
+2011-07-20 Liubov Dmitrieva <liubov.dmitrieva@xxxxxxxxx>
+
+ * sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
+ strchr-sse2 strrchr-sse2 strchr-sse2-bsf
+ strrchr-sse2-bsf
+ * sysdeps/i386/i686/multiarch/strchr.S: New file.
+ * sysdeps/i386/i686/multiarch/strrchr.S: New file.
+ * sysdeps/i386/i686/multiarch/strchr-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: New file.
+ * sysdeps/i386/i686/multiarch/strrchr-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: New file.
+
+2011-08-29 Liubov Dmitrieva <liubov.dmitrieva@xxxxxxxxx>
+
+ * sysdeps/x86_64/wcscmp.S: New file.
+
+ * sysdeps/i386/i686/multiarch/Makefile: (sysdep_routines): Add
+ wcscmp-c wcscmp-sse2
+ * sysdeps/i386/i686/multiarch/wcscmp-c.c: New file.
+ * sysdeps/i386/i686/multiarch/wcscmp.S: New file.
+ * sysdeps/i386/i686/multiarch/wcscmp-sse2.S: New file.
+ * wcsmbs/wcscmp.c: Allow renaming.
+
+2011-09-05 David S. Miller <davem@xxxxxxxxxxxxx>
+
+ * sysdeps/sparc/sparc32/fpu/s_fabsf.S: Use first argument
+ stack slot, rather than the struct return pointer slot.
+ * sysdeps/sparc/sparc32/fpu/s_fabs.c: Delete.
+ * sysdeps/sparc/sparc32/fpu/s_fabs.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/fpu/Implies: Likewise.
+
+2011-09-05 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * po/ja.po: Update from translation team.
+
+ [BZ #13144]
+ * sysdeps/unix/sysv/linux/x86_64/bits/sem.h (semdid_ds): Fix to match
+ kernel in 64-bit binaries.
+
2011-09-01 David S. Miller <davem@xxxxxxxxxxxxx>
* elf/elf.h (HWCAP_SPARC_*): Move to..
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Tue Sep 6 00:02:24 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2011-8-20
+GNU C Library NEWS -- history of user-visible changes. 2011-9-5
Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -9,7 +9,8 @@
* The following bugs are resolved with this release:
- 9696, 12868, 12852, 12874, 12885, 12907, 12922, 12935, 13007, 13021, 13114
+ 9696, 12868, 12852, 12874, 12885, 12907, 12922, 12935, 13007, 13021,
+ 13068, 13114, 13134, 13144, 13150
* New program pldd to list loaded object of a process
Implemented by Ulrich Drepper.
@@ -24,7 +25,11 @@
* Improved strcpy, strncpy, stpcpy, stpncpy for SSE2 and SSSE3 on x86-64.
Contributed by HJ Lu.
-* Optimized strcat and strncat on x86-64.
+* Optimized strcat and strncat on x86-64 and optimized wcscmp on x86-32 and
+ x86-64.
+ Contributed by Liubov Dmitrieva.
+
+* Optimized strchrm strrchr for SSE on x86-32.
Contributed by Liubov Dmitrieva.
* New interfaces: scandirat, scandirat64
Modified: fsf/trunk/libc/elf/dl-misc.c
==============================================================================
--- fsf/trunk/libc/elf/dl-misc.c (original)
+++ fsf/trunk/libc/elf/dl-misc.c Tue Sep 6 00:02:24 2011
@@ -1,5 +1,5 @@
/* Miscellaneous support functions for dynamic linker
- Copyright (C) 1997-2004, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-2004, 2006, 2009, 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
@@ -44,7 +44,11 @@
{
void *result = MAP_FAILED;
struct stat64 st;
- int fd = __open (file, O_RDONLY);
+ int flags = O_RDONLY;
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+ int fd = __open (file, flags);
if (fd >= 0)
{
if (__fxstat64 (_STAT_VER, fd, &st) >= 0)
@@ -350,7 +354,7 @@
UINT32_C (536870909),
UINT32_C (1073741789),
UINT32_C (2147483647),
- /* 4294967291L */
+ /* 4294967291L */
UINT32_C (2147483647) + UINT32_C (2147483644)
};
Modified: fsf/trunk/libc/elf/pldd-xx.c
==============================================================================
--- fsf/trunk/libc/elf/pldd-xx.c (original)
+++ fsf/trunk/libc/elf/pldd-xx.c Tue Sep 6 00:02:24 2011
@@ -79,7 +79,7 @@
static int
-E(find_maps) (pid_t pid, EW(Ehdr) *ehdr, void *auxv, size_t auxv_size)
+E(find_maps) (pid_t pid, void *auxv, size_t auxv_size)
{
EW(Addr) phdr = 0;
unsigned int phnum = 0;
Modified: fsf/trunk/libc/elf/pldd.c
==============================================================================
--- fsf/trunk/libc/elf/pldd.c (original)
+++ fsf/trunk/libc/elf/pldd.c Tue Sep 6 00:02:24 2011
@@ -247,17 +247,13 @@
return EXIT_FAILURE;
}
- union
- {
- Elf32_Ehdr ehdr32;
- Elf64_Ehdr ehdr64;
- } uehdr;
- if (read (fd, &uehdr, sizeof (uehdr)) != sizeof (uehdr))
+ char e_ident[EI_NIDENT];
+ if (read (fd, e_ident, EI_NIDENT) != EI_NIDENT)
goto no_info;
close (fd);
- if (memcmp (uehdr.ehdr32.e_ident, ELFMAG, SELFMAG) != 0)
+ if (memcmp (e_ident, ELFMAG, SELFMAG) != 0)
{
error (0, 0, gettext ("process %lu is no ELF program"), pid);
return EXIT_FAILURE;
@@ -287,10 +283,10 @@
close (fd);
int retval;
- if (uehdr.ehdr32.e_ident[EI_CLASS] == ELFCLASS32)
- retval = find_maps32 (pid, &uehdr.ehdr32, auxv, auxv_size);
+ if (e_ident[EI_CLASS] == ELFCLASS32)
+ retval = find_maps32 (pid, auxv, auxv_size);
else
- retval = find_maps64 (pid, &uehdr.ehdr64, auxv, auxv_size);
+ retval = find_maps64 (pid, auxv, auxv_size);
free (auxv);
close (memfd);
Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Tue Sep 6 00:02:24 2011
@@ -1,3 +1,17 @@
+2011-09-05 David S. Miller <davem@xxxxxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
+ New function.
+ (sem_timedwait): Call it to force an exception region around
+ the async cancel enable and the futex operation.
+ * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Likewise.
+ * sysdeps/unix/sysv/linux/sem_wait.c (do_futex_wait): New function.
+ (__new_sem_wait): Call it to force an exception region around
+ the async cancel enable and the futex operation.
+ * sysdeps/unix/sysv/linux/sparc/sem_wait.c: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Likewise.
+
2011-08-31 Andreas Schwab <schwab@xxxxxxxxxx>
* allocatestack.c (setxid_mark_thread): Ensure that the exiting
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c Tue Sep 6 00:02:24 2011
@@ -30,6 +30,21 @@
extern void __sem_wait_cleanup (void *arg) attribute_hidden;
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_timed_wait (struct new_sem *isem, struct timespec *rt)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_timed_wait (&isem->value, 0, rt,
+ isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
sem_timedwait (sem_t *sem, const struct timespec *abstime)
@@ -80,16 +95,7 @@
/* Do wait. */
rt.tv_sec = sec;
rt.tv_nsec = nsec;
-
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_timed_wait (&isem->value, 0, &rt,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_timed_wait(isem, &rt);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c Tue Sep 6 00:02:24 2011
@@ -37,6 +37,20 @@
atomic_decrement (&isem->nwaiters);
}
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_wait (struct new_sem *isem)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_wait (&isem->value, 0, isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
__new_sem_wait (sem_t *sem)
@@ -53,15 +67,7 @@
while (1)
{
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_wait (&isem->value, 0,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_wait(isem);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c Tue Sep 6 00:02:24 2011
@@ -30,6 +30,21 @@
extern void __sem_wait_cleanup (void *arg) attribute_hidden;
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_timed_wait (struct sparc_new_sem *isem, struct timespec *rt)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_timed_wait (&isem->value, 0, rt,
+ isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
sem_timedwait (sem_t *sem, const struct timespec *abstime)
@@ -80,16 +95,7 @@
/* Do wait. */
rt.tv_sec = sec;
rt.tv_nsec = nsec;
-
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_timed_wait (&isem->value, 0, &rt,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_timed_wait(isem, &rt);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c Tue Sep 6 00:02:24 2011
@@ -37,6 +37,20 @@
atomic_decrement (&isem->nwaiters);
}
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_wait (struct sparc_new_sem *isem)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_wait (&isem->value, 0, isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
__new_sem_wait (sem_t *sem)
@@ -53,15 +67,7 @@
while (1)
{
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_wait (&isem->value, 0,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_wait(isem);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c Tue Sep 6 00:02:24 2011
@@ -30,6 +30,21 @@
extern void __sem_wait_cleanup (void *arg) attribute_hidden;
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_timed_wait (struct sparc_new_sem *isem, struct timespec *rt)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_timed_wait (&isem->value, 0, rt,
+ isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
sem_timedwait (sem_t *sem, const struct timespec *abstime)
@@ -99,16 +114,7 @@
/* Do wait. */
rt.tv_sec = sec;
rt.tv_nsec = nsec;
-
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_timed_wait (&isem->value, 0, &rt,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_timed_wait(isem, &rt);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c Tue Sep 6 00:02:24 2011
@@ -44,6 +44,20 @@
}
}
+/* This is in a seperate function in order to make sure gcc
+ puts the call site into an exception region, and thus the
+ cleanups get properly run. */
+static int
+__attribute__ ((noinline))
+do_futex_wait (struct sparc_new_sem *isem)
+{
+ int err, oldtype = __pthread_enable_asynccancel ();
+
+ err = lll_futex_wait (&isem->value, 0, isem->private ^ FUTEX_PRIVATE_FLAG);
+
+ __pthread_disable_asynccancel (oldtype);
+ return err;
+}
int
__new_sem_wait (sem_t *sem)
@@ -77,15 +91,7 @@
while (1)
{
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- err = lll_futex_wait (&isem->value, 0,
- isem->private ^ FUTEX_PRIVATE_FLAG);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
-
+ err = do_futex_wait(isem);
if (err != 0 && err != -EWOULDBLOCK)
{
__set_errno (-err);
Modified: fsf/trunk/libc/po/ja.po
==============================================================================
--- fsf/trunk/libc/po/ja.po (original)
+++ fsf/trunk/libc/po/ja.po Tue Sep 6 00:02:24 2011
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: libc 2.14\n"
"POT-Creation-Date: 2011-05-31 00:06-0400\n"
-"PO-Revision-Date: 2011-07-09 09:17+0900\n"
+"PO-Revision-Date: 2011-08-28 14:30+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@xxxxxxxxx>\n"
"Language-Team: Japanese <translation-team-ja@xxxxxxxxxxxxxxxxxxxxx>\n"
"Language: ja\n"
@@ -438,7 +438,7 @@
#: elf/dl-deps.c:133
#, c-format
msgid "cannot load auxiliary `%s' because of empty dynamic string token substitution\n"
-msgstr "åçãã¼ãã«éã空æåãã¼ã¯ã³ã«ããç½®æããè¡ã£ãããã« auxliary `%s' ã®ãã¼ãã«å¤±æãã¾ãã\n"
+msgstr "åçãã¼ãã«éã空æåãã¼ã¯ã³ã«ããç½®æããè¡ã£ãããã« auxiliary `%s' ã®ãã¼ãã«å¤±æãã¾ãã\n"
#: elf/dl-deps.c:474
msgid "cannot allocate dependency list"
@@ -696,9 +696,8 @@
msgstr "TLS ãã¼ã¿æ§é ä½ãä½æã§ãã¾ãã"
#: elf/dl-version.c:172
-#, fuzzy
msgid "version lookup error"
-msgstr "ã·ã³ãã«æ¤ç´¢ã¨ã©ã¼ã§ã"
+msgstr "ãã¼ã¸ã§ã³æ¤ç´¢ã¨ã©ã¼ã§ã"
#: elf/dl-version.c:303
msgid "cannot allocate version reference table"
@@ -766,7 +765,7 @@
#: elf/ldconfig.c:159
msgid "Configure Dynamic Linker Run Time Bindings."
-msgstr "åçãªã³ã«ã©ã³ã¿ã¤ã ã®ãã¤ã³ãã£ã³ã°ããè¨å®ãã¾ãã"
+msgstr "åçãªã³ã«ã©ã³ã¿ã¤ã ã®ãã¤ã³ãã£ã³ã°ãè¨å®ãã¾ãã"
#: elf/ldconfig.c:339
#, c-format
@@ -1098,40 +1097,36 @@
msgstr ""
#: elf/sotruss.ksh:46
-#, fuzzy
msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n"
-msgstr "é·ãå½¢å¼ã®ãªãã·ã§ã³ã§å¿
é ã¾ãã¯ä»»æã®å¼æ°ã¯ãããã«å¯¾å¿ããçãå½¢å¼ã®ãªãã·ã§ã³ã§ãåæ§ã«å¿
é ã¾ãã¯ä»»æã§ãã"
+msgstr "é·ãå½¢å¼ã®ãªãã·ã§ã³ã§å¿
é ã¾ãã¯ä»»æã®å¼æ°ã¯ãããã«å¯¾å¿ããçãå½¢å¼ã®ãªãã·ã§ã³ã§ãåæ§ã«å¿
é ã¾ãã¯ä»»æã§ãã\\n"
#: elf/sotruss.ksh:56
-#, fuzzy
msgid "%s: option requires an argument -- '%s'\\n"
-msgstr "%s: ãªãã·ã§ã³ã«ã¯å¼æ°ãå¿
è¦ã§ã -- '%c'\n"
+msgstr "%s: ãªãã·ã§ã³ã«ã¯å¼æ°ãå¿
è¦ã§ã -- '%c'\\n"
#: elf/sotruss.ksh:57 elf/sotruss.ksh:68 elf/sotruss.ksh:134
-#, fuzzy
msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n"
-msgstr "詳細㯠`%s --help' ã¾ã㯠`%s --usage' ãå®è¡ãã¦ä¸ããã\n"
+msgstr "詳細㯠`%s --help' ã¾ã㯠`%s --usage' ãå®è¡ãã¦ä¸ããã\\n"
#: elf/sotruss.ksh:62
-#, fuzzy
msgid "%s: option is ambiguous; possibilities:"
-msgstr "%s: ãªãã·ã§ã³ '%s' ã¯ææ§ã§ã\n"
+msgstr "%s: ãªãã·ã§ã³ '%s' ã¯ææ§ã§ã: 次ã®ãã®ãå¯è½ã§ã:"
#: elf/sotruss.ksh:80
-#, fuzzy
msgid "Written by %s.\\n"
-msgstr "ä½è
%sã\n"
+msgstr "ä½è
%sã\\n"
#: elf/sotruss.ksh:87
msgid ""
"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]\n"
"\t [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\\n"
msgstr ""
+"使ç¨æ³: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]\n"
+"\t [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\\n"
#: elf/sotruss.ksh:133
-#, fuzzy
msgid "%s: unrecognized option '%c%s'\\n"
-msgstr "%s: ãªãã·ã§ã³ '%c%s' ãèªèã§ãã¾ãã\n"
+msgstr "%s: ãªãã·ã§ã³ '%c%s' ãèªèã§ãã¾ãã\\n"
#: elf/sprof.c:77
msgid "Output selection:"
@@ -2460,9 +2455,9 @@
msgstr "ã·ã³ãã« `%.*s' ãã¬ãã¼ããªã¼ãããå
ã«ããã¾ãã"
#: locale/programs/locale-spec.c:131
-#, fuzzy, c-format
+#, c-format
msgid "unknown name \"%s\""
-msgstr "ä¸æãªã»ãã`%s'ã§ã"
+msgstr "ä¸æãªåå \"%s\" ã§ã"
#: locale/programs/locale.c:74
msgid "System information:"
@@ -2687,9 +2682,9 @@
msgstr "æ°ãããã±ã¼ã«æ¸åº«ã®ã¢ã¼ããå¤æ´ã§ãã¾ãã"
#: locale/programs/locarchive.c:285
-#, fuzzy, c-format
+#, c-format
msgid "cannot read data from locale archive"
-msgstr "ãã±ã¼ã«æ¸åº«ã«è¿½å ã§ãã¾ãã"
+msgstr "ãã±ã¼ã«æ¸åº«ãããã¼ã¿ãèªã¿è¾¼ãã¾ãã"
#: locale/programs/locarchive.c:318
#, c-format
@@ -2771,7 +2766,7 @@
#: locale/programs/locarchive.c:1308
#, c-format
msgid "cannot open directory \"%s\": %s: ignored"
-msgstr "ãã£ã¬ã¯ã \"%s\" ãéãã¾ãã: %s: ç¡è¦ãã¾ã"
+msgstr "ãã£ã¬ã¯ã㪠\"%s\" ãéãã¾ãã: %s: ç¡è¦ãã¾ã"
#: locale/programs/locarchive.c:1380
#, c-format
@@ -2896,9 +2891,8 @@
msgstr "mcheck_status ãããããã§ããã©ã¤ãã©ãªã«ãã°ãããã¾ã\n"
#: malloc/memusage.sh:33
-#, fuzzy
msgid "%s: option '%s' requires an argument\\n"
-msgstr "%s: ãªãã·ã§ã³ '--%s' ã¯å¼æ°ãå¿
è¦ã§ã\n"
+msgstr "%s: ãªãã·ã§ã³ '%s' ã¯å¼æ°ãå¿
è¦ã§ã\\n"
#: malloc/memusage.sh:39
msgid ""
@@ -2954,17 +2948,16 @@
"\n"
#: malloc/memusage.sh:101
-#, fuzzy
msgid ""
"Syntax: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]\n"
"\t [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
"\t [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
"\t PROGRAM [PROGRAMOPTION]..."
msgstr ""
-"æ§æ : memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]\n"
-" [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
-" [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
-" PROGRAM [PROGRAMOPTION]..."
+"使ç¨æ³: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]\n"
+"\t [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
+"\t [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
+"\t PROGRAM [PROGRAMOPTION]..."
#: malloc/memusage.sh:193
msgid "memusage: option \\`${1##*=}' is ambiguous"
@@ -3654,7 +3647,7 @@
#: nscd/aicache.c:83 nscd/hstcache.c:492
#, c-format
msgid "Haven't found \"%s\" in hosts cache!"
-msgstr "ãã¹ããã£ãã·ã¥ã«å
ã« \"%s\" ãè¦ã¤ããã¾ãã!"
+msgstr "ãã¹ããã£ãã·ã¥å
ã« \"%s\" ãè¦ã¤ããã¾ãã!"
#: nscd/aicache.c:85 nscd/hstcache.c:494
#, c-format
@@ -4380,7 +4373,7 @@
#: nss/makedb.c:70
msgid "Create simple DB database from textual input."
-msgstr "ããã¹ãå
¥åããåç´ãªãã¼ã¿ãã¹ãä½æãã¾ãã"
+msgstr "ããã¹ãå
¥åããåç´ãªãã¼ã¿ãã¼ã¹ãä½æãã¾ãã"
#: nss/makedb.c:73
msgid ""
@@ -4844,14 +4837,14 @@
msgstr ""
#: stdio-common/psiginfo.c:204
-#, fuzzy, c-format
+#, c-format
msgid "Unknown signal %d\n"
-msgstr "ä¸æãªã·ã°ãã« %d"
+msgstr "ä¸æãªã·ã°ãã« %d ã§ã\n"
#: stdio-common/psignal.c:51
#, c-format
msgid "%s%sUnknown signal %d\n"
-msgstr "%s%sä¸æãªã®ã·ã°ãã« %d ã§ã\n"
+msgstr "%s%sä¸æãªã·ã°ãã« %d ã§ã\n"
#: stdio-common/psignal.c:52
msgid "Unknown signal"
@@ -5379,7 +5372,7 @@
#: sunrpc/svc_run.c:71
msgid "svc_run: - out of memory"
-msgstr "mesvc_run: - ã¡ã¢ãªã足ãã¾ãã"
+msgstr "svc_run: - ã¡ã¢ãªã足ãã¾ãã"
#: sunrpc/svc_run.c:91
msgid "svc_run: - poll failed"
@@ -6576,12 +6569,16 @@
msgstr ""
#: timezone/zdump.c:242
-#, fuzzy, c-format
+#, c-format
msgid ""
"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
"\n"
"Report bugs to tz@xxxxxxxxxxxxxxxxxx\n"
-msgstr "%s: 使ç¨æ³: %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
+msgstr ""
+"%s: 使ç¨æ³: %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
+"\n"
+"ãã°ãçºè¦ããã <tz@xxxxxxxxxxxxxxxxx> ã«å ±åãã¦ãã ããã\n"
+"翻訳ã«é¢ãããã°ã¯<translation-team-ja@xxxxxxxxxxxxxxxxxxxxx>ã«å ±åãã¦ãã ããã\n"
#: timezone/zdump.c:311
#, c-format
@@ -6590,7 +6587,7 @@
#: timezone/zdump.c:398
msgid "Error writing to standard output"
-msgstr ""
+msgstr "æ¨æºåºåã¸æ¸ãè¾¼ã¿ä¸ã«ã¨ã©ã¼ãçºçãã¾ãã"
#: timezone/zdump.c:421
#, c-format
@@ -6745,7 +6742,7 @@
#: timezone/zic.c:972
msgid "invalid saved time"
-msgstr "ä¸æ£ãªä¿åæå»"
+msgstr "ä¸æ£ãªä¿åæå»ã§ã"
#: timezone/zic.c:993
msgid "wrong number of fields on Zone line"
@@ -6932,23 +6929,23 @@
#: timezone/zic.c:2613
msgid "time zone abbreviation lacks alphabetic at start"
-msgstr ""
+msgstr "ã¿ã¤ã ã¾ã¼ã³çç¥åãã¢ã«ãã¡ãããã§éå§ãã¦ãã¾ãã"
#: timezone/zic.c:2615
msgid "time zone abbreviation has more than 3 alphabetics"
-msgstr ""
+msgstr "ã¿ã¤ã ã¾ã¼ã³çç¥åãã¢ã«ãã¡ããã4æå以ä¸ã§ã"
#: timezone/zic.c:2617
msgid "time zone abbreviation has too many alphabetics"
-msgstr ""
+msgstr "ã¿ã¤ã ã¾ã¼ã³çç¥åã«å«ã¾ããã¢ã«ãã¡ããããå¤ããã¾ã"
#: timezone/zic.c:2627
msgid "time zone abbreviation differs from POSIX standard"
-msgstr ""
+msgstr "ã¿ã¤ã ã¾ã¼ã³çç¥åã POSIX æ¨æºã¨ç°ãªãã¾ã"
#: timezone/zic.c:2639
msgid "too many, or too long, time zone abbreviations"
-msgstr "ã¿ã¤ã ã¾ã¼ã³ã®çç¥åãå¤ããããé·ããã¾ã"
+msgstr "ã¿ã¤ã ã¾ã¼ã³çç¥åãå¤ããããé·ããã¾ã"
#: timezone/zic.c:2680
#, c-format
Modified: fsf/trunk/libc/posix/glob.h
==============================================================================
--- fsf/trunk/libc/posix/glob.h (original)
+++ fsf/trunk/libc/posix/glob.h Tue Sep 6 00:02:24 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-1998,2000,2001,2004,2010
+/* Copyright (C) 1991,1992,1995-1998,2000,2001,2004,2010,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -26,16 +26,9 @@
/* We need `size_t' for the following definitions. */
#ifndef __size_t
-# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
-# if defined __USE_XOPEN || __USE_XOPEN2K8
+# if defined __USE_XOPEN || __USE_XOPEN2K8
typedef __SIZE_TYPE__ size_t;
-# endif
-# else
-# include <stddef.h>
-# ifndef __size_t
-# define __size_t size_t
-# endif
# endif
#else
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
@@ -143,11 +136,6 @@
} glob64_t;
#endif
-#if __USE_FILE_OFFSET64 && __GNUC__ < 2
-# define glob glob64
-# define globfree globfree64
-#endif
-
/* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil,
@@ -156,7 +144,7 @@
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
-#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
+#if !defined __USE_FILE_OFFSET64
extern int glob (__const char *__restrict __pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__restrict __pglob) __THROW;
Modified: fsf/trunk/libc/posix/spawn.c
==============================================================================
--- fsf/trunk/libc/posix/spawn.c (original)
+++ fsf/trunk/libc/posix/spawn.c Tue Sep 6 00:02:24 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 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
@@ -18,14 +18,31 @@
#include <spawn.h>
#include "spawn_int.h"
+#include <shlib-compat.h>
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
Before running the process perform the actions described in FILE-ACTIONS. */
int
-posix_spawn (pid_t *pid, const char *path,
- const posix_spawn_file_actions_t *file_actions,
- const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[])
+__posix_spawn (pid_t *pid, const char *path,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp, char *const argv[],
+ char *const envp[])
{
return __spawni (pid, path, file_actions, attrp, argv, envp, 0);
}
+versioned_symbol (libc, __posix_spawn, posix_spawn, GLIBC_2_15);
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
+int
+attribute_compat_text_section
+__posix_spawn_compat (pid_t *pid, const char *file,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp, char *const argv[],
+ char *const envp[])
+{
+ return __spawni (pid, file, file_actions, attrp, argv, envp,
+ SPAWN_XFLAGS_TRY_SHELL);
+}
+compat_symbol (libc, __posix_spawn_compat, posix_spawn, GLIBC_2_2);
+#endif
Modified: fsf/trunk/libc/posix/spawn_int.h
==============================================================================
--- fsf/trunk/libc/posix/spawn_int.h (original)
+++ fsf/trunk/libc/posix/spawn_int.h Tue Sep 6 00:02:24 2011
@@ -29,10 +29,13 @@
} action;
};
+#define SPAWN_XFLAGS_USE_PATH 0x1
+#define SPAWN_XFLAGS_TRY_SHELL 0x2
+
extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
file_actions);
extern int __spawni (pid_t *pid, const char *path,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[], int use_path);
+ char *const envp[], int xflags);
Modified: fsf/trunk/libc/posix/spawni.c
==============================================================================
--- fsf/trunk/libc/posix/spawni.c (original)
+++ fsf/trunk/libc/posix/spawni.c Tue Sep 6 00:02:24 2011
@@ -1,5 +1,5 @@
/* Guts of POSIX spawn interface. Stub version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 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
@@ -36,7 +36,7 @@
__spawni (pid_t *pid, const char *file,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[], int use_path)
+ char *const envp[], int xflags)
{
__set_errno (ENOSYS);
return -1;
Modified: fsf/trunk/libc/posix/spawnp.c
==============================================================================
--- fsf/trunk/libc/posix/spawnp.c (original)
+++ fsf/trunk/libc/posix/spawnp.c Tue Sep 6 00:02:24 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 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
@@ -18,14 +18,32 @@
#include <spawn.h>
#include "spawn_int.h"
+#include <shlib-compat.h>
/* Spawn a new process executing FILE with the attributes describes in *ATTRP.
Before running the process perform the actions described in FILE-ACTIONS. */
int
-posix_spawnp (pid_t *pid, const char *file,
- const posix_spawn_file_actions_t *file_actions,
- const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[])
+__posix_spawnp (pid_t *pid, const char *file,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp, char *const argv[],
+ char *const envp[])
{
- return __spawni (pid, file, file_actions, attrp, argv, envp, 1);
+ return __spawni (pid, file, file_actions, attrp, argv, envp,
+ SPAWN_XFLAGS_USE_PATH);
}
+versioned_symbol (libc, __posix_spawnp, posix_spawnp, GLIBC_2_15);
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
+int
+attribute_compat_text_section
+__posix_spawnp_compat (pid_t *pid, const char *file,
+ const posix_spawn_file_actions_t *file_actions,
+ const posix_spawnattr_t *attrp, char *const argv[],
+ char *const envp[])
+{
+ return __spawni (pid, file, file_actions, attrp, argv, envp,
+ SPAWN_XFLAGS_USE_PATH | SPAWN_XFLAGS_TRY_SHELL);
+}
+compat_symbol (libc, __posix_spawnp_compat, posix_spawnp, GLIBC_2_2);
+#endif
Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/Makefile Tue Sep 6 00:02:24 2011
@@ -13,7 +13,9 @@
strlen-sse2 strlen-sse2-bsf strncpy-c strcpy-ssse3 \
strncpy-ssse3 stpcpy-ssse3 stpncpy-ssse3 strcpy-sse2 \
strncpy-sse2 stpcpy-sse2 stpncpy-sse2 strcat-ssse3 \
- strcat-sse2 strncat-ssse3 strncat-sse2 strncat-c
+ strcat-sse2 strncat-ssse3 strncat-sse2 strncat-c \
+ strchr-sse2 strrchr-sse2 strchr-sse2-bsf strrchr-sse2-bsf \
+ wcscmp-sse2 wcscmp-c
ifeq (yes,$(config-cflags-sse4))
sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c
CFLAGS-varshift.c += -msse4
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,159 @@
+/* strchr with SSE2 with bsf
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 8
+# define ENTRANCE PUSH(%edi)
+# define RETURN POP(%edi); ret; CFI_PUSH(%edi);
+
+# define STR1 PARMS
+# define STR2 STR1+4
+
+ .text
+ENTRY (__strchr_sse2_bsf)
+
+ ENTRANCE
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+
+ pxor %xmm2, %xmm2
+ mov %ecx, %edi
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+ /* ECX has OFFSET. */
+ and $15, %ecx
+ pshufd $0, %xmm1, %xmm1
+ je L(loop)
+
+/* Handle unaligned string. */
+ and $-16, %edi
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm2, %edx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ /* Remove the leading bytes. */
+ sarl %cl, %edx
+ sarl %cl, %eax
+ test %eax, %eax
+ je L(unaligned_no_match)
+ /* Check which byte is a match. */
+ bsf %eax, %eax
+ /* Is there a NULL? */
+ test %edx, %edx
+ je L(unaligned_match)
+ bsf %edx, %edx
+ cmpl %edx, %eax
+ /* Return NULL if NULL comes first. */
+ ja L(return_null)
+L(unaligned_match):
+ add %edi, %eax
+ add %ecx, %eax
+ RETURN
+
+ .p2align 4
+L(unaligned_no_match):
+ test %edx, %edx
+ jne L(return_null)
+ pxor %xmm2, %xmm2
+
+ add $16, %edi
+
+ .p2align 4
+/* Loop start on aligned string. */
+L(loop):
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ or %eax, %edx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ or %eax, %edx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ or %eax, %edx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ or %eax, %edx
+ jnz L(matches)
+ jmp L(loop)
+
+L(matches):
+ pmovmskb %xmm2, %edx
+ test %eax, %eax
+ jz L(return_null)
+ bsf %eax, %eax
+ /* There is a match. First find where NULL is. */
+ test %edx, %edx
+ je L(match)
+ bsf %edx, %ecx
+ /* Check if NULL comes first. */
+ cmpl %ecx, %eax
+ ja L(return_null)
+L(match):
+ sub $16, %edi
+ add %edi, %eax
+ RETURN
+
+/* Return NULL. */
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ RETURN
+
+END (__strchr_sse2_bsf)
+#endif
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,349 @@
+/* strchr SSE2 without bsf
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 8
+# define ENTRANCE PUSH(%edi)
+# define RETURN POP(%edi); ret; CFI_PUSH(%edi);
+
+# define STR1 PARMS
+# define STR2 STR1+4
+
+ .text
+ENTRY (__strchr_sse2)
+
+ ENTRANCE
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+
+ pxor %xmm2, %xmm2
+ mov %ecx, %edi
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+ /* ECX has OFFSET. */
+ and $15, %ecx
+ pshufd $0, %xmm1, %xmm1
+ je L(loop)
+
+/* Handle unaligned string. */
+ and $-16, %edi
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm2, %edx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ /* Remove the leading bytes. */
+ sarl %cl, %edx
+ sarl %cl, %eax
+ test %eax, %eax
+ jz L(unaligned_no_match)
+ /* Check which byte is a match. */
+ /* Is there a NULL? */
+ add %ecx, %edi
+ test %edx, %edx
+ jz L(match_case1)
+ jmp L(match_case2)
+
+ .p2align 4
+L(unaligned_no_match):
+ test %edx, %edx
+ jne L(return_null)
+
+ pxor %xmm2, %xmm2
+ add $16, %edi
+
+ .p2align 4
+/* Loop start on aligned string. */
+L(loop):
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+ test %edx, %edx
+ jnz L(return_null)
+ add $16, %edi
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+ test %edx, %edx
+ jnz L(return_null)
+ add $16, %edi
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+ test %edx, %edx
+ jnz L(return_null)
+ add $16, %edi
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %edx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+ test %edx, %edx
+ jnz L(return_null)
+ add $16, %edi
+ jmp L(loop)
+
+L(matches):
+ /* There is a match. First find where NULL is. */
+ test %edx, %edx
+ jz L(match_case1)
+
+ .p2align 4
+L(match_case2):
+ test %al, %al
+ jz L(match_higth_case2)
+
+ mov %al, %cl
+ and $15, %cl
+ jnz L(match_case2_4)
+
+ mov %dl, %ch
+ and $15, %ch
+ jnz L(return_null)
+
+ test $0x10, %al
+ jnz L(Exit5)
+ test $0x10, %dl
+ jnz L(return_null)
+ test $0x20, %al
+ jnz L(Exit6)
+ test $0x20, %dl
+ jnz L(return_null)
+ test $0x40, %al
+ jnz L(Exit7)
+ test $0x40, %dl
+ jnz L(return_null)
+ lea 7(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case2_4):
+ test $0x01, %al
+ jnz L(Exit1)
+ test $0x01, %dl
+ jnz L(return_null)
+ test $0x02, %al
+ jnz L(Exit2)
+ test $0x02, %dl
+ jnz L(return_null)
+ test $0x04, %al
+ jnz L(Exit3)
+ test $0x04, %dl
+ jnz L(return_null)
+ lea 3(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_higth_case2):
+ test %dl, %dl
+ jnz L(return_null)
+
+ mov %ah, %cl
+ and $15, %cl
+ jnz L(match_case2_12)
+
+ mov %dh, %ch
+ and $15, %ch
+ jnz L(return_null)
+
+ test $0x10, %ah
+ jnz L(Exit13)
+ test $0x10, %dh
+ jnz L(return_null)
+ test $0x20, %ah
+ jnz L(Exit14)
+ test $0x20, %dh
+ jnz L(return_null)
+ test $0x40, %ah
+ jnz L(Exit15)
+ test $0x40, %dh
+ jnz L(return_null)
+ lea 15(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case2_12):
+ test $0x01, %ah
+ jnz L(Exit9)
+ test $0x01, %dh
+ jnz L(return_null)
+ test $0x02, %ah
+ jnz L(Exit10)
+ test $0x02, %dh
+ jnz L(return_null)
+ test $0x04, %ah
+ jnz L(Exit11)
+ test $0x04, %dh
+ jnz L(return_null)
+ lea 11(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case1):
+ test %al, %al
+ jz L(match_higth_case1)
+
+ test $0x01, %al
+ jnz L(Exit1)
+ test $0x02, %al
+ jnz L(Exit2)
+ test $0x04, %al
+ jnz L(Exit3)
+ test $0x08, %al
+ jnz L(Exit4)
+ test $0x10, %al
+ jnz L(Exit5)
+ test $0x20, %al
+ jnz L(Exit6)
+ test $0x40, %al
+ jnz L(Exit7)
+ lea 7(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_higth_case1):
+ test $0x01, %ah
+ jnz L(Exit9)
+ test $0x02, %ah
+ jnz L(Exit10)
+ test $0x04, %ah
+ jnz L(Exit11)
+ test $0x08, %ah
+ jnz L(Exit12)
+ test $0x10, %ah
+ jnz L(Exit13)
+ test $0x20, %ah
+ jnz L(Exit14)
+ test $0x40, %ah
+ jnz L(Exit15)
+ lea 15(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit1):
+ lea (%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit2):
+ lea 1(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit3):
+ lea 2(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit4):
+ lea 3(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit5):
+ lea 4(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit6):
+ lea 5(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit7):
+ lea 6(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit9):
+ lea 8(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit10):
+ lea 9(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit11):
+ lea 10(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit12):
+ lea 11(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit13):
+ lea 12(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit14):
+ lea 13(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit15):
+ lea 14(%edi), %eax
+ RETURN
+
+/* Return NULL. */
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ RETURN
+
+END (__strchr_sse2)
+#endif
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strchr.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,76 @@
+/* Multiple versions of strchr
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .text
+ENTRY(strchr)
+ .type strchr, @gnu_indirect_function
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+1: leal __strchr_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __strchr_sse2_bsf@GOTOFF(%ebx), %eax
+ testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __strchr_sse2@GOTOFF(%ebx), %eax
+2: popl %ebx
+ cfi_adjust_cfa_offset (-4);
+ cfi_restore (ebx)
+ 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"
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,283 @@
+/* strrchr with SSE2 with bsf and bsr
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 4
+# define STR1 PARMS
+# define STR2 STR1+4
+
+ .text
+ENTRY (__strrchr_sse2_bsf)
+
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+
+ PUSH (%edi)
+ pxor %xmm2, %xmm2
+ mov %ecx, %edi
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+ /* ECX has OFFSET. */
+ and $63, %ecx
+ cmp $48, %ecx
+ pshufd $0, %xmm1, %xmm1
+ ja L(crosscashe)
+
+/* unaligned string. */
+ movdqu (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm2, %edx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+
+ test %eax, %eax
+ jnz L(unaligned_match1)
+
+ test %edx, %edx
+ jnz L(return_null)
+
+ and $-16, %edi
+ add $16, %edi
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ xor %ebx, %ebx
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+L(unaligned_return_value1):
+ bsf %edx, %ecx
+ mov $2, %edx
+ shl %cl, %edx
+ sub $1, %edx
+ and %edx, %eax
+ jz L(return_null)
+ bsr %eax, %eax
+ add %edi, %eax
+ POP (%edi)
+ ret
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(unaligned_match1):
+ test %edx, %edx
+ jnz L(unaligned_return_value1)
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ mov %eax, %ebx
+ lea 16(%edi), %esi
+ and $-16, %edi
+ add $16, %edi
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+ L(crosscashe):
+/* Hancle unaligned string. */
+ and $15, %ecx
+ and $-16, %edi
+ pxor %xmm3, %xmm3
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm3
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm3, %edx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ /* Remove the leading bytes. */
+ shr %cl, %edx
+ shr %cl, %eax
+
+ test %eax, %eax
+ jnz L(unaligned_match)
+
+ test %edx, %edx
+ jnz L(return_null)
+
+ add $16, %edi
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ xor %ebx, %ebx
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+L(unaligned_return_value):
+ add %ecx, %edi
+ bsf %edx, %ecx
+ mov $2, %edx
+ shl %cl, %edx
+ sub $1, %edx
+ and %edx, %eax
+ jz L(return_null)
+ bsr %eax, %eax
+ add %edi, %eax
+ POP (%edi)
+ ret
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(unaligned_match):
+ test %edx, %edx
+ jnz L(unaligned_return_value)
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ mov %eax, %ebx
+ add $16, %edi
+ lea (%edi, %ecx), %esi
+
+/* Loop start on aligned string. */
+ .p2align 4
+L(loop):
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jz L(loop)
+
+L(matches):
+ test %eax, %eax
+ jnz L(match)
+L(return_value):
+ test %ebx, %ebx
+ jz L(return_null_1)
+ bsr %ebx, %eax
+ add %esi, %eax
+
+ POP (%ebx)
+ POP (%esi)
+
+ sub $16, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(match):
+ pmovmskb %xmm2, %ecx
+ test %ecx, %ecx
+ jnz L(return_value_1)
+ mov %eax, %ebx
+ mov %edi, %esi
+ jmp L(loop)
+
+ .p2align 4
+L(return_value_1):
+ bsf %ecx, %ecx
+ mov $2, %edx
+ shl %cl, %edx
+ sub $1, %edx
+ and %edx, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+
+ bsr %eax, %eax
+ add %edi, %eax
+ sub $16, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+/* Return NULL. */
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+/* Return NULL. */
+ .p2align 4
+L(return_null_1):
+ POP (%ebx)
+ POP (%esi)
+ POP (%edi)
+ xor %eax, %eax
+ ret
+
+END (__strrchr_sse2_bsf)
+#endif
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,709 @@
+/* strrchr SSE2 without bsf and bsr
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 8
+# define ENTRANCE PUSH(%edi);
+# define RETURN POP(%edi); ret; CFI_PUSH(%edi);
+
+# define STR1 PARMS
+# define STR2 STR1+4
+
+ .text
+ENTRY (__strrchr_sse2)
+
+ ENTRANCE
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+
+ pxor %xmm2, %xmm2
+ mov %ecx, %edi
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+ /* ECX has OFFSET. */
+ and $63, %ecx
+ cmp $48, %ecx
+ pshufd $0, %xmm1, %xmm1
+ ja L(crosscache)
+
+/* unaligned string. */
+ movdqu (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm2, %ecx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ add $16, %edi
+
+ test %eax, %eax
+ jnz L(unaligned_match1)
+
+ test %ecx, %ecx
+ jnz L(return_null)
+
+ and $-16, %edi
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ xor %ebx, %ebx
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+L(unaligned_match1):
+ test %ecx, %ecx
+ jnz L(prolog_find_zero_1)
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ mov %eax, %ebx
+ mov %edi, %esi
+ and $-16, %edi
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+L(crosscache):
+/* Hancle unaligned string. */
+ and $15, %ecx
+ and $-16, %edi
+ pxor %xmm3, %xmm3
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm3
+ pcmpeqb %xmm1, %xmm0
+ /* Find where NULL is. */
+ pmovmskb %xmm3, %edx
+ /* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ /* Remove the leading bytes. */
+ shr %cl, %edx
+ shr %cl, %eax
+ add $16, %edi
+
+ test %eax, %eax
+ jnz L(unaligned_match)
+
+ test %edx, %edx
+ jnz L(return_null)
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ xor %ebx, %ebx
+ jmp L(loop)
+
+ CFI_POP (%esi)
+ CFI_POP (%ebx)
+
+ .p2align 4
+L(unaligned_match):
+ test %edx, %edx
+ jnz L(prolog_find_zero)
+
+ PUSH (%esi)
+ PUSH (%ebx)
+
+ mov %eax, %ebx
+ lea (%edi, %ecx), %esi
+
+/* Loop start on aligned string. */
+ .p2align 4
+L(loop):
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jnz L(matches)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm0, %xmm2
+ add $16, %edi
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm2, %ecx
+ pmovmskb %xmm0, %eax
+ or %eax, %ecx
+ jz L(loop)
+
+L(matches):
+ test %eax, %eax
+ jnz L(match)
+L(return_value):
+ test %ebx, %ebx
+ jz L(return_null_1)
+ mov %ebx, %eax
+ mov %esi, %edi
+
+ POP (%ebx)
+ POP (%esi)
+
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(return_null_1):
+ POP (%ebx)
+ POP (%esi)
+
+ xor %eax, %eax
+ RETURN
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(match):
+ pmovmskb %xmm2, %ecx
+ test %ecx, %ecx
+ jnz L(find_zero)
+ mov %eax, %ebx
+ mov %edi, %esi
+ jmp L(loop)
+
+ .p2align 4
+L(find_zero):
+ test %cl, %cl
+ jz L(find_zero_high)
+ mov %cl, %dl
+ and $15, %dl
+ jz L(find_zero_8)
+ test $0x01, %cl
+ jnz L(FindZeroExit1)
+ test $0x02, %cl
+ jnz L(FindZeroExit2)
+ test $0x04, %cl
+ jnz L(FindZeroExit3)
+ and $1 << 4 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(find_zero_8):
+ test $0x10, %cl
+ jnz L(FindZeroExit5)
+ test $0x20, %cl
+ jnz L(FindZeroExit6)
+ test $0x40, %cl
+ jnz L(FindZeroExit7)
+ and $1 << 8 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(find_zero_high):
+ mov %ch, %dh
+ and $15, %dh
+ jz L(find_zero_high_8)
+ test $0x01, %ch
+ jnz L(FindZeroExit9)
+ test $0x02, %ch
+ jnz L(FindZeroExit10)
+ test $0x04, %ch
+ jnz L(FindZeroExit11)
+ and $1 << 12 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(find_zero_high_8):
+ test $0x10, %ch
+ jnz L(FindZeroExit13)
+ test $0x20, %ch
+ jnz L(FindZeroExit14)
+ test $0x40, %ch
+ jnz L(FindZeroExit15)
+ and $1 << 16 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit1):
+ and $1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit2):
+ and $1 << 2 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit3):
+ and $1 << 3 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit5):
+ and $1 << 5 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit6):
+ and $1 << 6 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit7):
+ and $1 << 7 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit9):
+ and $1 << 9 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit10):
+ and $1 << 10 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit11):
+ and $1 << 11 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit13):
+ and $1 << 13 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit14):
+ and $1 << 14 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+ jmp L(match_exit)
+
+ CFI_PUSH (%ebx)
+ CFI_PUSH (%esi)
+
+ .p2align 4
+L(FindZeroExit15):
+ and $1 << 15 - 1, %eax
+ jz L(return_value)
+
+ POP (%ebx)
+ POP (%esi)
+
+ .p2align 4
+L(match_exit):
+ test %ah, %ah
+ jnz L(match_exit_high)
+ mov %al, %dl
+ and $15 << 4, %dl
+ jnz L(match_exit_8)
+ test $0x08, %al
+ jnz L(Exit4)
+ test $0x04, %al
+ jnz L(Exit3)
+ test $0x02, %al
+ jnz L(Exit2)
+ lea -16(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_exit_8):
+ test $0x80, %al
+ jnz L(Exit8)
+ test $0x40, %al
+ jnz L(Exit7)
+ test $0x20, %al
+ jnz L(Exit6)
+ lea -12(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_exit_high):
+ mov %ah, %dh
+ and $15 << 4, %dh
+ jnz L(match_exit_high_8)
+ test $0x08, %ah
+ jnz L(Exit12)
+ test $0x04, %ah
+ jnz L(Exit11)
+ test $0x02, %ah
+ jnz L(Exit10)
+ lea -8(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_exit_high_8):
+ test $0x80, %ah
+ jnz L(Exit16)
+ test $0x40, %ah
+ jnz L(Exit15)
+ test $0x20, %ah
+ jnz L(Exit14)
+ lea -4(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit2):
+ lea -15(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit3):
+ lea -14(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit4):
+ lea -13(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit6):
+ lea -11(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit7):
+ lea -10(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit8):
+ lea -9(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit10):
+ lea -7(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit11):
+ lea -6(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit12):
+ lea -5(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit14):
+ lea -3(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit15):
+ lea -2(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(Exit16):
+ lea -1(%edi), %eax
+ RETURN
+
+/* Return NULL. */
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(prolog_find_zero):
+ add %ecx, %edi
+ mov %edx, %ecx
+L(prolog_find_zero_1):
+ test %cl, %cl
+ jz L(prolog_find_zero_high)
+ mov %cl, %dl
+ and $15, %dl
+ jz L(prolog_find_zero_8)
+ test $0x01, %cl
+ jnz L(PrologFindZeroExit1)
+ test $0x02, %cl
+ jnz L(PrologFindZeroExit2)
+ test $0x04, %cl
+ jnz L(PrologFindZeroExit3)
+ and $1 << 4 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(prolog_find_zero_8):
+ test $0x10, %cl
+ jnz L(PrologFindZeroExit5)
+ test $0x20, %cl
+ jnz L(PrologFindZeroExit6)
+ test $0x40, %cl
+ jnz L(PrologFindZeroExit7)
+ and $1 << 8 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(prolog_find_zero_high):
+ mov %ch, %dh
+ and $15, %dh
+ jz L(prolog_find_zero_high_8)
+ test $0x01, %ch
+ jnz L(PrologFindZeroExit9)
+ test $0x02, %ch
+ jnz L(PrologFindZeroExit10)
+ test $0x04, %ch
+ jnz L(PrologFindZeroExit11)
+ and $1 << 12 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(prolog_find_zero_high_8):
+ test $0x10, %ch
+ jnz L(PrologFindZeroExit13)
+ test $0x20, %ch
+ jnz L(PrologFindZeroExit14)
+ test $0x40, %ch
+ jnz L(PrologFindZeroExit15)
+ and $1 << 16 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit1):
+ and $1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit2):
+ and $1 << 2 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit3):
+ and $1 << 3 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit5):
+ and $1 << 5 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit6):
+ and $1 << 6 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit7):
+ and $1 << 7 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit9):
+ and $1 << 9 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit10):
+ and $1 << 10 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit11):
+ and $1 << 11 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit13):
+ and $1 << 13 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit14):
+ and $1 << 14 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(PrologFindZeroExit15):
+ and $1 << 15 - 1, %eax
+ jnz L(match_exit)
+ xor %eax, %eax
+ RETURN
+
+END (__strrchr_sse2)
+#endif
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/strrchr.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,76 @@
+/* Multiple versions of strrchr
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .text
+ENTRY(strrchr)
+ .type strrchr, @gnu_indirect_function
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+1: leal __strrchr_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __strrchr_sse2_bsf@GOTOFF(%ebx), %eax
+ testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __strrchr_sse2@GOTOFF(%ebx), %eax
+2: popl %ebx
+ cfi_adjust_cfa_offset (-4);
+ cfi_restore (ebx)
+ ret
+END(strrchr)
+
+# undef ENTRY
+# define ENTRY(name) \
+ .type __strrchr_ia32, @function; \
+ .globl __strrchr_ia32; \
+ .p2align 4; \
+ __strrchr_ia32: cfi_startproc; \
+ CALL_MCOUNT
+# undef END
+# define END(name) \
+ cfi_endproc; .size __strrchr_ia32, .-__strrchr_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_strrchr; __GI_strrchr = __strrchr_ia32
+#endif
+
+#include "../../strrchr.S"
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-c.c Tue Sep 6 00:02:24 2011
@@ -1,0 +1,10 @@
+#ifndef NOT_IN_libc
+
+# define WCSCMP __wcscmp_ia32
+
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__wcscmp_ia32, __GI_wcscmp, __wcscmp_ia32);
+#endif
+
+#include "wcsmbs/wcscmp.c"
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,1003 @@
+/* wcscmp with SSE2
+ Copyright (C) 2011 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+# include "asm-syntax.h"
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# ifndef STRCMP
+# define STRCMP __wcscmp_sse2
+# endif
+
+# define ENTRANCE PUSH(%esi); PUSH(%edi)
+# define RETURN POP(%edi); POP(%esi); ret; CFI_PUSH(%esi); CFI_PUSH(%edi);
+# define PARMS 4
+# define STR1 PARMS
+# define STR2 STR1+4
+
+ .text
+ENTRY (STRCMP)
+/*
+ * This implementation uses SSE to compare up to 16 bytes at a time.
+*/
+ mov STR1(%esp), %edx
+ mov STR2(%esp), %eax
+
+ mov (%eax), %ecx
+ cmp %ecx, (%edx)
+ jne L(neq)
+ test %ecx, %ecx
+ jz L(eq)
+
+ mov 4(%eax), %ecx
+ cmp %ecx, 4(%edx)
+ jne L(neq)
+ test %ecx, %ecx
+ jz L(eq)
+
+ mov 8(%eax), %ecx
+ cmp %ecx, 8(%edx)
+ jne L(neq)
+ test %ecx, %ecx
+ jz L(eq)
+
+ mov 12(%eax), %ecx
+ cmp %ecx, 12(%edx)
+ jne L(neq)
+ test %ecx, %ecx
+ jz L(eq)
+
+ ENTRANCE
+ add $16, %eax
+ add $16, %edx
+
+ mov %eax, %esi
+ mov %edx, %edi
+ pxor %xmm0, %xmm0 /* clear %xmm0 for null char checks */
+ mov %al, %ch
+ mov %dl, %cl
+ and $63, %eax /* esi alignment in cache line */
+ and $63, %edx /* edi alignment in cache line */
+ and $15, %cl
+ jz L(continue_00)
+ cmp $16, %edx
+ jb L(continue_0)
+ cmp $32, %edx
+ jb L(continue_16)
+ cmp $48, %edx
+ jb L(continue_32)
+
+L(continue_48):
+ and $15, %ch
+ jz L(continue_48_00)
+ cmp $16, %eax
+ jb L(continue_0_48)
+ cmp $32, %eax
+ jb L(continue_16_48)
+ cmp $48, %eax
+ jb L(continue_32_48)
+
+ .p2align 4
+L(continue_48_48):
+ mov (%esi), %ecx
+ cmp %ecx, (%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ movdqu 16(%edi), %xmm1
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%edi), %xmm1
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ movdqu 48(%edi), %xmm1
+ movdqu 48(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_48_48)
+
+L(continue_0):
+ and $15, %ch
+ jz L(continue_0_00)
+ cmp $16, %eax
+ jb L(continue_0_0)
+ cmp $32, %eax
+ jb L(continue_0_16)
+ cmp $48, %eax
+ jb L(continue_0_32)
+
+ .p2align 4
+L(continue_0_48):
+ mov (%esi), %ecx
+ cmp %ecx, (%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ movdqu 16(%edi), %xmm1
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%edi), %xmm1
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ mov 48(%esi), %ecx
+ cmp %ecx, 48(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 52(%esi), %ecx
+ cmp %ecx, 52(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 56(%esi), %ecx
+ cmp %ecx, 56(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 60(%esi), %ecx
+ cmp %ecx, 60(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_0_48)
+
+ .p2align 4
+L(continue_00):
+ and $15, %ch
+ jz L(continue_00_00)
+ cmp $16, %eax
+ jb L(continue_00_0)
+ cmp $32, %eax
+ jb L(continue_00_16)
+ cmp $48, %eax
+ jb L(continue_00_32)
+
+ .p2align 4
+L(continue_00_48):
+ pcmpeqd (%edi), %xmm0
+ mov (%edi), %eax
+ pmovmskb %xmm0, %ecx
+ test %ecx, %ecx
+ jnz L(less4_double_words1)
+
+ sub (%esi), %eax
+ jnz L(return)
+
+ mov 4(%edi), %eax
+ sub 4(%esi), %eax
+ jnz L(return)
+
+ mov 8(%edi), %eax
+ sub 8(%esi), %eax
+ jnz L(return)
+
+ mov 12(%edi), %eax
+ sub 12(%esi), %eax
+ jnz L(return)
+
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 32(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ movdqu 48(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 48(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_00_48)
+
+ .p2align 4
+L(continue_32):
+ and $15, %ch
+ jz L(continue_32_00)
+ cmp $16, %eax
+ jb L(continue_0_32)
+ cmp $32, %eax
+ jb L(continue_16_32)
+ cmp $48, %eax
+ jb L(continue_32_32)
+
+ .p2align 4
+L(continue_32_48):
+ mov (%esi), %ecx
+ cmp %ecx, (%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 16(%esi), %ecx
+ cmp %ecx, 16(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 20(%esi), %ecx
+ cmp %ecx, 20(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 24(%esi), %ecx
+ cmp %ecx, 24(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 28(%esi), %ecx
+ cmp %ecx, 28(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ movdqu 32(%edi), %xmm1
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ movdqu 48(%edi), %xmm1
+ movdqu 48(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_32_48)
+
+ .p2align 4
+L(continue_16):
+ and $15, %ch
+ jz L(continue_16_00)
+ cmp $16, %eax
+ jb L(continue_0_16)
+ cmp $32, %eax
+ jb L(continue_16_16)
+ cmp $48, %eax
+ jb L(continue_16_32)
+
+ .p2align 4
+L(continue_16_48):
+ mov (%esi), %ecx
+ cmp %ecx, (%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ movdqu 16(%edi), %xmm1
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ mov 32(%esi), %ecx
+ cmp %ecx, 32(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 36(%esi), %ecx
+ cmp %ecx, 36(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 40(%esi), %ecx
+ cmp %ecx, 40(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 44(%esi), %ecx
+ cmp %ecx, 44(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ movdqu 48(%edi), %xmm1
+ movdqu 48(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_16_48)
+
+ .p2align 4
+L(continue_00_00):
+ movdqa (%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd (%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqa 16(%edi), %xmm3
+ pcmpeqd %xmm3, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%esi), %xmm3 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm3 /* packed sub of comparison results*/
+ pmovmskb %xmm3, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqa 32(%edi), %xmm5
+ pcmpeqd %xmm5, %xmm0 /* Any null double_word? */
+ pcmpeqd 32(%esi), %xmm5 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm5 /* packed sub of comparison results*/
+ pmovmskb %xmm5, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ movdqa 48(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 48(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_00_00)
+
+ .p2align 4
+L(continue_00_32):
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd (%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ add $16, %esi
+ add $16, %edi
+ jmp L(continue_00_48)
+
+ .p2align 4
+L(continue_00_16):
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd (%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ add $32, %esi
+ add $32, %edi
+ jmp L(continue_00_48)
+
+ .p2align 4
+L(continue_00_0):
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd (%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
+ pcmpeqd 32(%edi), %xmm2 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ add $48, %esi
+ add $48, %edi
+ jmp L(continue_00_48)
+
+ .p2align 4
+L(continue_48_00):
+ pcmpeqd (%esi), %xmm0
+ mov (%edi), %eax
+ pmovmskb %xmm0, %ecx
+ test %ecx, %ecx
+ jnz L(less4_double_words1)
+
+ sub (%esi), %eax
+ jnz L(return)
+
+ mov 4(%edi), %eax
+ sub 4(%esi), %eax
+ jnz L(return)
+
+ mov 8(%edi), %eax
+ sub 8(%esi), %eax
+ jnz L(return)
+
+ mov 12(%edi), %eax
+ sub 12(%esi), %eax
+ jnz L(return)
+
+ movdqu 16(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 32(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ movdqu 48(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 48(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_48)
+
+ add $64, %esi
+ add $64, %edi
+ jmp L(continue_48_00)
+
+ .p2align 4
+L(continue_32_00):
+ movdqu (%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd (%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ add $16, %esi
+ add $16, %edi
+ jmp L(continue_48_00)
+
+ .p2align 4
+L(continue_16_00):
+ movdqu (%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd (%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ add $32, %esi
+ add $32, %edi
+ jmp L(continue_48_00)
+
+ .p2align 4
+L(continue_0_00):
+ movdqu (%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd (%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 16(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%edi), %xmm1
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd 32(%esi), %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ add $48, %esi
+ add $48, %edi
+ jmp L(continue_48_00)
+
+ .p2align 4
+L(continue_32_32):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ add $16, %esi
+ add $16, %edi
+ jmp L(continue_48_48)
+
+ .p2align 4
+L(continue_16_16):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%edi), %xmm3
+ movdqu 16(%esi), %xmm4
+ pcmpeqd %xmm3, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm4, %xmm3 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm3 /* packed sub of comparison results*/
+ pmovmskb %xmm3, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ add $32, %esi
+ add $32, %edi
+ jmp L(continue_48_48)
+
+ .p2align 4
+L(continue_0_0):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%edi), %xmm3
+ movdqu 16(%esi), %xmm4
+ pcmpeqd %xmm3, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm4, %xmm3 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm3 /* packed sub of comparison results*/
+ pmovmskb %xmm3, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ movdqu 32(%edi), %xmm1
+ movdqu 32(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_32)
+
+ add $48, %esi
+ add $48, %edi
+ jmp L(continue_48_48)
+
+ .p2align 4
+L(continue_0_16):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ movdqu 16(%edi), %xmm1
+ movdqu 16(%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words_16)
+
+ add $32, %esi
+ add $32, %edi
+ jmp L(continue_32_48)
+
+ .p2align 4
+L(continue_0_32):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ add $16, %esi
+ add $16, %edi
+ jmp L(continue_16_48)
+
+ .p2align 4
+L(continue_16_32):
+ movdqu (%edi), %xmm1
+ movdqu (%esi), %xmm2
+ pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
+ pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
+ jnz L(less4_double_words)
+
+ add $16, %esi
+ add $16, %edi
+ jmp L(continue_32_48)
+
+ .p2align 4
+L(less4_double_words1):
+ cmp (%esi), %eax
+ jne L(nequal)
+ test %eax, %eax
+ jz L(equal)
+
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
+ test %ecx, %ecx
+ jz L(equal)
+
+ mov 12(%esi), %edx
+ mov 12(%edi), %eax
+ sub %edx, %eax
+ RETURN
+
+ .p2align 4
+L(less4_double_words):
+ test %dl, %dl
+ jz L(next_two_double_words)
+ and $15, %dl
+ jz L(second_double_word)
+ mov (%edi), %eax
+ sub (%esi), %eax
+ RETURN
+
+ .p2align 4
+L(second_double_word):
+ mov 4(%edi), %eax
+ sub 4(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(next_two_double_words):
+ and $15, %dh
+ jz L(fourth_double_word)
+ mov 8(%edi), %eax
+ sub 8(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(fourth_double_word):
+ mov 12(%edi), %eax
+ sub 12(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(less4_double_words_16):
+ test %dl, %dl
+ jz L(next_two_double_words_16)
+ and $15, %dl
+ jz L(second_double_word_16)
+ mov 16(%edi), %eax
+ sub 16(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(second_double_word_16):
+ mov 20(%edi), %eax
+ sub 20(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(next_two_double_words_16):
+ and $15, %dh
+ jz L(fourth_double_word_16)
+ mov 24(%edi), %eax
+ sub 24(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(fourth_double_word_16):
+ mov 28(%edi), %eax
+ sub 28(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(less4_double_words_32):
+ test %dl, %dl
+ jz L(next_two_double_words_32)
+ and $15, %dl
+ jz L(second_double_word_32)
+ mov 32(%edi), %eax
+ sub 32(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(second_double_word_32):
+ mov 36(%edi), %eax
+ sub 36(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(next_two_double_words_32):
+ and $15, %dh
+ jz L(fourth_double_word_32)
+ mov 40(%edi), %eax
+ sub 40(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(fourth_double_word_32):
+ mov 44(%edi), %eax
+ sub 44(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(less4_double_words_48):
+ test %dl, %dl
+ jz L(next_two_double_words_48)
+ and $15, %dl
+ jz L(second_double_word_48)
+ mov 48(%edi), %eax
+ sub 48(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(second_double_word_48):
+ mov 52(%edi), %eax
+ sub 52(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(next_two_double_words_48):
+ and $15, %dh
+ jz L(fourth_double_word_48)
+ mov 56(%edi), %eax
+ sub 56(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(fourth_double_word_48):
+ mov 60(%edi), %eax
+ sub 60(%esi), %eax
+ RETURN
+
+ .p2align 4
+L(return):
+ RETURN
+
+ .p2align 4
+L(nequal):
+ mov $1, %eax
+ ja L(nequal_bigger)
+ neg %eax
+
+L(nequal_bigger):
+ RETURN
+
+ .p2align 4
+L(equal):
+ xorl %eax, %eax
+ RETURN
+
+ CFI_POP (%edi)
+ CFI_POP (%esi)
+
+ .p2align 4
+L(neq):
+ mov $1, %eax
+ ja L(neq_bigger)
+ neg %eax
+
+L(neq_bigger):
+ ret
+
+ .p2align 4
+L(eq):
+ xorl %eax, %eax
+ ret
+
+END (STRCMP)
+#endif
Added: fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp.S (added)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/wcscmp.S Tue Sep 6 00:02:24 2011
@@ -1,0 +1,57 @@
+/* Multiple versions of wcscmp
+ Copyright (C) 2011 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
[... 2265 lines stripped ...]