Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
This commit is contained in:
parent
1df94d108f
commit
90ff28fef4
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: index.S,v 1.4 1994/01/28 20:34:38 jtc Exp $
|
||||
* $Id: index.S,v 1.5 1994/02/14 20:05:52 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: index.S,v 1.4 1994/01/28 20:34:38 jtc Exp $"
|
||||
.asciz "$Id: index.S,v 1.5 1994/02/14 20:05:52 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -67,7 +67,7 @@ L1:
|
|||
je L2
|
||||
incl %eax
|
||||
testb %bl,%bl /* null terminator??? */
|
||||
jne L1
|
||||
jnz L1
|
||||
xorl %eax,%eax
|
||||
L2:
|
||||
popl %ebx
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: memchr.S,v 1.3 1994/01/28 20:34:40 jtc Exp $
|
||||
* $Id: memchr.S,v 1.4 1994/02/14 20:05:57 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: memchr.S,v 1.3 1994/01/28 20:34:40 jtc Exp $"
|
||||
.asciz "$Id: memchr.S,v 1.4 1994/02/14 20:05:57 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -54,7 +54,7 @@ ENTRY(memchr)
|
|||
cld /* set search forward */
|
||||
repne /* search! */
|
||||
scasb
|
||||
jnz L1 /* scan failed, return null */
|
||||
jne L1 /* scan failed, return null */
|
||||
leal -1(%edi),%eax /* adjust result of scan */
|
||||
popl %edi
|
||||
ret
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rindex.S,v 1.5 1994/01/28 20:34:46 jtc Exp $
|
||||
* $Id: rindex.S,v 1.6 1994/02/14 20:05:59 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: rindex.S,v 1.5 1994/01/28 20:34:46 jtc Exp $"
|
||||
.asciz "$Id: rindex.S,v 1.6 1994/02/14 20:05:59 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -70,6 +70,6 @@ L1:
|
|||
L2:
|
||||
incl %edx
|
||||
testb %bl,%bl /* null terminator??? */
|
||||
jne L1
|
||||
jnz L1
|
||||
popl %ebx
|
||||
ret
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: strcat.S,v 1.4 1994/02/14 17:45:16 jtc Exp $
|
||||
* $Id: strcat.S,v 1.5 1994/02/14 20:06:01 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: strcat.S,v 1.4 1994/02/14 17:45:16 jtc Exp $"
|
||||
.asciz "$Id: strcat.S,v 1.5 1994/02/14 20:06:01 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -70,37 +70,37 @@ ENTRY(strcat)
|
|||
L1: movb (%edx),%al /* unroll loop, but not too much */
|
||||
movb %al,(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 1(%edx),%al
|
||||
movb %al,1(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 2(%edx),%al
|
||||
movb %al,2(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 3(%edx),%al
|
||||
movb %al,3(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 4(%edx),%al
|
||||
movb %al,4(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 5(%edx),%al
|
||||
movb %al,5(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 6(%edx),%al
|
||||
movb %al,6(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 7(%edx),%al
|
||||
movb %al,7(%ecx)
|
||||
addl $8,%edx
|
||||
addl $8,%ecx
|
||||
testb %al,%al
|
||||
jne L1
|
||||
jnz L1
|
||||
L2: popl %eax /* pop destination address */
|
||||
popl %edi /* restore edi */
|
||||
ret
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: strcmp.S,v 1.7 1994/02/14 17:45:17 jtc Exp $
|
||||
* $Id: strcmp.S,v 1.8 1994/02/14 20:06:04 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: strcmp.S,v 1.7 1994/02/14 17:45:17 jtc Exp $"
|
||||
.asciz "$Id: strcmp.S,v 1.8 1994/02/14 20:06:04 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -66,56 +66,56 @@ L1: incl %eax
|
|||
incl %edx
|
||||
L2: movb (%eax),%cl
|
||||
testb %cl,%cl /* null terminator??? */
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx) /* chars match??? */
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
jne L3
|
||||
incl %eax
|
||||
incl %edx
|
||||
movb (%eax),%cl
|
||||
testb %cl,%cl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %cl,(%edx)
|
||||
je L1
|
||||
.align 2, 0x90
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: strcpy.S,v 1.4 1994/02/14 17:45:19 jtc Exp $
|
||||
* $Id: strcpy.S,v 1.5 1994/02/14 20:06:08 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: strcpy.S,v 1.4 1994/02/14 17:45:19 jtc Exp $"
|
||||
.asciz "$Id: strcpy.S,v 1.5 1994/02/14 20:06:08 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include "DEFS.h"
|
||||
|
@ -60,36 +60,36 @@ ENTRY(strcpy)
|
|||
L1: movb (%edx),%al /* unroll loop, but not too much */
|
||||
movb %al,(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 1(%edx),%al
|
||||
movb %al,1(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 2(%edx),%al
|
||||
movb %al,2(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 3(%edx),%al
|
||||
movb %al,3(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 4(%edx),%al
|
||||
movb %al,4(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 5(%edx),%al
|
||||
movb %al,5(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 6(%edx),%al
|
||||
movb %al,6(%ecx)
|
||||
testb %al,%al
|
||||
je L2
|
||||
jz L2
|
||||
movb 7(%edx),%al
|
||||
movb %al,7(%ecx)
|
||||
addl $8,%edx
|
||||
addl $8,%ecx
|
||||
testb %al,%al
|
||||
jne L1
|
||||
jnz L1
|
||||
L2: popl %eax /* pop dst address */
|
||||
ret
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: strncmp.S,v 1.7 1994/02/14 17:44:39 jtc Exp $
|
||||
* $Id: strncmp.S,v 1.8 1994/02/14 20:06:10 mycroft Exp $
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS)
|
||||
.text
|
||||
.asciz "$Id: strncmp.S,v 1.7 1994/02/14 17:44:39 jtc Exp $"
|
||||
.asciz "$Id: strncmp.S,v 1.8 1994/02/14 20:06:10 mycroft Exp $"
|
||||
#endif
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
@ -69,80 +69,80 @@ ENTRY(strncmp)
|
|||
L1: incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
L2: je L4 /* strings are equal */
|
||||
L2: jz L4 /* strings are equal */
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
jne L3
|
||||
|
||||
incl %eax
|
||||
incl %ecx
|
||||
decl %edx
|
||||
je L4
|
||||
jz L4
|
||||
movb (%eax),%bl
|
||||
testb %bl,%bl
|
||||
je L3
|
||||
jz L3
|
||||
cmpb %bl,(%ecx)
|
||||
je L1
|
||||
|
||||
|
|
Loading…
Reference in New Issue