HackerPapers

arXiv:2412.16370cs.DS

Faster Positional-Population Counts for AVX2, AVX-512, and ASIMD

Robert Clausecker, Daniel Lemire, Florian Schintke

HN submission. Found in a submission link or body. Submitters do not count as commenters in the main ranking; a submission is not an endorsement.

Abstract

The positional population count operation pospopcnt() counts for an array of w-bit words how often each of the w bits was set. Various applications in bioinformatics, database engineering, and digital processing exist. Building on earlier work by Klarqvist et al., we show how positional population counts can be rapidly computed using SIMD techniques with good performance from the first byte, approaching memory-bound speeds for input arrays of as little as 4 KiB. Improvements include an improved algorithm structure, better handling of unaligned and very short arrays, as well as faster bit-parallel accumulation of intermediate results. We provide a generic algorithm description as well as implementations for various SIMD instruction set extensions, including Intel AVX2, AVX-512, and ARM ASIMD, and discuss the adaption of our algorithm to other platforms.

arXiv comments
23 pages, 11 figures. Associated source code can be found on line at https://github.com/clausecker/pospop and https://github.com/lemire/pospopcnt_avx512
Journal reference
Concurrency and Computation: Practice and Experience 37, no. 27-28 (2025)
DOI
doi:0.1002/cpe.70435
Subjects
cs.DSData Structures and Algorithms

On Hacker News

No comments linking this paper were found in the collected sources. Found in 2 HN submissions from Dec 2024 to Jan 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments0 threads

No comments linking this paper were found in the collected sources. Open submission discussions.

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.