* 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:
		| @@ -374,6 +374,8 @@ feupdateenv SIGFE | ||||
| fexecve SIGFE | ||||
| fflush SIGFE | ||||
| ffs NOSIGFE | ||||
| ffsl NOSIGFE | ||||
| ffsll NOSIGFE | ||||
| fgetc SIGFE | ||||
| fgetpos SIGFE | ||||
| fgets SIGFE | ||||
|   | ||||
| @@ -451,12 +451,13 @@ details. */ | ||||
|       275: Introduce account mapping from Windows account DBs.  Add CW_SETENT, | ||||
| 	   CW_GETENT, CW_ENDENT, CW_GETNSSSEP, CW_GETPWSID, CW_GETGRSID, | ||||
| 	   CW_CYGNAME_FROM_WINNAME. | ||||
|       276: Export ffsl, ffsll. | ||||
|      */ | ||||
|  | ||||
|      /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ | ||||
|  | ||||
| #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 | ||||
| 	shared memory regions.  It is incremented when incompatible | ||||
|   | ||||
| @@ -3836,22 +3836,19 @@ nice (int incr) | ||||
| extern "C" int | ||||
| ffs (int i) | ||||
| { | ||||
|   static const unsigned char table[] = | ||||
|     { | ||||
|       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; | ||||
|   return __builtin_ffs (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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user