Skip to content

Releases: kimwalisch/primecount

primecount-7.19

04 Jun 14:40
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primecount-7.*

This release adds a 128-bit nth prime function, a feature that has been requested several times in the recent past (see #87, #77). Part of the new 128-bit nth prime function is also a new multi-threaded prime sieve which finds the actual nth prime after having computed a close approximation of the nth prime using the inverse Riemann R function and the prime counting function. This new multi-threaded nth prime sieve also significantly speeds up primecount's 64-bit nth prime function since that part of the algorithm was previously single-threaded.

  • nth_prime.cpp: Add 128-bit nth_prime function.
  • nth_prime_sieve.hpp: New sieving algo for nth_prime(n).
  • primecount.h: Improved 128-bit C API using portable pc_int128_t struct.
  • primecount.hpp: Improved 128-bit C++ API using portable pc_int128_t struct.
  • libprimecount.md: Add new 128-bit C/C++ API functions.

primecount-7.18

17 May 17:39
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primecount-7.*

  • Add CMake find_package(primecount) support #85.
  • libprimecount.md: Add CMake find_package(primecount) section.
  • PhiTiny.cpp: Reduce code bloat #86.
  • Move private header files from /include to /src #82.
  • src/CMakeLists.txt: Update for private header files in /src.
  • test/CMakeLists.txt: Update for private header files in /src.
  • Vector.hpp: Get rid of std::is_trivial which is deprecated in C++26.
  • Update to latest primesieve-12.9 library.
  • Update to latest libdivide-5.2.0 library.

primecount-7.17

30 Apr 10:01
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primecount-7.*

  • Sieve_pre_sieve.hpp: Improved pre-sieving using primes ≀ 71. Speeds up the S2_hard and D algorithms by up to 5%.
  • README.md: Fix Markdown math formulas.
  • Hard-Special-Leaves.md: Fix Markdown math formulas.
  • Update to primesieve-12.8 library.

primecount-7.16

02 Apr 17:39
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primecount-7.*

The SIMD runtime dispatching has been improved. The CPUID runtime check has been moved outside of the hot loop. All SIMD code is now inlined into the main algorithm which avoids a function call overhead. When using the --status option of the primecount command-line program the name of the SIMD algorithm used (e.g. AVX512, ARM SVE, ...) is printed to the screen.

  • fast_div.hpp: Fix "Warning: mnemonic suffix used with `div'"
  • libdivide.h: Fix "Warning: mnemonic suffix used with `div'"
  • LoadBalancerS2.cpp: Tune load balancing.
  • LoadBalancerAC.cpp: Tune load balancing.
  • primecount-config.hpp: Update default CPU cache sizes.
  • Sieve.cpp: Improve count balancing.
  • Sieve.cpp: Add multiarch count methods.
  • Sieve.hpp: New multiarch count methods.
  • D.cpp: Runtime dispatching changes.
  • D_multiarch_avx512.cpp: New file.
  • D_multiarch_arm_sve.cpp: New file.
  • S2_hard.cpp: Runtime dispatching changes.
  • S2_hard_multiarch_avx512.cpp: New file.
  • S2_hard_multiarch_arm_sve.cpp: New file.
  • CMakeLists.txt: Add new multiarch cpp files.
  • CMakeLists.txt: Fix broken MSVC OpenMP detection.

primecount-7.15

03 Mar 18:50
Compare
Choose a tag to compare

This release adds ARM SVE runtime dispatching, it is enabled by default on Linux for ARM64 CPUs and it has also been implemented for Windows (but support in Microsoft's Windows.h is still missing). The C/C++ API and ABI of this release are fully backwards compatible with primecount-7.*

  • Sieve.hpp: Improve ARM SVE bit counting algorithm.
  • multiarch_arm_sve.cmake: Improve ARM SVE detection.
  • src/arch/arm/sve.cpp: Detect ARM SVE instruction set.
  • README.md: Add sponsors section.
  • Update to libprimesieve-12.7.

Thanks to @AndrewVSutherland and @AlgoWin for being sponsors in this release cycle!

primecount-7.14

02 Aug 11:54
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primecount-7.*

  • Fix libdivide.h issue with GCC 15 #76.
  • Move x86 cpuid code from cpuid.hpp to src/x86/cpuid.cpp.
  • Move generate.hpp code to src/generate_primes.cpp.
  • Move generate_phi.hpp code to src/phi_vector.cpp.
  • int128_t.hpp: Rename namespace port to pstd (portable std namespace).
  • Sieve.hpp: Tune AVX512 and ARM SVE simd code.
  • Sieve.hpp: Branchfree bitmask calculation.
  • cpu_supports_popcnt.hpp: Simplify, move preprocessor checks to new multiarch_x86_popcnt.cmake.
  • multiarch_avx512_vpopcnt.cmake: Tune AVX512 code.
  • multiarch_x86_popcnt.cmake: Detect x86 POPCNT.
  • CMakeLists.txt: Use CMake list for all compile time definitions.

primecount-7.13

18 Apr 17:57
Compare
Choose a tag to compare

This release adds runtime dispatching to AVX512 and ARM SVE for CPUs that support it. Runtime dispatching to AVX512 (x64 CPUs) is now enabled by default when compiling using GCC and Clang on all operating systems.

  • CMakeLists.txt: New WITH_MULTIARCH option (default ON).
  • Sieve.hpp: New AVX512 popcount algorithm for x86 CPUs.
  • Sieve.hpp: New ARM SVE popcount algorithm.
  • int128.cmake: Improve int128_t support for Windows.
  • OpenMP.cmake: Improve LLVM/Clang OpenMP detection.
  • Add preliminary MSVC 128-bit support.
  • Deleted ci-sage.yml, it has not been updated in 3 years.

primecount-7.12

02 Apr 19:31
Compare
Choose a tag to compare

This is a bug-fix release, the previous primecount-7.11 may cause an infinite loop when calculating the logarithmic integral on the i386 CPU architecture (x86 32-bit CPU using Linux and GNU glibc). The C/C++ API and ABI of this release are backwards compatible with the previous release.

  • LogarithmicIntegral.cpp: Fix infinite loop on Linux i386 #66.
  • RiemannR.cpp: Fix infinite loop on Linux i386 #66.
  • CMakeLists.txt: Remove WITH_POPCNT=OFF option used to build a portable primecount binary. primecount is now portable by default (on x86 CPUs primecount now checks using CPUID if the CPU supports the POPCNT instruction before using it).
  • popcnt.hpp: On x86 & x64 CPUs enable CPUID POPCNT runtime check by default (unless the user compiles with -mpopcnt).
  • LoadBalancerAC.cpp: New dynamic adaptive load balancing #67.
  • RiemannR.cpp: Faster and simpler RiemannR_inverse(x).
  • test/Li.cpp: Add more tests.
  • test/Riemann_R.cpp: Add more tests.
  • fast_div.hpp: Get rid of make_smaller<T>::type hack.

primecount-7.11

12 Mar 13:46
Compare
Choose a tag to compare

This is a new maintenance release, the C/C++ API and ABI are fully backwards compatible with the previous release.

  • CMakeLists.txt: Detect Apple Silicon CPUs at build time (on Apples OSes only) and disable libdivide since Apple Silicon CPUs have very fast integer division instructions that are usually faster than libdivide. This speeds up the computation of the easy special leaves algorithms (--S2-easy & --AC) by up to 10%.
  • Faster RiemannR(x) and RiemannR_inverse(x) implementations: kimwalisch/primesieve#144.
  • test/iroot.cpp: Fix musl libc issue: kimwalisch/primesieve#147.
  • test/Li.cpp: Speed up test.
  • CmdOptions.cpp: Detect incompatible options.
  • PiTable.cpp: Increase cache size to 2 KiB.
  • Renamed command-line option --Ri to -R or --RiemannR.
  • Renamed command-line option --Ri-inverse to --RiemannR-inverse.
  • Improve status output on Windows.
  • Update to latest primesieve-12.1 library.

primecount-7.10

10 Jan 21:13
Compare
Choose a tag to compare

This is a new maintenance release, it is fully backwards compatible with the previous release. This release contains a CMake bug fix, tests have been ported to GitHub Actions and the nth prime code has been cleaned up.

  • cmake/OpenMP.cmake: Improve libatomic detection: kimwalisch/primesieve#141
  • .github/workflows/ci.yml: Port AppVeyor CI tests to GitHub Actions.
  • RiemannR.cpp: Fix potential integer overflows in Li_inverse(x) & Ri_inverse(x).
  • nth_prime.cpp: Use new nth_prime_approx(n).
  • Vector.hpp: Rename pod_vector to Vector and pod_array to Array.
  • README.md: Add C & C++ API badges.
  • Update to latest primesieve-11.2 library.

Thanks to @sethtroisi and Sven S. for being sponsors in this release cycle!