News for hackers. Stuff that matters.
Re:Counting bytes fast by nialo on Saturday September 27, 2014 @10:39PM (#8378779)
I am not an assembly programmer, and there is probably a better way, but something neat that thinking about this resulted in:

If instead of 16 512bit registers, we simply want to increment the appropriate section of one big register, we can add 2^(byte * n), where byte is the value of the byte in question, and n is the number of bits we're using to count the results.

Re:Counting bytes fast by pmalynin on Saturday September 27, 2014 @11:03PM (#8378812)
Right. However, AVX and SSE registers aren't just big 512-128 bit numbers. But rather arrays of bytes/shorts/ints/floats/doubles.
Re:Counting bytes fast by acqq on Sunday September 28, 2014 @04:43PM (#8380859)
Actually, you can add one 512-bit register with another 512 bit register in a single instruction. You won't get a carry from a segment to a segment but nialo's general idea can be implemented.

How fast it can be done is another topic.