English

A SWAR Approach to Counting Ones

Computational Complexity 2015-07-03 v3

Abstract

We investigate the complexity of algorithms counting ones in different sets of operations. With addition and logical operations (but no shift) O(log2(n))O(\log^2(n)) steps suffice to count ones. Parity can be computed with complexity O(log(n))O(\log(n)), which is the same bound as for methods using shift-operations. If multiplication is available, a solution of time complexity O(log(n))O(\log^*(n)) is possible improving the known bound O(loglog(n))O(\log\log(n)).

Keywords

Cite

@article{arxiv.1108.3860,
  title  = {A SWAR Approach to Counting Ones},
  author = {Holger Petersen},
  journal= {arXiv preprint arXiv:1108.3860},
  year   = {2015}
}
R2 v1 2026-06-21T18:52:39.836Z