From 84de7970360c8a4edff6389f6f8e84e0df7b6aa1 Mon Sep 17 00:00:00 2001 From: Kim Walisch Date: Tue, 30 Jul 2024 08:30:17 +0200 Subject: [PATCH] Update to latest libprimesieve --- lib/primesieve/cmake/multiarch_avx512_vbmi2.cmake | 6 +++--- lib/primesieve/include/primesieve/PrimeGenerator.hpp | 6 +++--- lib/primesieve/src/PrimeGenerator.cpp | 2 +- lib/primesieve/src/x86/cpuid.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/primesieve/cmake/multiarch_avx512_vbmi2.cmake b/lib/primesieve/cmake/multiarch_avx512_vbmi2.cmake index c0b7c0e9..d0840753 100644 --- a/lib/primesieve/cmake/multiarch_avx512_vbmi2.cmake +++ b/lib/primesieve/cmake/multiarch_avx512_vbmi2.cmake @@ -27,12 +27,12 @@ check_cxx_source_compiles(" class PrimeGenerator { public: __attribute__ ((target (\"avx512f,avx512vbmi,avx512vbmi2\"))) - void fillNextPrimes_avx512_vbmi2(uint64_t* primes64); + void fillNextPrimes_avx512(uint64_t* primes64); void fillNextPrimes_default(uint64_t* primes64); void fillNextPrimes(uint64_t* primes64) { if (primesieve::has_cpuid_avx512_vbmi2()) - fillNextPrimes_avx512_vbmi2(primes64); + fillNextPrimes_avx512(primes64); else fillNextPrimes_default(primes64); } @@ -44,7 +44,7 @@ check_cxx_source_compiles(" } __attribute__ ((target (\"avx512f,avx512vbmi,avx512vbmi2\"))) - void PrimeGenerator::fillNextPrimes_avx512_vbmi2(uint64_t* primes64) + void PrimeGenerator::fillNextPrimes_avx512(uint64_t* primes64) { __m512i bytes_0_to_7 = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); __m512i base = _mm512_set1_epi64(123); diff --git a/lib/primesieve/include/primesieve/PrimeGenerator.hpp b/lib/primesieve/include/primesieve/PrimeGenerator.hpp index aa0cecdc..7401d22e 100644 --- a/lib/primesieve/include/primesieve/PrimeGenerator.hpp +++ b/lib/primesieve/include/primesieve/PrimeGenerator.hpp @@ -51,10 +51,10 @@ class PrimeGenerator : public Erat ALWAYS_INLINE void fillNextPrimes(Vector& primes, std::size_t* size) { #if defined(ENABLE_AVX512_VBMI2) - fillNextPrimes_avx512_vbmi2(primes, size); + fillNextPrimes_avx512(primes, size); #elif defined(ENABLE_MULTIARCH_AVX512_VBMI2) if (cpu_supports_avx512_vbmi2) - fillNextPrimes_avx512_vbmi2(primes, size); + fillNextPrimes_avx512(primes, size); else fillNextPrimes_default(primes, size); #else @@ -74,7 +74,7 @@ class PrimeGenerator : public Erat #if defined(ENABLE_MULTIARCH_AVX512_VBMI2) __attribute__ ((target ("avx512f,avx512vbmi,avx512vbmi2"))) #endif - void fillNextPrimes_avx512_vbmi2(Vector& primes, std::size_t* size); + void fillNextPrimes_avx512(Vector& primes, std::size_t* size); #endif diff --git a/lib/primesieve/src/PrimeGenerator.cpp b/lib/primesieve/src/PrimeGenerator.cpp index 5406b298..6fc6b1fd 100644 --- a/lib/primesieve/src/PrimeGenerator.cpp +++ b/lib/primesieve/src/PrimeGenerator.cpp @@ -477,7 +477,7 @@ void PrimeGenerator::fillNextPrimes_default(Vector& primes, std::size_ #if defined(ENABLE_MULTIARCH_AVX512_VBMI2) __attribute__ ((target ("avx512f,avx512vbmi,avx512vbmi2"))) #endif -void PrimeGenerator::fillNextPrimes_avx512_vbmi2(Vector& primes, std::size_t* size) +void PrimeGenerator::fillNextPrimes_avx512(Vector& primes, std::size_t* size) { *size = 0; diff --git a/lib/primesieve/src/x86/cpuid.cpp b/lib/primesieve/src/x86/cpuid.cpp index babfde5b..d51e7908 100644 --- a/lib/primesieve/src/x86/cpuid.cpp +++ b/lib/primesieve/src/x86/cpuid.cpp @@ -117,7 +117,7 @@ bool has_cpuid_avx512_vbmi2() run_cpuid(7, 0, abcd); - // PrimeGenerator::fillNextPrimes() requires AVX512F, AVX512VBMI & AVX512VBMI2 + // PrimeGenerator::fillNextPrimes_avx512() requires AVX512F, AVX512VBMI & AVX512VBMI2 return ((abcd[1] & bit_AVX512F) == bit_AVX512F && (abcd[2] & (bit_AVX512VBMI | bit_AVX512VBMI2)) == (bit_AVX512VBMI | bit_AVX512VBMI2)); }