Use insn sequence found by superoptimizer to compute return value. This

avoids the relatively expensive scc and ext instructions.
This commit is contained in:
jtc 1997-07-21 13:56:10 +00:00
parent 5941399374
commit 5e436cd360
2 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcmp.S,v 1.10 1997/05/18 21:24:46 jtc Exp $ */
/* $NetBSD: strcmp.S,v 1.11 1997/07/21 13:56:10 jtc Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -40,7 +40,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: strcmp.S,v 1.10 1997/05/18 21:24:46 jtc Exp $")
RCSID("$NetBSD: strcmp.S,v 1.11 1997/07/21 13:56:10 jtc Exp $")
#endif /* LIBC_SCCS and not lint */
ENTRY(strcmp)
@ -67,13 +67,13 @@ L1: /* unrolled by 4 for 680[23]0's */
subb a1@+,d1
jeq L1
scs d0
extbl d0
movb d1,d0
subxl d0,d0
subl d1,d0
addxl d1,d0
rts
L2: subb a1@,d1
L3: scs d0
extbl d0
movb d1,d0
L3: subxl d0,d0
subl d1,d0
addxl d1,d0
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: strncmp.S,v 1.9 1997/05/18 21:24:48 jtc Exp $ */
/* $NetBSD: strncmp.S,v 1.10 1997/07/21 13:56:11 jtc Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -40,7 +40,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: strncmp.S,v 1.9 1997/05/18 21:24:48 jtc Exp $")
RCSID("$NetBSD: strncmp.S,v 1.10 1997/07/21 13:56:11 jtc Exp $")
#endif /* LIBC_SCCS and not lint */
ENTRY(strncmp)
@ -48,7 +48,7 @@ ENTRY(strncmp)
jeq L4
movl sp@(4),a0
movl sp@(8),a1
L1: /* unroll by 4 for m680[23]0's */
L1: /* unrolled by 4 for 680[23]0's */
movb a0@+,d1
jeq L2
subb a1@+,d1
@ -79,7 +79,7 @@ L1: /* unroll by 4 for m680[23]0's */
L4: rts
L2: subb a1@,d1
L3: scs d0
extbl d0
movb d1,d0
L3: subxl d0,d0
subl d1,d0
addxl d1,d0
rts