Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bitmanip.hfa

    r66f3bae ree06db5c  
    1111// Created On       : Sat Mar 14 18:12:27 2020
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Sun Apr 19 22:29:58 2020
    14 // Update Count     : 121
     13// Last Modified On : Tue Jun  9 15:14:04 2020
     14// Update Count     : 123
    1515//
    1616
     
    4848
    4949        // Count all 0 bits.
    50         unsigned int all0s( unsigned char n ) { return __bitsizeof(n) - __builtin_popcount( n ); }
    51         unsigned int all0s( unsigned short int n ) { return __bitsizeof(n) - __builtin_popcount( n ); }
    52         unsigned int all0s( unsigned int n ) { return __bitsizeof(n) - __builtin_popcount( n ); }
    53         unsigned int all0s( unsigned long int n ) { return __bitsizeof(n) - __builtin_popcountl( n ); }
    54         unsigned int all0s( unsigned long long int n ) { return __bitsizeof(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 ); }
    5555
    5656        // Find least significiant zero bit. (ffs)
Note: See TracChangeset for help on using the changeset viewer.