sna: Rewrite __fls without dependence upon x86 assembly
The asm() prevents SNA from compiling on ia64. Fixes https://bugs.gentoo.org/show_bug.cgi?id=448570
This commit is contained in:
parent
bc67bdcec8
commit
fc702cdf53
|
|
@ -516,10 +516,19 @@ static void gem_close(int fd, uint32_t handle)
|
|||
|
||||
constant inline static unsigned long __fls(unsigned long word)
|
||||
{
|
||||
#if defined(__GNUC__) && (defined(__x86__) || defined(__x86_64__))
|
||||
asm("bsr %1,%0"
|
||||
: "=r" (word)
|
||||
: "rm" (word));
|
||||
return word;
|
||||
#else
|
||||
unsigned int v = 1;
|
||||
|
||||
while (word >>= 1)
|
||||
v++;
|
||||
|
||||
return v;
|
||||
#endif
|
||||
}
|
||||
|
||||
constant inline static int cache_bucket(int num_pages)
|
||||
|
|
|
|||
Loading…
Reference in New Issue