Changeset 1904


Ignore:
Timestamp:
Jan 28, 2012, 2:10:33 PM (7 years ago)
Author:
cameron
Message:

_BitScanReverse returns position, not count of zeroes. Fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/builtins.hpp

    r1888 r1904  
    8686
    8787        IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0
    88                 unsigned long zeroes;
     88                unsigned long pos;
    8989                ScanReverseIntrinsic(&zeroes, x);
    90                 return (uint32_t) zeroes;
     90                return (uint32_t) (8* sizeof(scanword_t) - pos - 1);
    9191        }
    9292
Note: See TracChangeset for help on using the changeset viewer.