Changeset 1976
- Timestamp:
- 03/27/12 11:56:06 (15 months ago)
- Files:
-
- 1 modified
-
trunk/lib/bitblock_scan.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/bitblock_scan.hpp
r1950 r1976 91 91 92 92 IDISA_ALWAYS_INLINE int32_t scan_to_next() { 93 const scanblock_t one_bit = 1; /* ensure enough bits for shift: one_bit << this->pos */ 93 94 while (this->blk > 0){ 94 95 if(has_bit(this->scan_blk)){ 95 96 this->pos = (sizeof(scanblock_t)*8 - scan_backward_zeroes(this->scan_blk) -1) + ( (this->blk-1) * sizeof(scanblock_t)*8 ); 96 this->scan_blk = this->scan_blk ^ ( 1<< this->pos); // clear leftmost bit97 this->scan_blk = this->scan_blk ^ (one_bit << this->pos); // clear leftmost bit 97 98 return (this->pos); 98 99 }
