This release introduces a new sieving algorithm for small sieving primes which increases Instruction-level parallelism (ILP) on today's wide out-of-order CPUs. The new method speeds up the D part of Gourdon’s prime counting algorithm by up to 45% on Apple Silicon CPUs and by up to 10% on AMD Zen5 CPUs.
ChangeLog
Sieve.cpp: New sieving algorithm for small primes #122.count_simd.hpp: Prevent loop unrolling to reduce branch mispredictions.Sieve_count_simd.hpp: Fix undefined behavior.Sieve.hpp: UseVector<uint64_t>sieve to fix undefined behavior.Sieve.cpp: Changes due to new sieve vector type.Sieve_pre_sieve.hpp: Changes due to new sieve vector type.Sieve_arrays.hpp: Changes due to new sieve vector type.- Move the sieve source files into the new
src/sievedirectory. - Fix LLVM/Clang
-Wunused-templatewarning. - Simplify ARM SVE runtime dispatching.