Skip to content

Commit

Permalink
Minor optimizations and cleanups of x86 cond_broadcast.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Nov 18, 2009
1 parent dd7106b commit dfedb12
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
5 changes: 5 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2009-11-18 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
optimizations and cleanups.

2009-11-18 Dinakar Guniguntala <dino@in.ibm.com>

* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
Expand Down
19 changes: 9 additions & 10 deletions nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002,2003,2004,2006,2007,2009 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 @@ -138,13 +138,6 @@ __pthread_cond_broadcast:

cfi_restore_state

.align 16
/* Unlock. */
4: LOCK
subl $1, cond_lock-cond_futex(%ebx)
jne 5f
jmp 6b

/* Initial locking failed. */
1:
#if cond_lock == 0
Expand All @@ -165,7 +158,13 @@ __pthread_cond_broadcast:
call __lll_lock_wait
jmp 2b

/* Unlock in loop requires waekup. */
.align 16
/* Unlock. */
4: LOCK
subl $1, cond_lock-cond_futex(%ebx)
je 6b

/* Unlock in loop requires wakeup. */
5: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
Expand All @@ -180,7 +179,7 @@ __pthread_cond_broadcast:
call __lll_unlock_wake
jmp 6b

/* Unlock in loop requires waekup. */
/* Unlock in loop requires wakeup. */
7: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down

0 comments on commit dfedb12

Please sign in to comment.