Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/m68k/string On the 68010 only, assemble a diff...



details:   https://anonhg.NetBSD.org/src/rev/262a5a25be60
branches:  trunk
changeset: 510044:262a5a25be60
user:      fredette <fredette%NetBSD.org@localhost>
date:      Thu May 17 21:26:06 2001 +0000

description:
On the 68010 only, assemble a different version of
this function, since the 68010 doesn't have bit
instructions.

diffstat:

 lib/libc/arch/m68k/string/ffs.S |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r e05007a338de -r 262a5a25be60 lib/libc/arch/m68k/string/ffs.S
--- a/lib/libc/arch/m68k/string/ffs.S   Thu May 17 21:24:08 2001 +0000
+++ b/lib/libc/arch/m68k/string/ffs.S   Thu May 17 21:26:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs.S,v 1.7 1999/10/25 23:48:15 thorpej Exp $  */
+/*     $NetBSD: ffs.S,v 1.8 2001/05/17 21:26:06 fredette Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -43,12 +43,14 @@
 #if 0
        RCSID("from: @(#)ffs.s  5.1 (Berkeley) 5/12/90")
 #else
-       RCSID("$NetBSD: ffs.S,v 1.7 1999/10/25 23:48:15 thorpej Exp $")
+       RCSID("$NetBSD: ffs.S,v 1.8 2001/05/17 21:26:06 fredette Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
 /* bit = ffs(value) */
 
+#ifndef        __mc68010__
+
 ENTRY(ffs)
        movl    %sp@(4),%d0
        movl    %d0,%d1
@@ -58,3 +60,19 @@
        bfffo   %d1{#0:#32},%d1
        subl    %d1,%d0
        rts
+
+#else  /* __mc68010__ */
+
+ENTRY(ffs)
+       movl    %sp@(4),%d0
+       jeq     L2
+       movql   #31,%d1
+L1:    
+       lsrl    #1,%d0
+       dbcs    %d1,L1
+       movql   #32,%d0
+       subl    %d1,%d0
+L2:
+       rts
+
+#endif /* __mc68010__ */



Home | Main Index | Thread Index | Old Index