* [PATCH] Improve x86-64 assembly
@ 2005-03-31 7:27 Jakub Jelinek
2005-03-31 10:02 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2005-03-31 7:27 UTC (permalink / raw)
To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers
Hi!
This patch changes occurrences of:
- xorq %rX, %rX (where X is [abcd]x, [sd]i, bp) into
xorl %eX, %eX which is 1 byte shorter and has the same effect
- movq $N, %rX (where X is [abcd]x, [sd]i, bp and N is 0 .. 0x7fffffff) into
movl $N, %eX which is 2 bytes shorter
- movq $N, %rY (where Y is 8..15 and N is 0 .. 0x7fffffff) into
movl $N, %rYd which is 1 byte shorter
Over the whole libc.so/libpthread.so this saves several hundred bytes in
text sections. The instructions it is changing to are what GCC uses.
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.
nptl/
* 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.
linuxthreads/
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Use
functionally equivalent, but shorter instructions.
--- libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S.jj 2002-08-31 10:05:51.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/x86_64/getcontext.S 2005-03-30 18:16:52.000000000 +0200
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -67,16 +67,20 @@ ENTRY(__getcontext)
/* Save the current signal mask with
rt_sigprocmask (SIG_BLOCK, NULL, set,_NSIG/8). */
leaq oSIGMASK(%rdi), %rdx
- xorq %rsi,%rsi
- movq $SIG_BLOCK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ xorl %esi,%esi
+#if SIG_BLOCK == 0
+ xorl %edi, %edi
+#else
+ movl $SIG_BLOCK, %edi
+#endif
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
syscall
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
/* All done, return 0 for success. */
- xorq %rax, %rax
+ xorl %eax, %eax
L(pseudo_end):
ret
PSEUDO_END(__getcontext)
--- libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h.jj 2004-10-05 09:05:03.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h 2005-03-30 18:20:16.000000000 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,02,03,04 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005 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
@@ -119,7 +119,7 @@
# define SYSCALL_ERROR_HANDLER \
0: \
leaq rtld_errno(%rip), %rcx; \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \
orq $-1, %rax; \
@@ -133,7 +133,7 @@
# define SYSCALL_ERROR_HANDLER \
0: \
movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
subq %rax, %rdx; \
movl %edx, %fs:(%rcx); \
orq $-1, %rax; \
@@ -143,7 +143,7 @@
Note that errno occupies only 4 bytes. */
# define SYSCALL_ERROR_HANDLER \
0: \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
subq %rax, %rdx; \
pushq %rdx; \
cfi_adjust_cfa_offset(8); \
@@ -161,7 +161,7 @@
#else /* Not _LIBC_REENTRANT. */
# define SYSCALL_ERROR_HANDLER \
0:movq errno@GOTPCREL(%RIP), %rcx; \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \
orq $-1, %rax; \
@@ -208,7 +208,7 @@
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
DOARGS_##args \
- movq $SYS_ify (syscall_name), %rax; \
+ movl $SYS_ify (syscall_name), %eax; \
syscall;
#define DOARGS_0 /* nothing */
--- libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S.jj 2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/x86_64/setcontext.S 2005-03-30 18:17:55.000000000 +0200
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -40,10 +40,10 @@ ENTRY(__setcontext)
/* Set the signal mask with
rt_sigprocmask (SIG_SETMASK, mask, NULL, _NSIG/8). */
leaq oSIGMASK(%rdi), %rsi
- xorq %rdx, %rdx
- movq $SIG_SETMASK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ xorl %edx, %edx
+ movl $SIG_SETMASK, %edi
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
syscall
popq %rdi /* Reload %rdi, adjust stack. */
cfi_adjust_cfa_offset(-8)
@@ -96,7 +96,7 @@ ENTRY(__setcontext)
cfi_startproc
/* Clear rax to indicate success. */
- xorq %rax, %rax
+ xorl %eax, %eax
L(pseudo_end):
ret
--- libc/sysdeps/unix/sysv/linux/x86_64/clone.S.jj 2004-12-06 12:40:59.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/x86_64/clone.S 2005-03-30 18:41:35.000000000 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005 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
@@ -74,7 +74,7 @@ ENTRY (BP_SYM (__clone))
movq %r8, %rdx
movq %r9, %r8
movq 8(%rsp), %r10
- movq $SYS_ify(clone),%rax
+ movl $SYS_ify(clone),%eax
/* End FDE now, because in the child the unwind info will be
wrong. */
@@ -91,7 +91,7 @@ L(pseudo_end):
L(thread_start):
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
- xorq %rbp, %rbp
+ xorl %ebp, %ebp
#ifdef RESET_PID
testq $CLONE_THREAD, %rdi
@@ -99,7 +99,7 @@ L(thread_start):
testq $CLONE_VM, %rdi
movl $-1, %eax
jne 2f
- movq $SYS_ify(getpid), %rax
+ movl $SYS_ify(getpid), %eax
syscall
2: movl %eax, %fs:PID
movl %eax, %fs:TID
--- libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S.jj 2004-06-11 14:56:03.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/x86_64/swapcontext.S 2005-03-30 18:18:55.000000000 +0200
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -73,9 +73,9 @@ ENTRY(__swapcontext)
rt_sigprocmask (SIG_BLOCK, newset, oldset,_NSIG/8). */
leaq oSIGMASK(%rdi), %rdx
leaq oSIGMASK(%rsi), %rsi
- movq $SIG_SETMASK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ movl $SIG_SETMASK, %edi
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
syscall
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
@@ -114,7 +114,7 @@ ENTRY(__swapcontext)
movq oRSI(%rsi), %rsi
/* Clear rax to indicate success. */
- xorq %rax, %rax
+ xorl %eax, %eax
L(pseudo_end):
ret
--- libc/sysdeps/unix/x86_64/sysdep.S.jj 2004-10-05 09:05:03.000000000 +0200
+++ libc/sysdeps/unix/x86_64/sysdep.S 2005-03-30 18:32:39.000000000 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2004, 2005 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
@@ -42,7 +42,7 @@ syscall_error:
EWOULDBLOCK_sys is the original number. */
cmpq $EWOULDBLOCK_sys, %rax /* Is it the old EWOULDBLOCK? */
jne notb /* Branch if not. */
- movq $EAGAIN, %rax /* Yes; translate it to EAGAIN. */
+ movl $EAGAIN, %eax /* Yes; translate it to EAGAIN. */
notb:
#endif
#if USE___THREAD
--- libc/sysdeps/x86_64/strchr.S.jj 2003-04-30 00:47:18.000000000 +0200
+++ libc/sysdeps/x86_64/strchr.S 2005-03-30 18:25:27.000000000 +0200
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For AMD x86-64.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 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
@@ -221,7 +221,7 @@ ENTRY (BP_SYM (strchr))
7: /* Return NULL. */
- xorq %rax, %rax
+ xorl %eax, %eax
retq
--- libc/sysdeps/x86_64/memset.S.jj 2005-02-22 10:03:09.000000000 +0100
+++ libc/sysdeps/x86_64/memset.S 2005-03-30 18:31:27.000000000 +0200
@@ -41,7 +41,7 @@ END (__memset_chk)
ENTRY (memset)
#if BZERO_P
mov %rsi,%rdx /* Adjust parameter. */
- xorq %rsi,%rsi /* Fill with 0s. */
+ xorl %esi,%esi /* Fill with 0s. */
#endif
cmp $0x7,%rdx /* Check for small length. */
mov %rdi,%rcx /* Save ptr as return value. */
--- libc/sysdeps/x86_64/strcspn.S.jj 2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/x86_64/strcspn.S 2005-03-30 18:30:48.000000000 +0200
@@ -1,7 +1,8 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains no characters from SS.
For AMD x86-64.
- Copyright (C) 1994-1997,2000,2002,2003,2004 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>.
@@ -41,9 +42,9 @@ ENTRY (strcspn)
movq %rdi, %r8 /* Save value. */
subq $256, %rsp /* Make space for 256 bytes. */
cfi_adjust_cfa_offset(256)
- movq $32, %rcx /* 32*8 bytes = 256 bytes. */
+ movl $32, %ecx /* 32*8 bytes = 256 bytes. */
movq %rsp, %rdi
- xorq %rax, %rax /* We store 0s. */
+ xorl %eax, %eax /* We store 0s. */
cld
rep
stosq
@@ -113,7 +114,7 @@ L(5): incq %rax
L(4): addq $256, %rsp /* remove skipset */
cfi_adjust_cfa_offset(-256)
#if STRPBRK_P
- xorq %rdx,%rdx
+ xorl %edx,%edx
orb %cl, %cl /* was last character NUL? */
cmovzq %rdx, %rax /* Yes: return NULL */
#else
--- libc/sysdeps/x86_64/strcmp.S.jj 2003-04-30 00:47:18.000000000 +0200
+++ libc/sysdeps/x86_64/strcmp.S 2005-03-30 18:28:25.000000000 +0200
@@ -1,5 +1,5 @@
/* Highly optimized version for x86-64.
- Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on i686 version contributed by Ulrich Drepper
<drepper@cygnus.com>, 1999.
@@ -34,7 +34,7 @@ L(oop): movb (%rdi), %al
testb %al, %al
jnz L(oop)
- xorq %rax, %rax
+ xorl %eax, %eax
ret
L(neq): movl $1, %eax
--- libc/sysdeps/x86_64/elf/start.S.jj 2004-08-30 12:04:12.000000000 +0200
+++ libc/sysdeps/x86_64/elf/start.S 2005-03-30 18:27:03.000000000 +0200
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF x86-64 ABI.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
@@ -62,7 +62,7 @@
_start:
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
- xorq %rbp, %rbp
+ xorl %ebp, %ebp
/* Extract the arguments as encoded on the stack and set up
the arguments for __libc_start_main (int (*main) (int, char **, char **),
--- libc/sysdeps/x86_64/strspn.S.jj 2004-01-12 10:52:43.000000000 +0100
+++ libc/sysdeps/x86_64/strspn.S 2005-03-30 18:27:47.000000000 +0200
@@ -1,7 +1,8 @@
/* strspn (str, ss) -- Return the length of the initial segment of STR
which contains only characters from SS.
For AMD x86-64.
- Copyright (C) 1994-1997,2000,2002,2003,2004 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>.
@@ -37,9 +38,9 @@ ENTRY (strspn)
movq %rdi, %r8 /* Save value. */
subq $256, %rsp /* Make space for 256 bytes. */
cfi_adjust_cfa_offset(256)
- movq $32, %rcx /* 32*8 bytes = 256 bytes. */
+ movl $32, %ecx /* 32*8 bytes = 256 bytes. */
movq %rsp, %rdi
- xorq %rax, %rax /* We store 0s. */
+ xorl %eax, %eax /* We store 0s. */
cld
rep
stosq
--- libc/sysdeps/x86_64/dl-machine.h.jj 2005-01-26 18:36:57.000000000 +0100
+++ libc/sysdeps/x86_64/dl-machine.h 2005-03-30 18:23:38.000000000 +0200
@@ -170,7 +170,7 @@ _dl_start_user:\n\
# argv -> rdx\n\
leaq 8(%r13), %rdx\n\
# Clear %rbp to mark outermost frame obviously even for constructors.\n\
- xorq %rbp, %rbp\n\
+ xorl %ebp, %ebp\n\
# Call the function to run the initializers.\n\
call _dl_init_internal@PLT\n\
# Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
--- libc/sysdeps/x86_64/bsd-_setjmp.S.jj 2003-09-02 09:09:02.000000000 +0200
+++ libc/sysdeps/x86_64/bsd-_setjmp.S 2005-03-30 18:24:21.000000000 +0200
@@ -1,5 +1,6 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. x86-64 version.
- Copyright (C) 1994-1997,2000,2001,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2001, 2002, 2003, 2005
+ 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
@@ -30,7 +31,7 @@
ENTRY (BP_SYM (_setjmp))
/* Set up arguments, we only need to set the second arg. */
- xorq %rsi, %rsi
+ xorl %esi, %esi
#ifdef PIC
jmp HIDDEN_JUMPTARGET (__sigsetjmp)
#else
--- libc/sysdeps/x86_64/bsd-setjmp.S.jj 2001-09-19 12:12:07.000000000 +0200
+++ libc/sysdeps/x86_64/bsd-setjmp.S 2005-03-30 17:26:12.000000000 +0200
@@ -1,5 +1,6 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. x86-64 version.
- Copyright (C) 1994,1995,1996,1997,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2005
+ 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
@@ -30,7 +31,7 @@
ENTRY (BP_SYM (setjmp))
/* Set up arguments, we only need to set the 2nd arg. */
- movq $1, %rsi
+ movl $1, %esi
#ifdef PIC
#else
jmp BP_SYM (__sigsetjmp)
--- libc/sysdeps/x86_64/strtok.S.jj 2003-05-22 06:06:51.000000000 +0200
+++ libc/sysdeps/x86_64/strtok.S 2005-03-30 18:27:31.000000000 +0200
@@ -1,6 +1,6 @@
/* strtok (str, delim) -- Return next DELIM separated token from STR.
For AMD x86-64.
- Copyright (C) 1998,2000,2001,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1998,2000,2001,2002,2003,2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on i686 version contributed by Ulrich Drepper
<drepper@cygnus.com>, 1998.
@@ -69,9 +69,9 @@ ENTRY (BP_SYM (FUNCTION))
movq %rdi, %r8 /* Save value. */
subq $256, %rsp /* Make space for 256 bytes. */
cfi_adjust_cfa_offset(256)
- movq $32, %rcx /* 32*8 bytes = 256 bytes. */
+ movl $32, %ecx /* 32*8 bytes = 256 bytes. */
movq %rsp, %rdi
- xorq %rax, %rax /* We store 0s. */
+ xorl %eax, %eax /* We store 0s. */
cld
rep
stosq
@@ -204,7 +204,7 @@ L(epilogue):
retq
L(returnNULL):
- xorq %rax, %rax
+ xorl %eax, %eax
jmp L(epilogue)
END (BP_SYM (FUNCTION))
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S.jj 2004-02-19 17:50:41.000000000 +0100
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S 2005-03-30 21:53:21.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -56,7 +56,7 @@ __pthread_rwlock_unlock:
5: movl $0, WRITER(%rdi)
- movq $1, %rsi
+ movl $1, %esi
leaq WRITERS_WAKEUP(%rdi), %r10
movq %rsi, %rdx
cmpl $0, WRITERS_QUEUED(%rdi)
@@ -78,11 +78,11 @@ __pthread_rwlock_unlock:
#endif
jne 7f
-8: movq $SYS_futex, %rax
+8: movl $SYS_futex, %eax
movq %r10, %rdi
syscall
- xorq %rax, %rax
+ xorl %eax, %eax
retq
.align 16
@@ -94,7 +94,7 @@ __pthread_rwlock_unlock:
#endif
jne 3f
-4: xorq %rax, %rax
+4: xorl %eax, %eax
retq
1:
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S.jj 2004-06-11 14:45:54.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S 2005-03-30 21:54:14.000000000 +0200
@@ -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.
@@ -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
@@ -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
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h.jj 2004-07-12 17:50:23.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h 2005-03-30 22:11:49.000000000 +0200
@@ -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 Jakub Jelinek <jakub@redhat.com>, 2002.
@@ -48,7 +48,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. */ \
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S.jj 2004-07-12 17:50:23.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S 2005-03-30 22:21:58.000000000 +0200
@@ -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.
@@ -90,13 +90,13 @@ pthread_rwlock_timedrdlock:
/* Get current time. */
11: 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), %rcx
movq 8(%r13), %rdi
@@ -112,11 +112,15 @@ pthread_rwlock_timedrdlock:
movq %rcx, (%rsp) /* Store relative timeout. */
movq %rdi, 8(%rsp)
- xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
movq %rsp, %r10
movl %r14d, %edx
leaq READERS_WAKEUP(%r12), %rdi
- movq $SYS_futex, %rax
+ movl $SYS_futex, %eax
syscall
movq %rax, %rdx
17:
@@ -136,11 +140,11 @@ pthread_rwlock_timedrdlock:
cmpq $-ETIMEDOUT, %rdx
jne 2b
-18: movq $ETIMEDOUT, %rdx
+18: movl $ETIMEDOUT, %edx
jmp 9f
-5: xorq %rdx, %rdx
+5: xorl %edx, %edx
incl NR_READERS(%r12)
je 8f
9: LOCK
@@ -168,7 +172,7 @@ pthread_rwlock_timedrdlock:
14: cmpl %fs:TID, %eax
jne 3b
- movq $EDEADLK, %rdx
+ movl $EDEADLK, %edx
jmp 9b
6:
@@ -182,12 +186,12 @@ pthread_rwlock_timedrdlock:
/* Overflow. */
8: decl NR_READERS(%r12)
- movq $EAGAIN, %rdx
+ movl $EAGAIN, %edx
jmp 9b
/* Overflow. */
4: decl READERS_QUEUED(%r12)
- movq $EAGAIN, %rdx
+ movl $EAGAIN, %edx
jmp 9b
10:
@@ -211,6 +215,6 @@ pthread_rwlock_timedrdlock:
16: movq $-ETIMEDOUT, %rdx
jmp 17b
-19: movq $EINVAL, %rdx
+19: movl $EINVAL, %edx
jmp 9b
.size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S.jj 2004-02-19 17:50:41.000000000 +0100
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S 2005-03-30 22:19:34.000000000 +0200
@@ -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.
@@ -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
@@ -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
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S.jj 2003-09-22 06:40:52.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S 2005-03-30 22:21:47.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -74,8 +74,12 @@ __pthread_rwlock_rdlock:
jne 10f
11: addq $READERS_WAKEUP, %rdi
- movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
- movq $SYS_futex, %rax
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
+ movl $SYS_futex, %eax
syscall
subq $READERS_WAKEUP, %rdi
@@ -94,7 +98,7 @@ __pthread_rwlock_rdlock:
13: decl READERS_QUEUED(%rdi)
jmp 2b
-5: xorq %rdx, %rdx
+5: xorl %edx, %edx
incl NR_READERS(%rdi)
je 8f
9: LOCK
@@ -122,7 +126,7 @@ __pthread_rwlock_rdlock:
14: cmpl %fs:TID, %eax
jne 3b
/* Deadlock detected. */
- movq $EDEADLK, %rdx
+ movl $EDEADLK, %edx
jmp 9b
6:
@@ -137,12 +141,12 @@ __pthread_rwlock_rdlock:
/* Overflow. */
8: decl NR_READERS(%rdi)
- movq $EAGAIN, %rdx
+ movl $EAGAIN, %edx
jmp 9b
/* Overflow. */
4: decl READERS_QUEUED(%rdi)
- movq $EAGAIN, %rdx
+ movl $EAGAIN, %edx
jmp 9b
10:
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S.jj 2003-07-08 23:07:19.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S 2005-03-30 22:05:36.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -77,7 +77,7 @@ sem_wait:
movl %eax, %r8d
xorq %r10, %r10
- movq $SYS_futex, %rax
+ movl $SYS_futex, %eax
movq %r13, %rdi
movq %r10, %rsi
movq %r10, %rdx
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S.jj 2003-09-22 06:40:52.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S 2005-03-31 00:39:28.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -72,8 +72,12 @@ __pthread_rwlock_wrlock:
jne 10f
11: addq $WRITERS_WAKEUP, %rdi
- movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
- movq $SYS_futex, %rax
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
+ movl $SYS_futex, %eax
syscall
subq $WRITERS_WAKEUP, %rdi
@@ -92,7 +96,7 @@ __pthread_rwlock_wrlock:
13: decl WRITERS_QUEUED(%rdi)
jmp 2b
-5: xorq %rdx, %rdx
+5: xorl %edx, %edx
movl %fs:TID, %eax
movl %eax, WRITER(%rdi)
9: LOCK
@@ -119,7 +123,7 @@ __pthread_rwlock_wrlock:
14: cmpl %fs:TID, %eax
jne 3b
- movq $EDEADLK, %rdx
+ movl $EDEADLK, %edx
jmp 9b
6:
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S.jj 2004-09-02 23:27:06.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S 2005-03-30 22:20:33.000000000 +0200
@@ -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.
@@ -56,7 +56,7 @@ __pthread_cond_timedwait:
.Lsubq:
cmpq $1000000000, 8(%rdx)
- movq $EINVAL, %rax
+ movl $EINVAL, %eax
jae 18f
/* Stack frame:
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S.jj 2003-07-01 19:01:44.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S 2005-03-30 22:21:25.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -74,8 +74,12 @@ __pthread_once:
jnz 3f /* Different for generation -> run initializer. */
/* Somebody else got here first. Wait. */
- movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
- movq $SYS_futex, %rax
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
+ movl $SYS_futex, %eax
syscall
jmp 6b
@@ -98,12 +102,12 @@ __pthread_once:
/* Wake up all other threads. */
movl $0x7fffffff, %edx
movl $FUTEX_WAKE, %esi
- movq $SYS_futex, %rax
+ movl $SYS_futex, %eax
syscall
4: addq $8, %rsp
.Ladd:
- xorq %rax, %rax
+ xorl %eax, %eax
retq
.size __pthread_once,.-__pthread_once
@@ -124,8 +128,8 @@ clear_once_control:
movl $0, (%rdi)
movl $0x7fffffff, %edx
- movq $FUTEX_WAKE, %rsi
- movq $SYS_futex, %rax
+ movl $FUTEX_WAKE, %esi
+ movl $SYS_futex, %eax
syscall
movq %r8, %rdi
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S.jj 2003-09-22 06:40:52.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S 2005-03-30 22:22:06.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -86,13 +86,13 @@ pthread_rwlock_timedwrlock:
/* Get current time. */
11: 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), %rcx
movq 8(%r13), %rdi
@@ -108,11 +108,15 @@ pthread_rwlock_timedwrlock:
movq %rcx, (%rsp) /* Store relative timeout. */
movq %rdi, 8(%rsp)
- xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
movq %rsp, %r10
movl %r14d, %edx
leaq WRITERS_WAKEUP(%r12), %rdi
- movq $SYS_futex, %rax
+ movl $SYS_futex, %eax
syscall
movq %rax, %rdx
17:
@@ -132,11 +136,11 @@ pthread_rwlock_timedwrlock:
cmpq $-ETIMEDOUT, %rdx
jne 2b
-18: movq $ETIMEDOUT, %rdx
+18: movl $ETIMEDOUT, %edx
jmp 9f
-5: xorq %rdx, %rdx
+5: xorl %edx, %edx
movl %fs:TID, %eax
movl %eax, WRITER(%r12)
9: LOCK
@@ -164,7 +168,7 @@ pthread_rwlock_timedwrlock:
14: cmpl %fs:TID, %eax
jne 3b
-20: movq $EDEADLK, %rdx
+20: movl $EDEADLK, %edx
jmp 9b
6:
@@ -178,7 +182,7 @@ pthread_rwlock_timedwrlock:
/* Overflow. */
4: decl WRITERS_QUEUED(%r12)
- movq $EAGAIN, %rdx
+ movl $EAGAIN, %edx
jmp 9b
10:
@@ -202,6 +206,6 @@ pthread_rwlock_timedwrlock:
16: movq $-ETIMEDOUT, %rdx
jmp 17b
-19: movq $EINVAL, %rdx
+19: movl $EINVAL, %edx
jmp 9b
.size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S.jj 2004-06-11 14:45:54.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S 2005-03-30 22:08:44.000000000 +0200
@@ -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.
@@ -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. */
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S.jj 2004-10-05 09:04:50.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S 2005-03-30 22:18:48.000000000 +0200
@@ -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.
@@ -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
@@ -93,7 +97,7 @@ __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. */
@@ -101,7 +105,7 @@ __lll_mutex_timedlock_wait:
/* 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
@@ -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
@@ -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
@@ -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
@@ -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)
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S.jj 2004-09-02 23:27:06.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2005-03-30 22:20:53.000000000 +0200
@@ -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.
@@ -82,12 +82,12 @@ __condvar_cleanup:
jne 4f
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
- movq $1, %r12
+ movl $1, %r12d
4: LOCK
#if cond_lock == 0
@@ -105,9 +105,9 @@ __condvar_cleanup:
2: testq %r12, %r12
jnz 5f
addq $cond_futex, %rdi
- movq $FUTEX_WAKE, %rsi
+ movl $FUTEX_WAKE, %esi
movl $0x7fffffff, %edx
- movq $SYS_futex, %rax
+ movl $SYS_futex, %eax
syscall
5: movq 16(%r8), %rdi
@@ -170,7 +170,7 @@ __pthread_cond_wait:
/* Unlock the mutex. */
2: movq 16(%rsp), %rdi
- xorq %rsi, %rsi
+ xorl %esi, %esi
callq __pthread_mutex_unlock_usercnt
testl %eax, %eax
@@ -215,8 +215,12 @@ __pthread_cond_wait:
xorq %r10, %r10
movq %r12, %rdx
addq $cond_futex-cond_lock, %rdi
- movq $SYS_futex, %rax
- movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
+ movl $SYS_futex, %eax
+#if FUTEX_WAIT == 0
+ xorl %esi, %esi
+#else
+ movl $FUTEX_WAIT, %esi
+#endif
syscall
movl (%rsp), %edi
@@ -262,8 +266,8 @@ __pthread_cond_wait:
jne 17f
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
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S.jj 2003-03-13 02:48:34.000000000 +0100
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S 2005-03-30 21:59:29.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,8 +41,8 @@ sem_post:
LOCK
xaddl %edx, (%rdi)
- movq $SYS_futex, %rax
- movq $FUTEX_WAKE, %rsi
+ movl $SYS_futex, %eax
+ movl $FUTEX_WAKE, %esi
incl %edx
syscall
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S.jj 2003-07-08 23:07:37.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S 2005-03-30 22:00:45.000000000 +0200
@@ -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 Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -82,14 +82,14 @@ sem_timedwait:
7: call __pthread_enable_asynccancel
movl %eax, 16(%rsp)
- xorq %rsi, %rsi
+ xorl %esi, %esi
movq %rsp, %rdi
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
@@ -107,8 +107,8 @@ sem_timedwait:
movq %rsp, %r10
movq %r12, %rdi
- xorq %rsi, %rsi
- movq $SYS_futex, %rax
+ xorl %esi, %esi
+ movl $SYS_futex, %eax
xorl %edx, %edx
syscall
movq %rax, %r14
--- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h.jj 2003-06-18 00:22:56.000000000 +0200
+++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h 2005-03-30 18:33:27.000000000 +0200
@@ -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.
@@ -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. */ \
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Improve x86-64 assembly
2005-03-31 7:27 [PATCH] Improve x86-64 assembly Jakub Jelinek
@ 2005-03-31 10:02 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-03-31 10:02 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Glibc hackers
[-- Attachment #1: Type: text/plain, Size: 109 bytes --]
Applied.
--
⧠Ulrich Drepper ⧠Red Hat, Inc. ⧠444 Castro St ⧠Mountain View, CA â
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-31 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-31 7:27 [PATCH] Improve x86-64 assembly Jakub Jelinek
2005-03-31 10:02 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).