Optimization tweaks:

Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl  %reg,%reg instead of movl $0,%reg
This commit is contained in:
jtc 1994-01-24 19:24:36 +00:00
parent 422a122004
commit 7835a85a78
6 changed files with 22 additions and 22 deletions

View File

@ -34,12 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)Ovfork.s 5.1 (Berkeley) 4/23/90
* $Id: Ovfork.S,v 1.3 1993/10/21 02:19:25 jtc Exp $
* $Id: Ovfork.S,v 1.4 1994/01/24 19:24:36 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: Ovfork.S,v 1.3 1993/10/21 02:19:25 jtc Exp $"
.asciz "$Id: Ovfork.S,v 1.4 1994/01/24 19:24:36 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@ -58,7 +58,7 @@ ENTRY(vfork)
LCALL(7,0)
jb verror
vforkok:
cmpl $0,%edx /* child process? */
testl %edx,%edx /* child process? */
jne child /* yes */
jmp parent
.globl _errno
@ -74,6 +74,6 @@ verror:
movl $-1,%eax
jmp %ecx
child:
movl $0,%eax
xorl %eax,%eax
parent:
jmp %ecx

View File

@ -34,12 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)brk.s 5.2 (Berkeley) 12/17/90
* $Id: brk.S,v 1.3 1993/12/06 23:28:08 pk Exp $
* $Id: brk.S,v 1.4 1994/01/24 19:24:38 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: brk.S,v 1.3 1993/12/06 23:28:08 pk Exp $"
.asciz "$Id: brk.S,v 1.4 1994/01/24 19:24:38 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@ -68,7 +68,7 @@ ok:
jb err
movl 4(%esp),%eax
movl %eax,(%edx)
movl $0,%eax
xorl %eax,%eax
ret
err:
jmp PIC_PLT(cerror)
@ -86,7 +86,7 @@ ok:
jb err
movl 4(%esp),%eax
movl %eax,curbrk
movl $0,%eax
xorl %eax,%eax
ret
err:
jmp cerror

View File

@ -34,19 +34,19 @@
* SUCH DAMAGE.
*
* from: @(#)fork.s 5.1 (Berkeley) 4/23/90
* $Id: fork.S,v 1.2 1993/10/21 02:19:30 jtc Exp $
* $Id: fork.S,v 1.3 1994/01/24 19:24:40 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: fork.S,v 1.2 1993/10/21 02:19:30 jtc Exp $"
.asciz "$Id: fork.S,v 1.3 1994/01/24 19:24:40 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
SYSCALL(fork)
cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */
testl %edx,%edx /* parent, since %edx == 0 in parent, 1 in child */
je 1f
movl $0,%eax
xorl %eax,%eax
1:
ret /* pid = fork(); */

View File

@ -34,16 +34,16 @@
* SUCH DAMAGE.
*
* from: @(#)mount.s 5.1 (Berkeley) 4/23/90
* $Id: mount.S,v 1.2 1993/10/21 02:19:31 jtc Exp $
* $Id: mount.S,v 1.3 1994/01/24 19:24:42 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: mount.S,v 1.2 1993/10/21 02:19:31 jtc Exp $"
.asciz "$Id: mount.S,v 1.3 1994/01/24 19:24:42 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
SYSCALL(mount)
movl $0,%eax
xorl %eax,%eax
ret

View File

@ -34,12 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)pipe.s 5.1 (Berkeley) 4/23/90
* $Id: pipe.S,v 1.2 1993/10/21 02:19:32 jtc Exp $
* $Id: pipe.S,v 1.3 1994/01/24 19:24:43 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: pipe.S,v 1.2 1993/10/21 02:19:32 jtc Exp $"
.asciz "$Id: pipe.S,v 1.3 1994/01/24 19:24:43 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@ -48,5 +48,5 @@ SYSCALL(pipe)
movl 4(%esp),%ecx
movl %eax,(%ecx)
movl %edx,4(%ecx)
movl $0,%eax
xorl %eax,%eax
ret

View File

@ -34,12 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)sigprocmask.s 5.2 (Berkeley) 12/17/90
* $Id: sigprocmask.S,v 1.3 1993/12/06 23:28:10 pk Exp $
* $Id: sigprocmask.S,v 1.4 1994/01/24 19:24:44 jtc Exp $
*/
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$Id: sigprocmask.S,v 1.3 1993/12/06 23:28:10 pk Exp $"
.asciz "$Id: sigprocmask.S,v 1.4 1994/01/24 19:24:44 jtc Exp $"
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@ -49,7 +49,7 @@ err:
ENTRY(sigprocmask)
movl 8(%esp),%ecx # fetch new sigset pointer
cmpl $0,%ecx # check new sigset pointer
testl %ecx,%ecx # check new sigset pointer
jne 1f # if not null, indirect
/* movl $0,8(%esp) # null mask pointer: block empty set */
movl $1,4(%esp) # SIG_BLOCK
@ -60,7 +60,7 @@ ENTRY(sigprocmask)
LCALL(0x7,0)
jb err
movl 12(%esp),%ecx # fetch old mask requested
cmpl $0,%ecx # test if old mask requested
cmpl %ecx,%ecx # test if old mask requested
je out
movl %eax,(%ecx) # store old mask
out: