ffs.S revision 1.5 1 1.5 matt /* $NetBSD: ffs.S,v 1.5 2011/01/15 07:31:12 matt Exp $ */
2 1.1 christos
3 1.4 ross /*-
4 1.4 ross * Copyright (C) 2001 Martin J. Laubach <mjl (at) NetBSD.org>
5 1.4 ross * All rights reserved.
6 1.4 ross *
7 1.4 ross * Redistribution and use in source and binary forms, with or without
8 1.4 ross * modification, are permitted provided that the following conditions
9 1.4 ross * are met:
10 1.4 ross * 1. Redistributions of source code must retain the above copyright
11 1.4 ross * notice, this list of conditions and the following disclaimer.
12 1.4 ross * 2. Redistributions in binary form must reproduce the above copyright
13 1.4 ross * notice, this list of conditions and the following disclaimer in the
14 1.4 ross * documentation and/or other materials provided with the distribution.
15 1.4 ross * 3. The name of the author may not be used to endorse or promote products
16 1.4 ross * derived from this software without specific prior written permission.
17 1.4 ross *
18 1.4 ross * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.4 ross * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.4 ross * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.4 ross * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.4 ross * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 1.4 ross * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 1.4 ross * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 1.4 ross * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 1.4 ross * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 1.4 ross * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 1.4 ross */
29 1.4 ross /*----------------------------------------------------------------------*/
30 1.4 ross
31 1.5 matt #include <machine/asm.h>
32 1.4 ross
33 1.5 matt __RCSID("$NetBSD: ffs.S,v 1.5 2011/01/15 07:31:12 matt Exp $")
34 1.4 ross
35 1.5 matt .align 4
36 1.4 ross ENTRY(ffs)
37 1.4 ross neg %r4, %r3
38 1.4 ross and %r3, %r4, %r3
39 1.4 ross cntlzw %r3, %r3
40 1.4 ross li %r0, 32
41 1.4 ross subf %r3, %r3, %r0
42 1.4 ross blr
43 1.5 matt END(ffs)
44 1.4 ross
45 1.4 ross /*----------------------------------------------------------------------*/
46