Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Counting bits in unsigned 64 bit using precomputation?

Правка en1, от -synx-, 2017-05-30 06:59:57

I know that counting bits using precomputation is the fastest way to go (over __builtin_popcount()).
For 32 bit integers we can do cnt[x>>16]+cnt[x&65535] by precomputing counts upto (1<<16).
How can we do it for 64 bit integers by precomputing upto (1<<22).

Теги popcount, bitwise

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский -synx- 2017-05-30 06:59:57 328 Initial revision (published)