Top "Hammingweight" questions

The Hamming weight of a positive integer is the count of one bits in its binary representation.

How to count the number of set bits in a 32-bit integer?

8 bits representing the number 7 look like this: 00000111 Three bits are set. What are algorithms to determine the number of set …

algorithm binary bit-manipulation hammingweight iec10967
C code to count the number of '1' bits in an unsigned char

I need C code to return the number of 1's in an unsigned char in C. I need an explanation …

c hammingweight
NASM: Count how many bits in a 32 Bit number are set to 1

I have a 32 Bit number and want to count know how many bits are 1. I'm thinking of this pseudocode: mov …

assembly x86 bit-manipulation nasm hammingweight
How to generate a sse4.2 popcnt machine instruction

Using the c program: int main(int argc , char** argv) { return __builtin_popcountll(0xf0f0f0f0f0f0f0…

gcc optimization bit-manipulation hammingweight
Calculating Hamming weight efficiently in matlab

Given a MATLAB uint32 to be interpreted as a bit string, what is an efficient and concise way of counting …

matlab bit-manipulation bitstring hammingweight
Fast counting the number of set bits in __m128i register

I should count the number of set bits of a __m128i register. In particular, I should write two functions …

c sse simd sse2 hammingweight
Bit popcount for large buffer, with Core 2 CPU (SSSE3)

I'm looking for the fastest way to popcount on large buffer of 512 or more bytes. I can guarantee any required …

c assembly optimization x86 hammingweight
Counting the number of bits that are set

I want to count the number of bits in a binary number that are set. For example, user enter the …

assembly mips hammingweight