Changeset 1888


Ignore:
Timestamp:
Jan 27, 2012, 7:34:42 AM (7 years ago)
Author:
cameron
Message:

Minor documentation note.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/builtins.hpp

    r1885 r1888  
    2828        #include <intrin.h>
    2929        #pragma intrinsic(_BitScanForward)
    30         IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) { // Precondition: x > 0
     30        IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) { // Precondition: x != 0
    3131                unsigned long zeroes;
    3232                _BitScanForward(&zeroes, x);
     
    7979        #pragma intrinsic(ScanForwardIntrinsic)
    8080        #pragma intrinsic(ScanReverseIntrinsic)
    81         IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x > 0
     81        IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0
    8282                unsigned long zeroes;
    8383                ScanForwardIntrinsic(&zeroes, x);
     
    8585        }
    8686
    87         IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x > 0
     87        IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0
    8888                unsigned long zeroes;
    8989                ScanReverseIntrinsic(&zeroes, x);
     
    107107        #endif
    108108
    109         IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x > 0
     109        IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0
    110110                return (uint32_t) ScanForwardIntrinsic((scanword_t) x);
    111111        }
    112112
    113         IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x > 0
     113        IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0
    114114                return (uint32_t) ScanReverseIntrinsic((scanword_t) x);
    115115        }
     
    119119
    120120#else
    121 # ifndef _MSC_VER
    122121  #warning "Neither _MSC_VER nor __GNUC__ defined: scan_forward/backward_zeroes not implemented."
    123 # endif
    124122#endif
    125123
Note: See TracChangeset for help on using the changeset viewer.