Changeset 95bda0a for libcfa/src/bitmanip.hfa
- Timestamp:
- Oct 8, 2022, 4:29:32 PM (19 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 301071a, affb51b
- Parents:
- b2ddaf3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bitmanip.hfa
rb2ddaf3 r95bda0a 11 11 // Created On : Sat Mar 14 18:12:27 2020 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : S un Aug 23 21:39:28 202014 // Update Count : 14 013 // Last Modified On : Sat Oct 8 08:28:15 2022 14 // Update Count : 142 15 15 // 16 16 … … 21 21 // Bits are numbered 1-N. 22 22 23 #include <assert.h>24 25 23 #define __bitsizeof( n ) (sizeof(n) * __CHAR_BIT__) 26 24 27 static inline {25 static inline __attribute__((always_inline)) { 28 26 // Count leading 0 bits. 29 27 unsigned int leading0s( unsigned char n ) { return n != 0 ? __builtin_clz( n ) - (__bitsizeof(unsigned int) - __bitsizeof(n)) : __bitsizeof(n); }
Note: See TracChangeset
for help on using the changeset viewer.