primesieve-8.0
This is a new major release, the API of libprimesieve is backwards compatible, but the ABI (Application Binary Interface) of libprimesieve is not backwards compatible. This means that if your program uses the C/C++ libprimesieve you can simply recompile your program against the latest libprimesieve without any modifications of your code needed. If on the other hand you have e.g. written libprimesieve bindings for another programming language you will have to migrate your code to the new libprimesieve ABI.
Highlights of primesieve-8.0
- libprimesieve now has multiarch support for x64 CPUs. At runtime libprimesieve now dispatches to the latest supported CPU instruction set like
POPCNT
,BMI2
,AVX512
#116. - libprimesieve now generates an array (or vector) of primes up to 20% faster #123.
ChangeLog
primesieve::iterator
's ABI has been modified in both the C & C++ API.
primesieve::iterator
's API remains backwards compatible.CPP_API.md
: Renameddoc/CPP_Examples.md
todoc/CPP_API.md
.C_API.md
: Renameddoc/C_Examples.md
todoc/C_API.md
.- Fix undefined behavior (g++-12 issue) caused by
resizeUninitialized.hpp
, use newpod_vector<uint64_t>
frompod_vector.hpp
instead. iterator.cpp
: Enable pre-sieving forprimesieve::iterator.prev_prime()
.iterator-c.cpp
: Enable pre-sieving forprimesieve::iterator.prev_prime()
.PreSieve.cpp
: Detect if the user sieves many consective intervals.PrimeGenerator.cpp
: ImproveAVX512
offillNextPrimes()
.PrimeGenerator.cpp
: Reduce memory usage for tiny stop numbers.PrimeGenerator.hpp
: Add GCC/Clang's function multiversioning forAVX512
.Erat.cpp
: Dynamically grow the sieve size: use a small sieve size for small stop numbers and a large sieve size for large stop numbers.Erat.cpp
: Reduce memory usage, allocate the minimum required memory to store all sieving primes.CpuInfo.cpp
: DetectAVX512
using CPUID.pmath.hpp
: Use compiler instrinsics forilog2()
&floorPow2()
.StorePrimes.hpp
: Usevector::insert()
instead ofvector::push_back()
, see: #123.CMakeLists.txt
: Automatically enable expensive debug assertions in debug mode (if CMAKE_BUILD_TYPE=Debug
).