Changeset 1888 for trunk/lib/builtins.hpp
 Timestamp:
 Jan 27, 2012, 7:34:42 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/builtins.hpp
r1885 r1888 28 28 #include <intrin.h> 29 29 #pragma intrinsic(_BitScanForward) 30 IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) { // Precondition: x >030 IDISA_ALWAYS_INLINE unsigned long cfzl(unsigned long x) { // Precondition: x != 0 31 31 unsigned long zeroes; 32 32 _BitScanForward(&zeroes, x); … … 79 79 #pragma intrinsic(ScanForwardIntrinsic) 80 80 #pragma intrinsic(ScanReverseIntrinsic) 81 IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x >081 IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0 82 82 unsigned long zeroes; 83 83 ScanForwardIntrinsic(&zeroes, x); … … 85 85 } 86 86 87 IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x >087 IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0 88 88 unsigned long zeroes; 89 89 ScanReverseIntrinsic(&zeroes, x); … … 107 107 #endif 108 108 109 IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x >0109 IDISA_ALWAYS_INLINE uint32_t scan_forward_zeroes(scanword_t x) { // Precondition: x != 0 110 110 return (uint32_t) ScanForwardIntrinsic((scanword_t) x); 111 111 } 112 112 113 IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x >0113 IDISA_ALWAYS_INLINE uint32_t scan_backward_zeroes(scanword_t x) { // Precondition: x != 0 114 114 return (uint32_t) ScanReverseIntrinsic((scanword_t) x); 115 115 } … … 119 119 120 120 #else 121 # ifndef _MSC_VER122 121 #warning "Neither _MSC_VER nor __GNUC__ defined: scan_forward/backward_zeroes not implemented." 123 # endif124 122 #endif 125 123
Note: See TracChangeset
for help on using the changeset viewer.