Skip to content

primesieve-8.0

Compare
Choose a tag to compare
@kimwalisch kimwalisch released this 05 Jul 13:46
· 325 commits to master since this release

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: Renamed doc/CPP_Examples.md to doc/CPP_API.md.
  • C_API.md: Renamed doc/C_Examples.md to doc/C_API.md.
  • Fix undefined behavior (g++-12 issue) caused by resizeUninitialized.hpp, use new pod_vector<uint64_t> from pod_vector.hpp instead.
  • iterator.cpp: Enable pre-sieving for primesieve::iterator.prev_prime().
  • iterator-c.cpp: Enable pre-sieving for primesieve::iterator.prev_prime().
  • PreSieve.cpp: Detect if the user sieves many consective intervals.
  • PrimeGenerator.cpp: Improve AVX512 of fillNextPrimes().
  • PrimeGenerator.cpp: Reduce memory usage for tiny stop numbers.
  • PrimeGenerator.hpp: Add GCC/Clang's function multiversioning for AVX512.
  • 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: Detect AVX512 using CPUID.
  • pmath.hpp: Use compiler instrinsics for ilog2() & floorPow2().
  • StorePrimes.hpp: Use vector::insert() instead of vector::push_back(), see: #123.
  • CMakeLists.txt: Automatically enable expensive debug assertions in debug mode (if CMAKE_BUILD_TYPE=Debug).