Changeset 1860


Ignore:
Timestamp:
Jan 19, 2012, 8:50:24 PM (7 years ago)
Author:
ksherdy
Message:

Deprecated cfzl, cbzl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/builtins.hpp

    r1856 r1860  
    2525        }
    2626
     27        // DEPRECATED - USE scan_forward_zeroes
     28        #include <intrin.h>
     29        #pragma intrinsic(_BitScanForward)
     30        IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) { // Precondition: x > 0
     31                unsigned long zeroes;
     32                _BitScanForward(&zeroes, x);
     33                return zeroes;
     34        }
     35
     36        // DEPRECATED - USE scan_backward_zeroes
     37        IDISA_ALWAYS_INLINE unsigned long cbzl(unsigned long x) {
     38                unsigned long zeroes;
     39                _BitScanReverse(&zeroes, x);
     40                return zeroes;
     41        }
     42
    2743#elif defined (__GNUC__)
    2844
     
    3349        IDISA_ALWAYS_INLINE long unlikely(long x) {
    3450                return __builtin_expect(x, 0);
     51        }
     52
     53        // DEPRECATED - USE scan_forward_zeroes
     54        IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) {
     55                return __builtin_ctzl(x);
     56        }
     57
     58        // DEPRECATED - USE scan_backward_zeroes
     59        IDISA_ALWAYS_INLINE unsigned long cbzl(unsigned long x) {
     60                return __builtin_clzl(x);
    3561        }
    3662
Note: See TracChangeset for help on using the changeset viewer.