Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* sysdeps/unix/sysv/linux/x86_64/getcontext.S: Use functionally
	equivalent, but shorter instructions.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Likewise.
	* sysdeps/unix/x86_64/sysdep.S: Likewise.
	* sysdeps/x86_64/strchr.S: Likewise.
	* sysdeps/x86_64/memset.S: Likewise.
	* sysdeps/x86_64/strcspn.S: Likewise.
	* sysdeps/x86_64/strcmp.S: Likewise.
	* sysdeps/x86_64/elf/start.S: Likewise.
	* sysdeps/x86_64/strspn.S: Likewise.
	* sysdeps/x86_64/dl-machine.h: Likewise.
	* sysdeps/x86_64/bsd-_setjmp.S: Likewise.
	* sysdeps/x86_64/bsd-setjmp.S: Likewise.
	* sysdeps/x86_64/strtok.S: Likewise.
  • Loading branch information
Ulrich Drepper committed Mar 31, 2005
1 parent 4d6302c commit ee61898
Show file tree
Hide file tree
Showing 174 changed files with 7,906 additions and 6,547 deletions.
20 changes: 20 additions & 0 deletions ChangeLog
@@ -1,3 +1,23 @@
2005-03-31 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/getcontext.S: Use functionally
equivalent, but shorter instructions.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/setcontext.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Likewise.
* sysdeps/unix/x86_64/sysdep.S: Likewise.
* sysdeps/x86_64/strchr.S: Likewise.
* sysdeps/x86_64/memset.S: Likewise.
* sysdeps/x86_64/strcspn.S: Likewise.
* sysdeps/x86_64/strcmp.S: Likewise.
* sysdeps/x86_64/elf/start.S: Likewise.
* sysdeps/x86_64/strspn.S: Likewise.
* sysdeps/x86_64/dl-machine.h: Likewise.
* sysdeps/x86_64/bsd-_setjmp.S: Likewise.
* sysdeps/x86_64/bsd-setjmp.S: Likewise.
* sysdeps/x86_64/strtok.S: Likewise.

2005-03-30 H.J. Lu <hongjiu.lu@intel.com>

* sysdeps/ia64/fpu/e_acosf.S: Update from Intel libm 2005-03-21.
Expand Down
5 changes: 5 additions & 0 deletions linuxthreads/ChangeLog
@@ -1,3 +1,8 @@
2005-03-31 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Use
functionally equivalent, but shorter instructions.

2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>

* sysdeps/mips/tls.h: New file.
Expand Down
4 changes: 2 additions & 2 deletions linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
Expand Down Expand Up @@ -45,7 +45,7 @@
POPARGS_##args \
/* The return value from CENABLE is argument for CDISABLE. */ \
movq %rax, (%rsp); \
movq $SYS_ify (syscall_name), %rax; \
movl $SYS_ify (syscall_name), %eax; \
syscall; \
movq (%rsp), %rdi; \
/* Save %rax since it's the error code from the syscall. */ \
Expand Down
22 changes: 22 additions & 0 deletions nptl/ChangeLog
@@ -1,3 +1,25 @@
2005-03-31 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
functionally equivalent, but shorter instructions.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.

2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>

* sysdeps/mips/Makefile: New file.
Expand Down
38 changes: 25 additions & 13 deletions nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -48,12 +48,16 @@ __lll_mutex_lock_wait:

xorq %r10, %r10 /* No timeout. */
movl $2, %edx
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
#if FUTEX_WAIT == 0
xorl %esi, %esi
#else
movl $FUTEX_WAIT, %esi
#endif

cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f

1: movq $SYS_futex, %rax
1: movl $SYS_futex, %eax
syscall

2: movl %edx, %eax
Expand Down Expand Up @@ -93,15 +97,15 @@ __lll_mutex_timedlock_wait:
1:
/* Get current time. */
movq %rsp, %rdi
xorq %rsi, %rsi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
/* This is a regular function call, all caller-save registers
might be clobbered. */
callq *%rax

/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
movl $1000, %edi
mul %rdi /* Milli seconds to nano seconds. */
movq (%r13), %rdi
movq 8(%r13), %rsi
Expand All @@ -126,9 +130,13 @@ __lll_mutex_timedlock_wait:
je 8f

movq %rsp, %r10
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
#if FUTEX_WAIT == 0
xorl %esi, %esi
#else
movl $FUTEX_WAIT, %esi
#endif
movq %r12, %rdi
movq $SYS_futex, %rax
movl $SYS_futex, %eax
syscall
movq %rax, %rcx

Expand Down Expand Up @@ -195,9 +203,9 @@ __lll_mutex_unlock_wake:
pushq %rdx

movl $0, (%rdi)
movq $FUTEX_WAKE, %rsi
movl $FUTEX_WAKE, %esi
movl $1, %edx /* Wake one thread. */
movq $SYS_futex, %rax
movl $SYS_futex, %eax
syscall

popq %rdx
Expand All @@ -222,13 +230,13 @@ __lll_timedwait_tid:

/* Get current time. */
2: movq %rsp, %rdi
xorq %rsi, %rsi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
callq *%rax

/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
movl $1000, %edi
mul %rdi /* Milli seconds to nano seconds. */
movq (%r13), %rdi
movq 8(%r13), %rsi
Expand All @@ -248,9 +256,13 @@ __lll_timedwait_tid:
jz 4f

movq %rsp, %r10
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
#if FUTEX_WAIT == 0
xorl %esi, %esi
#else
movl $FUTEX_WAIT, %esi
#endif
movq %r12, %rdi
movq $SYS_futex, %rax
movl $SYS_futex, %eax
syscall

