amd64: patch ffsl to use the compiler builtin

This shortens fdalloc by over 60 bytes. Correctness verified by running both
variants at the same time and comparing the result of each call.

Note someone(tm) should make a pass at converting everything else feasible.
This commit is contained in:
Mateusz Guzik 2020-07-16 11:28:24 +00:00
parent 6b8b1bfef0
commit c4e64133d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363242

View File

@ -167,7 +167,8 @@ enable_intr(void)
static __inline __pure2 int
ffsl(long mask)
{
return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1);
return (__builtin_ffsl(mask));
}
#define HAVE_INLINE_FFSLL