blob: 74472299c5230435c6a9de1a78b02f2a9d7ad7ca [file] [log] [blame]
Stefan Kristiansson6e560bb2011-11-26 19:04:49 +00001/*
2 * OpenRISC Linux
3 *
4 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Stefan Kristiansson6e560bb2011-11-26 19:04:49 +00007 */
8
9#ifndef __ASM_OPENRISC_FLS_H
10#define __ASM_OPENRISC_FLS_H
11
12static inline int fls(int x)
13{
14 int ret;
15
16 __asm__ ("l.fl1 %0,%1"
17 : "=r" (ret)
18 : "r" (x));
19
20 return ret;
21}
22
23#endif /* __ASM_OPENRISC_FLS_H */