| From: | "Venkatesh Srinivas \(via DragonFly issue tracker\)" <sinknull@xxxxxxxxxxxxxxxxxxxxx> |
| Date: | Wed, 26 May 2010 05:14:01 +0000 |
Venkatesh Srinivas <me@acm.jhu.edu> added the comment:
Hi,
This is an improved version of the patch that corrects my silly jz mistake and
adds ffsl and flsl. It also implements both for x86_64. The x86-64 version is
branchless, using cmov.
This alternate snippet may be better and would allow for a branchless f?f(l) on
i386, except bsr and bsf are defined differently on Intel and AMD x86 machines.
It may be better on x86_64 than the cmov-based version:
xorl %eax, %eax
xorl %ecx, %ecx
bsrl 4(%esp), %eax
setnz %cl
addl %ecx, %eax
ret
Thanks,
-- vs
_____________________________________________________
DragonFly issue tracker <bugs@lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1770>
_____________________________________________________Attachment:
0001-libc-Add-assembler-ffs-fls-ffsl-flsl-to-i386-and.patch
Description: Binary data