[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in PPC version of __L4_msb/lsb
From: |
Peter Bruin |
Subject: |
Bug in PPC version of __L4_msb/lsb |
Date: |
Mon, 2 Aug 2004 14:53:36 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2.1 |
Hi,
There are two small bugs in the PPC version of __L4_msb and __L4_lsb; here's a
patch to fix them.
Thanks,
Peter
2004-08-02 Peter Bruin <address@hidden>
* libl4/powerpc/l4/bits/math.h (__L4_msb): Count leading zeros of
`data' instead of `data & -data'.
(__L4_lsb): Call __L4_msb instead of __l4_msb. Remove unused
variable `lsb'.
Index: libl4/powerpc/l4/bits/math.h
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/libl4/powerpc/l4/bits/math.h,v
retrieving revision 1.3
diff -u -r1.3 math.h
--- libl4/powerpc/l4/bits/math.h 16 Mar 2004 03:34:03 -0000 1.3
+++ libl4/powerpc/l4/bits/math.h 1 Aug 2004 22:26:31 -0000
@@ -34,7 +34,7 @@
/* Count the leading zeros. */
asm ("cntlzw %[msb], %[data]"
: [msb] "=r" (msb)
- : [data] "r" (data & -data));
+ : [data] "r" (data));
return 32 - msb;
}
@@ -45,8 +45,6 @@
_L4_attribute_always_inline _L4_attribute_const
__L4_lsb (_L4_word_t data)
{
- _L4_word_t lsb;
-
/* x & -x clears all bits in the word except the LSB set. */
- return __l4_msb (data & -data);
+ return __L4_msb (data & -data);
}
- Bug in PPC version of __L4_msb/lsb,
Peter Bruin <=