Expand a comment.
authorGuy Harris <guy@alum.mit.edu>
Tue, 13 Mar 2018 22:28:35 +0000 (15:28 -0700)
committerGuy Harris <guy@alum.mit.edu>
Tue, 13 Mar 2018 22:29:27 +0000 (22:29 +0000)
Change-Id: I154bce4901929c5f3eafa88cae2cd4ce53b28326
Reviewed-on: https://code.wireshark.org/review/26466
Reviewed-by: Guy Harris <guy@alum.mit.edu>
wsutil/bits_count_ones.h

index 2e532e93b0867a119c27f3f6e57ad6b1a6ea3d8f..0055d122e83c42d9908bd049ef80587df47bab51 100644 (file)
 
 /*
  * The variable-precision SWAR algorithm is an interesting way to count
- * the number of bits set in an integer. While its performance is very
- * good (two times faster than gcc's __builtin_popcount [1] and
- * 16 instructions when compiled with gcc -O3)
- * http://playingwithpointers.com/swar.html
+ * the number of bits set in an integer:
+ *
+ *     http://playingwithpointers.com/swar.html
+ *
+ * See
+ *
+ *     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36041
+ *     https://danluu.com/assembly-intrinsics/
+ *
+ * for discussions of various forms of population-counting code on x86.
+ *
+ * See
+ *
+ *     https://msdn.microsoft.com/en-us/library/bb385231.aspx
+ *
+ * for MSVC's population count intrinsics.
+ *
+ * Note that not all x86 processors support the POPCOUNT instruction.
+ *
+ * Other CPUs may have population count instructions as well.     
  */
 
 static inline int