cmpl $0, (%rdi)
Expand Down
15 changes: 10 additions & 5 deletions nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -63,9 +63,14 @@ pthread_barrier_wait:

/* Wait for the remaining threads. The call will return immediately
if the CURR_EVENT memory has meanwhile been changed. */
7: xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
7:
#if FUTEX_WAIT == 0
xorl %esi, %esi
#else
movl $FUTEX_WAIT, %esi
#endif
xorq %r10, %r10
8: movq $SYS_futex, %rax
8: movl $SYS_futex, %eax
syscall

/* Don't return on spurious wakeups. The syscall does not change
Expand Down Expand Up @@ -110,8 +115,8 @@ pthread_barrier_wait:
/* Wake up all waiters. The count is a signed number in the kernel
so 0x7fffffff is the highest value. */
movl $0x7fffffff, %edx
movq $FUTEX_WAKE, %rsi
movq $SYS_futex, %rax
movl $FUTEX_WAKE, %esi
movl $SYS_futex, %eax
syscall

/* Increment LEFT. If this brings the count back to the
Expand Down
14 changes: 7 additions & 7 deletions nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -81,10 +81,10 @@ __pthread_cond_broadcast:
je 9f

/* Wake up all threads. */
movq $FUTEX_CMP_REQUEUE, %rsi
movq $SYS_futex, %rax
movl $FUTEX_CMP_REQUEUE, %esi
movl $SYS_futex, %eax
movl $1, %edx
movq $0x7fffffff, %r10
movl $0x7fffffff, %r10d
syscall

/* For any kind of error, which mainly is EAGAIN, we try again
Expand Down Expand Up @@ -128,9 +128,9 @@ __pthread_cond_broadcast:
jmp 8b

9: /* The futex requeue functionality is not available. */
movq $0x7fffffff, %rdx
movq $FUTEX_WAKE, %rsi
movq $SYS_futex, %rax
movl $0x7fffffff, %edx
movl $FUTEX_WAKE, %esi
movl $SYS_futex, %eax
syscall
jmp 10b
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
Expand Down
8 changes: 4 additions & 4 deletions nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -66,9 +66,9 @@ __pthread_cond_signal:
addl $1, (%rdi)

/* Wake up one thread. */
movq $FUTEX_WAKE, %rsi
movq $SYS_futex, %rax
movq $1, %rdx
movl $FUTEX_WAKE, %esi
movl $SYS_futex, %eax
movl $1, %edx
syscall

/* Unlock. */
Expand Down
30 changes: 17 additions & 13 deletions nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -56,7 +56,7 @@ __pthread_cond_timedwait:
.Lsubq:

cmpq $1000000000, 8(%rdx)
movq $EINVAL, %rax
movl $EINVAL, %eax
jae 18f

/* Stack frame:
Expand Down Expand Up @@ -102,7 +102,7 @@ __pthread_cond_timedwait:

/* Unlock the mutex. */
2: movq 16(%rsp), %rdi
xorq %rsi, %rsi
xorl %esi, %esi
callq __pthread_mutex_unlock_usercnt

testl %eax, %eax
Expand Down Expand Up @@ -141,7 +141,7 @@ __pthread_cond_timedwait:
/* Only clocks 0 and 1 are allowed so far. Both are handled in the
kernel. */
leaq 24(%rsp), %rsi
movq $__NR_clock_gettime, %rax
movl $__NR_clock_gettime, %eax
syscall
# ifndef __ASSUME_POSIX_TIMERS
cmpq $-ENOSYS, %rax
Expand All @@ -155,13 +155,13 @@ __pthread_cond_timedwait:
subq 32(%rsp), %rdx
#else
leaq 24(%rsp), %rdi
xorq %rsi, %rsi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
callq *%rax

/* Compute relative timeout. */
movq 32(%rsp), %rax
movq $1000, %rdx
movl $1000, %edx
mul %rdx /* Milli seconds to nano seconds. */
movq (%r13), %rcx
movq 8(%r13), %rdx
Expand Down Expand Up @@ -195,10 +195,14 @@ __pthread_cond_timedwait:
movl %eax, (%rsp)

leaq 24(%rsp), %r10
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
#if FUTEX_WAIT == 0
xorl %esi, %esi
#else
movl $FUTEX_WAIT, %esi
#endif
movq %r12, %rdx
addq $cond_futex, %rdi
movq $SYS_futex, %rax
movl $SYS_futex, %eax
syscall
movq %rax, %r14

Expand Down Expand Up @@ -237,7 +241,7 @@ __pthread_cond_timedwait:

13: incq wakeup_seq(%rdi)
incl cond_futex(%rdi)
movq $ETIMEDOUT, %r14
movl $ETIMEDOUT, %r14d
jmp 14f

23: xorq %r14, %r14
Expand All @@ -256,8 +260,8 @@ __pthread_cond_timedwait:
jne 25f

addq $cond_nwaiters, %rdi
movq $SYS_futex, %rax
movq $FUTEX_WAKE, %rsi
movl $SYS_futex, %eax
movl $FUTEX_WAKE, %esi
movl $1, %edx
syscall
subq $cond_nwaiters, %rdi
Expand Down Expand Up @@ -349,13 +353,13 @@ __pthread_cond_timedwait:
#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
/* clock_gettime not available. */
19: leaq 24(%rsp), %rdi
xorq %rsi, %rsi
xorl %esi, %esi
movq $VSYSCALL_ADDR_vgettimeofday, %rax
callq *%rax

/* Compute relative timeout. */
movq 32(%rsp), %rax
movq $1000, %rdx
movl $1000, %edx
mul %rdx /* Milli seconds to nano seconds. */
movq (%r13), %rcx
movq 8(%r13), %rdx
Expand Down

0 comments on commit ee61898

Please sign in to comment.