Changeset ee06db5c
 Timestamp:
 Jun 9, 2020, 3:45:39 PM (2 years ago)
 Branches:
 armeh, enum, forallpointerdecay, jacob/cs343translation, master, newast, newastuniqueexpr, pthreademulation, qualifiedEnum
 Children:
 280ec46, 97392b69
 Parents:
 b54118a
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libcfa/src/bitmanip.hfa
rb54118a ree06db5c 11 11 // Created On : Sat Mar 14 18:12:27 2020 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Apr 19 22:29:58202014 // Update Count : 12 113 // Last Modified On : Tue Jun 9 15:14:04 2020 14 // Update Count : 123 15 15 // 16 16 … … 48 48 49 49 // Count all 0 bits. 50 unsigned int all0s( unsigned char n ) { return __b itsizeof(n)  __builtin_popcount(n ); }51 unsigned int all0s( unsigned short int n ) { return __b itsizeof(n)  __builtin_popcount(n ); }52 unsigned int all0s( unsigned int n ) { return __b itsizeof(n)  __builtin_popcount(n ); }53 unsigned int all0s( unsigned long int n ) { return __b itsizeof(n)  __builtin_popcountl(n ); }54 unsigned int all0s( unsigned long long int n ) { return __b itsizeof(n)  __builtin_popcountll(n ); }50 unsigned int all0s( unsigned char n ) { return __builtin_popcount( (typeof(n))~n ); } 51 unsigned int all0s( unsigned short int n ) { return __builtin_popcount( (typeof(n))~n ); } 52 unsigned int all0s( unsigned int n ) { return __builtin_popcount( ~n ); } 53 unsigned int all0s( unsigned long int n ) { return __builtin_popcountl( ~n ); } 54 unsigned int all0s( unsigned long long int n ) { return __builtin_popcountll( ~n ); } 55 55 56 56 // Find least significiant zero bit. (ffs)
Note: See TracChangeset
for help on using the changeset viewer.