1 /* ffs -- find first set bit in a word, counted from least significant end.
2 For i960 Core architecture
3 This file is part of the GNU C Library.
4 Copyright (C) 1994, 1997, 2004, 2005 Free Software Foundation, Inc.
5 Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
6 On-Line Applications Research Corporation.
8 The GNU C Library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 The GNU C Library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the GNU C Library; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 #if defined (__GNUC__) && defined (__i960__)
35 asm ("scanbit %1,%0" : "=d" (cnt
) : "rm" (x
& -x
));
39 weak_alias (__ffs
, ffs
)
40 libc_hidden_builtin_def (ffs
)
44 #include <string/ffs.c>