Changeset 1621


Ignore:
Timestamp:
Oct 31, 2011, 4:03:22 AM (8 years ago)
Author:
ksherdy
Message:

Template specialied over Macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock.hpp

    r1617 r1621  
    3131#endif
    3232
    33 /* Template specialization is slightly slower, but may be required to differentiate on integer types unsigned long and unsigned long long.
    34 //template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes(block_t s);
    35 //template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(block_t s);
     33// Template specialization is slightly slower, but is required to differentiate on integer types unsigned long and unsigned long long.
     34template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes(block_t s);
     35template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(block_t s);
    3636template<> IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes<unsigned long>(unsigned long s) {return cfzl(s);}
    3737template<> IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes<unsigned long long>(unsigned long long s) {return cfzll(s);}
    3838template<> IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes<unsigned long>(unsigned long s) {return cbzl(s);}
    3939template<> IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes<unsigned long long>(unsigned long long s) {return cbzll(s);}
    40 */
    4140
     41/*
    4242static IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes(unsigned long v) { return cfzl(v);}
    4343static IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes(unsigned long long v) { return cfzll(v);}
    4444static IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(unsigned long s) {return cbzl(s);}
    4545static IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(unsigned long long s) {return cbzll(s);}
     46*/
    4647
    4748template <class T>
Note: See TracChangeset for help on using the changeset viewer.