Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will fit. This happens to be all occurances in this case, so I could have used bCCs. However, a quick survey of the rest of NetBSD's m68k code showed that jCC was used in similar cases. I did the same to be consistant.
This commit is contained in:
parent
d721f54830
commit
48030a80ae
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bcmp.S,v 1.5 1996/11/30 02:01:27 jtc Exp $ */
|
||||
/* $NetBSD: bcmp.S,v 1.6 1997/01/04 03:21:11 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: bcmp.S,v 1.5 1996/11/30 02:01:27 jtc Exp $")
|
||||
RCSID("$NetBSD: bcmp.S,v 1.6 1997/01/04 03:21:11 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -61,33 +61,33 @@ ENTRY(bcmp)
|
||||
movl sp@(4),a0 | string 1
|
||||
movl sp@(8),a1 | string 2
|
||||
movl sp@(12),d0 | length
|
||||
beq Lbcdone | if zero, nothing to do
|
||||
jeq Lbcdone | if zero, nothing to do
|
||||
movl a0,d1
|
||||
btst #0,d1 | string 1 address odd?
|
||||
beq Lbceven | no, skip alignment
|
||||
jeq Lbceven | no, skip alignment
|
||||
cmpmb a0@+,a1@+ | yes, compare a byte
|
||||
bne Lbcnoteq | not equal, return non-zero
|
||||
jne Lbcnoteq | not equal, return non-zero
|
||||
subql #1,d0 | adjust count
|
||||
beq Lbcdone | count 0, reutrn zero
|
||||
jeq Lbcdone | count 0, reutrn zero
|
||||
Lbceven:
|
||||
movl a1,d1
|
||||
btst #0,d1 | string 2 address odd?
|
||||
bne Lbcbloop | yes, no hope for alignment, compare bytes
|
||||
jne Lbcbloop | yes, no hope for alignment, compare bytes
|
||||
movl d0,d1 | no, both even
|
||||
lsrl #2,d1 | convert count to longword count
|
||||
beq Lbcbloop | count 0, skip longword loop
|
||||
jeq Lbcbloop | count 0, skip longword loop
|
||||
Lbclloop:
|
||||
cmpml a0@+,a1@+ | compare a longword
|
||||
bne Lbcnoteq | not equal, return non-zero
|
||||
jne Lbcnoteq | not equal, return non-zero
|
||||
subql #1,d1 | adjust count
|
||||
bne Lbclloop | still more, keep comparing
|
||||
jne Lbclloop | still more, keep comparing
|
||||
andl #3,d0 | what remains
|
||||
beq Lbcdone | nothing, all done
|
||||
jeq Lbcdone | nothing, all done
|
||||
Lbcbloop:
|
||||
cmpmb a0@+,a1@+ | compare a byte
|
||||
bne Lbcnoteq | not equal, return non-zero
|
||||
jne Lbcnoteq | not equal, return non-zero
|
||||
subql #1,d0 | adjust count
|
||||
bne Lbcbloop | still more, keep going
|
||||
jne Lbcbloop | still more, keep going
|
||||
rts
|
||||
Lbcnoteq:
|
||||
moveq #1,d0
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bcopy.S,v 1.8 1995/11/28 23:40:49 thorpej Exp $ */
|
||||
/* $NetBSD: bcopy.S,v 1.9 1997/01/04 03:21:12 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)bcopy.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: bcopy.S,v 1.8 1995/11/28 23:40:49 thorpej Exp $")
|
||||
RCSID("$NetBSD: bcopy.S,v 1.9 1997/01/04 03:21:12 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -66,7 +66,7 @@ ENTRY(bcopy)
|
||||
#endif
|
||||
#endif
|
||||
movl sp@(12),d1 | check count
|
||||
beq bcdone | == 0, do not do anything
|
||||
jeq bcdone | == 0, do not do anything
|
||||
#if defined(MEMCOPY) || defined(MEMMOVE)
|
||||
movl sp@(4),a1 | dest address
|
||||
movl sp@(8),a0 | src address
|
||||
@ -75,30 +75,30 @@ ENTRY(bcopy)
|
||||
movl sp@(8),a1 | dest address
|
||||
#endif
|
||||
cmpl a1,a0 | src after dest?
|
||||
blt bcback | yes, must copy backwards
|
||||
jlt bcback | yes, must copy backwards
|
||||
movl a0,d0
|
||||
btst #0,d0 | src address odd?
|
||||
beq bcfeven | no, skip alignment
|
||||
jeq bcfeven | no, skip alignment
|
||||
movb a0@+,a1@+ | yes, copy a byte
|
||||
subql #1,d1 | adjust count
|
||||
beq bcdone | count 0, all done
|
||||
jeq bcdone | count 0, all done
|
||||
bcfeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 | dest address odd?
|
||||
bne bcfbloop | yes, no hope for alignment, copy bytes
|
||||
jne bcfbloop | yes, no hope for alignment, copy bytes
|
||||
movl d1,d0 | no, both even
|
||||
lsrl #2,d0 | convert count to longword count
|
||||
beq bcfbloop | count 0, skip longword loop
|
||||
jeq bcfbloop | count 0, skip longword loop
|
||||
bcflloop:
|
||||
movl a0@+,a1@+ | copy a longword
|
||||
subql #1,d0 | adjust count
|
||||
bne bcflloop | still more, keep copying
|
||||
jne bcflloop | still more, keep copying
|
||||
andl #3,d1 | what remains
|
||||
beq bcdone | nothing, all done
|
||||
jeq bcdone | nothing, all done
|
||||
bcfbloop:
|
||||
movb a0@+,a1@+ | copy a byte
|
||||
subql #1,d1 | adjust count
|
||||
bne bcfbloop | still more, keep going
|
||||
jne bcfbloop | still more, keep going
|
||||
bcdone:
|
||||
#if defined(MEMCOPY) || defined(MEMMOVE)
|
||||
movl sp@(4),d0 | dest address
|
||||
@ -109,27 +109,27 @@ bcback:
|
||||
addl d1,a1 | dest pointer to end
|
||||
movl a0,d0
|
||||
btst #0,d0 | src address odd?
|
||||
beq bcbeven | no, skip alignment
|
||||
jeq bcbeven | no, skip alignment
|
||||
movb a0@-,a1@- | yes, copy a byte
|
||||
subql #1,d1 | adjust count
|
||||
beq bcdone | count 0, all done
|
||||
jeq bcdone | count 0, all done
|
||||
bcbeven:
|
||||
movl a1,d0
|
||||
btst #0,d0 | dest address odd?
|
||||
bne bcbbloop | yes, no hope for alignment, copy bytes
|
||||
jne bcbbloop | yes, no hope for alignment, copy bytes
|
||||
movl d1,d0 | no, both even
|
||||
lsrl #2,d0 | convert count to longword count
|
||||
beq bcbbloop | count 0, skip longword loop
|
||||
jeq bcbbloop | count 0, skip longword loop
|
||||
bcblloop:
|
||||
movl a0@-,a1@- | copy a longword
|
||||
subql #1,d0 | adjust count
|
||||
bne bcblloop | still more, keep copying
|
||||
jne bcblloop | still more, keep copying
|
||||
andl #3,d1 | what remains
|
||||
beq bcdone | nothing, all done
|
||||
jeq bcdone | nothing, all done
|
||||
bcbbloop:
|
||||
movb a0@-,a1@- | copy a byte
|
||||
subql #1,d1 | adjust count
|
||||
bne bcbbloop | still more, keep going
|
||||
jne bcbbloop | still more, keep going
|
||||
#if defined(MEMCOPY) || defined(MEMMOVE)
|
||||
movl sp@(4),d0 | dest address
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bzero.S,v 1.5 1996/11/30 02:01:26 jtc Exp $ */
|
||||
/* $NetBSD: bzero.S,v 1.6 1997/01/04 03:21:13 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)bzero.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: bzero.S,v 1.5 1996/11/30 02:01:26 jtc Exp $")
|
||||
RCSID("$NetBSD: bzero.S,v 1.6 1997/01/04 03:21:13 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -59,26 +59,26 @@
|
||||
ENTRY(bzero)
|
||||
movl sp@(4),a0 | destination
|
||||
movl sp@(8),d0 | count
|
||||
beq Lbzdone | nothing to do
|
||||
jeq Lbzdone | nothing to do
|
||||
movl a0,d1
|
||||
btst #0,d1 | address odd?
|
||||
beq Lbzeven | no, skip alignment
|
||||
jeq Lbzeven | no, skip alignment
|
||||
clrb a0@+ | yes, clear a byte
|
||||
subql #1,d0 | adjust count
|
||||
beq Lbzdone | if zero, all done
|
||||
jeq Lbzdone | if zero, all done
|
||||
Lbzeven:
|
||||
movl d0,d1
|
||||
lsrl #2,d1 | convert to longword count
|
||||
beq Lbzbloop | no longwords, skip loop
|
||||
jeq Lbzbloop | no longwords, skip loop
|
||||
Lbzlloop:
|
||||
clrl a0@+ | clear a longword
|
||||
subql #1,d1 | adjust count
|
||||
bne Lbzlloop | still more, keep going
|
||||
jne Lbzlloop | still more, keep going
|
||||
andl #3,d0 | what remains
|
||||
beq Lbzdone | nothing, all done
|
||||
jeq Lbzdone | nothing, all done
|
||||
Lbzbloop:
|
||||
clrb a0@+ | clear a byte
|
||||
subql #1,d0 | adjust count
|
||||
bne Lbzbloop | still more, keep going
|
||||
jne Lbzbloop | still more, keep going
|
||||
Lbzdone:
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: index.S,v 1.5 1995/11/28 23:40:53 thorpej Exp $ */
|
||||
/* $NetBSD: index.S,v 1.6 1997/01/04 03:21:14 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)index.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: index.S,v 1.5 1995/11/28 23:40:53 thorpej Exp $")
|
||||
RCSID("$NetBSD: index.S,v 1.6 1997/01/04 03:21:14 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -56,9 +56,9 @@ ENTRY(index)
|
||||
movb sp@(11),d0 | char to look for
|
||||
ixloop:
|
||||
cmpb a0@,d0 | found our char?
|
||||
beq ixfound | yes, break out
|
||||
jeq ixfound | yes, break out
|
||||
tstb a0@+ | null?
|
||||
bne ixloop | no, keep going
|
||||
jne ixloop | no, keep going
|
||||
moveq #0,d0 | not found, return null
|
||||
rts
|
||||
ixfound:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rindex.S,v 1.5 1995/11/28 23:40:57 thorpej Exp $ */
|
||||
/* $NetBSD: rindex.S,v 1.6 1997/01/04 03:21:15 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)rindex.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: rindex.S,v 1.5 1995/11/28 23:40:57 thorpej Exp $")
|
||||
RCSID("$NetBSD: rindex.S,v 1.6 1997/01/04 03:21:15 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -57,10 +57,10 @@ ENTRY(rindex)
|
||||
subl a1,a1 | clear rindex pointer
|
||||
rixloop:
|
||||
cmpb a0@,d0 | found our char?
|
||||
bne rixnope | no, check for null
|
||||
jne rixnope | no, check for null
|
||||
movl a0,a1 | yes, remember location
|
||||
rixnope:
|
||||
tstb a0@+ | null?
|
||||
bne rixloop | no, keep going
|
||||
jne rixloop | no, keep going
|
||||
movl a1,d0 | return value
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strcat.S,v 1.5 1997/01/03 22:57:04 jtc Exp $ */
|
||||
/* $NetBSD: strcat.S,v 1.6 1997/01/04 03:21:15 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strcat.S,v 1.5 1997/01/03 22:57:04 jtc Exp $")
|
||||
RCSID("$NetBSD: strcat.S,v 1.6 1997/01/04 03:21:15 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -53,9 +53,9 @@ ENTRY(strcat)
|
||||
movl d0,a1 | a1 = toaddr
|
||||
Lslloop:
|
||||
tstb a1@+ | null?
|
||||
bne Lslloop | no, keep going
|
||||
jne Lslloop | no, keep going
|
||||
subql #1,a1
|
||||
Lscloop:
|
||||
movb a0@+,a1@+ | copy a byte
|
||||
bne Lscloop | copied non-null, keep going
|
||||
jne Lscloop | copied non-null, keep going
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strcmp.S,v 1.6 1997/01/03 22:57:05 jtc Exp $ */
|
||||
/* $NetBSD: strcmp.S,v 1.7 1997/01/04 03:21:16 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strcmp.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strcmp.S,v 1.6 1997/01/03 22:57:05 jtc Exp $")
|
||||
RCSID("$NetBSD: strcmp.S,v 1.7 1997/01/04 03:21:16 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -59,9 +59,9 @@ ENTRY(strcmp)
|
||||
Lscloop:
|
||||
movb a0@+,d0 | get *string1
|
||||
cmpb a1@+,d0 | compare a byte
|
||||
bne Lscexit | not equal, break out
|
||||
jne Lscexit | not equal, break out
|
||||
tstb d0 | at end of string1?
|
||||
bne Lscloop | no, keep going
|
||||
jne Lscloop | no, keep going
|
||||
moveq #0,d0 | strings are equal
|
||||
rts
|
||||
Lscexit:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strcpy.S,v 1.5 1997/01/03 22:57:05 jtc Exp $ */
|
||||
/* $NetBSD: strcpy.S,v 1.6 1997/01/04 03:21:17 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strcpy.S,v 1.5 1997/01/03 22:57:05 jtc Exp $")
|
||||
RCSID("$NetBSD: strcpy.S,v 1.6 1997/01/04 03:21:17 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -53,5 +53,5 @@ ENTRY(strcpy)
|
||||
movl d0,a1 | a1 = toaddr
|
||||
Lscloop:
|
||||
movb a0@+,a1@+ | copy a byte
|
||||
bne Lscloop | copied non-null, keep going
|
||||
jne Lscloop | copied non-null, keep going
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strlen.S,v 1.6 1997/01/03 22:57:06 jtc Exp $ */
|
||||
/* $NetBSD: strlen.S,v 1.7 1997/01/04 03:21:18 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strlen.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strlen.S,v 1.6 1997/01/03 22:57:06 jtc Exp $")
|
||||
RCSID("$NetBSD: strlen.S,v 1.7 1997/01/04 03:21:18 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -53,6 +53,6 @@ ENTRY(strlen)
|
||||
notl d0
|
||||
Lslloop:
|
||||
tstb a0@+ | null?
|
||||
bne Lslloop | no, keep going
|
||||
jne Lslloop | no, keep going
|
||||
addl a0,d0
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strncmp.S,v 1.5 1997/01/03 22:57:07 jtc Exp $ */
|
||||
/* $NetBSD: strncmp.S,v 1.6 1997/01/04 03:21:19 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,7 +43,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strncmp.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strncmp.S,v 1.5 1997/01/03 22:57:07 jtc Exp $")
|
||||
RCSID("$NetBSD: strncmp.S,v 1.6 1997/01/04 03:21:19 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -55,17 +55,17 @@
|
||||
*/
|
||||
ENTRY(strncmp)
|
||||
movl sp@(12),d1 | count
|
||||
beq Lscdone | nothing to do
|
||||
jeq Lscdone | nothing to do
|
||||
movl sp@(4),a0 | a0 = string1
|
||||
movl sp@(8),a1 | a1 = string2
|
||||
Lscloop:
|
||||
movb a0@+,d0 | get *string1
|
||||
cmpb a1@+,d0 | compare a byte
|
||||
bne Lscexit | not equal, break out
|
||||
jne Lscexit | not equal, break out
|
||||
tstb d0 | at end of string1?
|
||||
beq Lscdone | yes, all done
|
||||
jeq Lscdone | yes, all done
|
||||
subql #1,d1 | no, adjust count
|
||||
bne Lscloop | more to do, keep going
|
||||
jne Lscloop | more to do, keep going
|
||||
Lscdone:
|
||||
moveq #0,d0 | strings are equal
|
||||
rts
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: strncpy.S,v 1.5 1997/01/03 22:57:08 jtc Exp $ */
|
||||
/* $NetBSD: strncpy.S,v 1.6 1997/01/04 03:21:19 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -43,25 +43,25 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)strncpy.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: strncpy.S,v 1.5 1997/01/03 22:57:08 jtc Exp $")
|
||||
RCSID("$NetBSD: strncpy.S,v 1.6 1997/01/04 03:21:19 jtc Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
ENTRY(strncpy)
|
||||
movl sp@(4),d0 | return value is toaddr
|
||||
movl sp@(12),d1 | count
|
||||
beq Lscdone | nothing to do
|
||||
jeq Lscdone | nothing to do
|
||||
movl sp@(8),a0 | a0 = fromaddr
|
||||
movl d0,a1 | a1 = toaddr
|
||||
Lscloop:
|
||||
movb a0@+,a1@+ | copy a byte
|
||||
beq Lscploop | copied null, go pad if necessary
|
||||
jeq Lscploop | copied null, go pad if necessary
|
||||
subql #1,d1 | adjust count
|
||||
bne Lscloop | more room, keep going
|
||||
Lscdone:
|
||||
rts
|
||||
Lscploop:
|
||||
subql #1,d1 | adjust count
|
||||
beq Lscdone | no more room, all done
|
||||
jeq Lscdone | no more room, all done
|
||||
clrb a1@+ | clear a byte
|
||||
jra Lscploop | keep going
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: swab.S,v 1.4 1995/11/17 20:21:28 thorpej Exp $ */
|
||||
/* $NetBSD: swab.S,v 1.5 1997/01/04 03:21:20 jtc Exp $ */
|
||||
|
||||
#include "DEFS.h"
|
||||
|
||||
@ -7,14 +7,14 @@ ENTRY(swab)
|
||||
movl sp@(8),a1 | destination
|
||||
movl sp@(12),d0 | count
|
||||
lsrl #1,d0 | count is in bytes; we need words
|
||||
beq swdone
|
||||
jeq swdone
|
||||
|
||||
swloop:
|
||||
movw a0@+,d1
|
||||
rorw #8,d1
|
||||
movw d1,a1@+
|
||||
subql #1,d0
|
||||
bne swloop
|
||||
jne swloop
|
||||
|
||||
swdone:
|
||||
rts
|
||||
|
Loading…
Reference in New Issue
Block a user