Engineer details CPU tricks to speed up Boolean prefix-xor scans
A technical write-up describes methods for computing an xor-scan (a form of prefix computation) over bit arrays using carry-less multiplication instructions and a prefix-doubling technique. The approach restructures the carry-dependency chain so operations can run with greater instruction-level parallelism, reportedly reaching tens of bits processed per CPU cycle on cached memory, and extends the single-word technique to full arrays by exploiting runs of identical bits.
GoKawiil's interpretation of the reporting above, not reported fact.
The post illustrates how low-level algorithmic restructuring, rather than new hardware, can unlock significant throughput gains on existing CPUs by better exploiting super-scalar execution and specialized instructions like carry-less multiply. Such bit-manipulation techniques could be relevant to developers building high-performance libraries for compression, cryptography, or data processing where Boolean scans are a bottleneck. Because this is a technical deep dive rather than a product announcement, its practical impact depends on adoption by library or compiler developers.
- Carry-less multiplication with an all-ones word can implement xorscan on supporting CPUs.
- Reordering carry propagation to the end of each iteration breaks long dependency chains, enabling parallel execution.
- Prefix-doubling and run-detection techniques extend single-word scans efficiently across entire bit arrays.
Source: ap29600.github.io — Andrea Piseri, 2026-10-15
Published there as: “Symmetries in Boolean Scan”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.