- Timestamp:
- Jun 9, 2020, 3:45:39 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, 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.