lkml.org 
[lkml]   [2008]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Alternative implementation of the generic __ffs
From
Date
On Sun, 2008-04-20 at 01:29 +0300, Matti Aarnio wrote:
> I am curious, why not take the code already in glibc ffs() for ARM ?
> That is, if the ffs() is all that important detail in kernel ?

Here's test results with the glibc ffs implementation.
(small const is still using slower add rather than or)

$ gcc -Os -fomit-frame-pointer ffs.c
$ ./a.out
Original: 3155 tics, 8331 tics
New: 4211 tics, 8793 tics
Smallest: 4019 tics, 7754 tics
Small const: 3552 tics, 6308 tics
glibc: 2816 tics, 6911 tics
Empty loop: 1516 tics, 2244 tics

$ gcc -O2 -fomit-frame-pointer ffs.c
$ ./a.out
Original: 3155 tics, 7828 tics
New: 4792 tics, 8825 tics
Smallest: 4401 tics, 7155 tics
Small const: 3539 tics, 5805 tics
glibc: 2720 tics, 7061 tics
Empty loop: 1516 tics, 2148 tics

$ gcc -O3 -fomit-frame-pointer ffs.c
$ ./a.out
Original: 3080 tics, 7706 tics
New: 4721 tics, 8663 tics
Smallest: 4334 tics, 7116 tics
Small const: 3466 tics, 5672 tics
glibc: 2649 tics, 6939 tics
Empty loop: 1444 tics, 2012 tics




\
 
 \ /
  Last update: 2008-04-20 05:09    [W:0.743 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site