Ignore:
Timestamp:
Oct 30, 2012, 1:17:27 PM (7 years ago)
Author:
ksherdy
Message:

Rename scanword_t ScanWord?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/builtins.hpp

    r2275 r2594  
    99    Licensed to the public under the Open Software License 3.0.
    1010    Licensed to International Characters Inc.
    11        under the Academic Free License version 3.0.
     11       under the Academic Free License version 3.0. 
    1212=============================================================================*/
    1313
     
    4242
    4343        #ifdef _M_X64
    44         typedef unsigned __int64 scanword_t;
     44        typedef unsigned __int64 ScanWord;
    4545        #define ScanForwardIntrinsic _BitScanForward64
    4646        #define ScanReverseIntrinsic _BitScanReverse64
    4747        #else
    48         typedef unsigned __int32 scanword_t;
     48        typedef unsigned __int32 ScanWord;
    4949        #define ScanForwardIntrinsic _BitScanForward
    5050        #define ScanReverseIntrinsic _BitScanReverse
     
    5353        #pragma intrinsic(ScanForwardIntrinsic)
    5454        #pragma intrinsic(ScanReverseIntrinsic)
    55         IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0
     55        IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(ScanWord x) { // Precondition: x != 0
    5656                unsigned long zeroes;
    5757                ScanForwardIntrinsic(&zeroes, x);
     
    5959        }
    6060
    61         IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0
     61        IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(ScanWord x) { // Precondition: x != 0
    6262                unsigned long pos;
    6363                ScanReverseIntrinsic(&pos, x);
    64                 return (uint32_t) (8* sizeof(scanword_t) - pos - 1);
     64                return (uint32_t) (8* sizeof(ScanWord) - pos - 1);
    6565        }
    6666
     
    7171
    7272        #if __x86_64__ /* 64-bit architecture */
    73         typedef uint64_t scanword_t;
     73        typedef uint64_t ScanWord;
    7474        #define ScanForwardIntrinsic __builtin_ctzll
    7575        #define ScanReverseIntrinsic __builtin_clzll
    7676
    7777        #else
    78         typedef uint32_t scanword_t;
     78        typedef uint32_t ScanWord;
    7979        #define ScanForwardIntrinsic __builtin_ctzl
    8080        #define ScanReverseIntrinsic __builtin_clzl
    8181        #endif
    8282
    83         IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0
    84                 return (uint32_t) ScanForwardIntrinsic((scanword_t) x);
     83        IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(ScanWord x) { // Precondition: x != 0
     84                return (uint32_t) ScanForwardIntrinsic((ScanWord) x);
    8585        }
    8686
    87         IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0
    88                 return (uint32_t) ScanReverseIntrinsic((scanword_t) x);
     87        IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(ScanWord x) { // Precondition: x != 0
     88                return (uint32_t) ScanReverseIntrinsic((ScanWord) x);
    8989        }
    9090
Note: See TracChangeset for help on using the changeset viewer.