lkml.org 
[lkml]   [2000]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectfind_first_zero_bit problems...
I encountered the following problem with kernel 2.4-test4 on an dual
Celeron machine

calling the find_first_zero_bit inline function works well inside a loop
eg:

do {
i = find_first_zero_bit(p, num_bits);
if (i == num_bits)
break;
set_bit(i%32, p+(i/32));

}while(1);

but when manually unrolling the loop the function seems to be called only
once...

I'm compiling with gcc-2.95.2 for Intel arch

the following patch fixes the problem, I'm unsure if it is the right way
to go.

If there's any comment about this reply to me directly as I'm not on the
list

thanks
--- oldbitops.h Thu Jul 27 10:22:04 2000
+++ bitops.h Thu Jul 27 10:25:33 2000
@@ -134,7 +134,7 @@

if (!size)
return 0;
- __asm__ ("movl $-1,%%eax\n\t"
+ __asm__ __volatile__ ("movl $-1,%%eax\n\t"
"xorl %%edx,%%edx\n\t"
"repe; scasl\n\t"
"je 1f\n\t"
\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.029 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site