* common.din (ffsl): Export.
(ffsll): Export. * syscalls.cc (ffs): Implement using GCC intrinsic. (ffsl): Ditto. (ffsll): Ditto. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
This commit is contained in:
parent
2fb56bbfaa
commit
d326f841c3
|
@ -374,6 +374,8 @@ feupdateenv SIGFE
|
||||||
fexecve SIGFE
|
fexecve SIGFE
|
||||||
fflush SIGFE
|
fflush SIGFE
|
||||||
ffs NOSIGFE
|
ffs NOSIGFE
|
||||||
|
ffsl NOSIGFE
|
||||||
|
ffsll NOSIGFE
|
||||||
fgetc SIGFE
|
fgetc SIGFE
|
||||||
fgetpos SIGFE
|
fgetpos SIGFE
|
||||||
fgets SIGFE
|
fgets SIGFE
|
||||||
|
|
|
@ -451,12 +451,13 @@ details. */
|
||||||
275: Introduce account mapping from Windows account DBs. Add CW_SETENT,
|
275: Introduce account mapping from Windows account DBs. Add CW_SETENT,
|
||||||
CW_GETENT, CW_ENDENT, CW_GETNSSSEP, CW_GETPWSID, CW_GETGRSID,
|
CW_GETENT, CW_ENDENT, CW_GETNSSSEP, CW_GETPWSID, CW_GETGRSID,
|
||||||
CW_CYGNAME_FROM_WINNAME.
|
CW_CYGNAME_FROM_WINNAME.
|
||||||
|
276: Export ffsl, ffsll.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
||||||
|
|
||||||
#define CYGWIN_VERSION_API_MAJOR 0
|
#define CYGWIN_VERSION_API_MAJOR 0
|
||||||
#define CYGWIN_VERSION_API_MINOR 275
|
#define CYGWIN_VERSION_API_MINOR 276
|
||||||
|
|
||||||
/* There is also a compatibity version number associated with the
|
/* There is also a compatibity version number associated with the
|
||||||
shared memory regions. It is incremented when incompatible
|
shared memory regions. It is incremented when incompatible
|
||||||
|
|
|
@ -3836,22 +3836,19 @@ nice (int incr)
|
||||||
extern "C" int
|
extern "C" int
|
||||||
ffs (int i)
|
ffs (int i)
|
||||||
{
|
{
|
||||||
static const unsigned char table[] =
|
return __builtin_ffs (i);
|
||||||
{
|
}
|
||||||
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
|
|
||||||
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
|
|
||||||
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
|
|
||||||
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
|
|
||||||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
||||||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
||||||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
||||||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
|
|
||||||
};
|
|
||||||
unsigned x = i & -i;
|
|
||||||
|
|
||||||
int a = x <= 0xffff ? (x <= 0xff ? 0 : 8) : (x <= 0xffffff ? 16 : 24);
|
extern "C" int
|
||||||
|
ffsl (long i)
|
||||||
|
{
|
||||||
|
return __builtin_ffsl (i);
|
||||||
|
}
|
||||||
|
|
||||||
return table[x >> a] + a;
|
extern "C" int
|
||||||
|
ffsll (long long i)
|
||||||
|
{
|
||||||
|
return __builtin_ffsll (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue