diff lib/count-one-bits.c @ 17514:d78ea0b1af11

count-one-bits: port to MSC; support types wider than 64 bits The ideas behind the MSC port are stolen from Emacs. * lib/count-one-bits.c (popcount_support) [_MSC_VER]: New variable. * lib/count-one-bits.h: Include limits.h, for CHAR_BIT. Don't include verify.h: it's no longer needed, as types wider than 64 bits are now supported. (COUNT_ONE_BITS_GENERIC): New macro. (popcount_supported) [_MSC_VER]: New inline function. (COUNT_ONE_BITS): Use it. New arg MSC_BUILTIN, for better performance with MSC. All uses changed. Do not assume that TYPE has at most 64 bits. * modules/count-one-bits (Depends-on): Do not depend on 'verify'.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 06 Oct 2013 23:43:43 -0700
parents 7178d4d98ee5
children
line wrap: on
line diff
--- a/lib/count-one-bits.c
+++ b/lib/count-one-bits.c
@@ -1,3 +1,7 @@
 #include <config.h>
 #define COUNT_ONE_BITS_INLINE _GL_EXTERN_INLINE
 #include "count-one-bits.h"
+
+#if 1500 <= _MSC_VER && (defined _M_IX86 || defined _M_X64)
+int popcount_support = -1;
+#endif