Skip to content

Commit

Permalink
Update to latest libprimesieve
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Jul 13, 2024
1 parent 48e2ec2 commit 0dc57fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/primesieve/include/primesieve/popcnt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ALWAYS_INLINE uint64_t popcnt64(uint64_t x)
{
// On my AMD EPYC 7642 CPU using GCC 12 this runtime
// check incurs an overall overhead of about 1%.
if (cpu_supports_popcnt)
if_likely(cpu_supports_popcnt)
{
__asm__("popcnt %1, %0" : "=r"(x) : "r"(x));
return x;
Expand Down Expand Up @@ -89,7 +89,7 @@ NOINLINE uint64_t popcnt64_bitwise_noinline(uint64_t x)

ALWAYS_INLINE uint64_t popcnt64(uint64_t x)
{
if (cpu_supports_popcnt)
if_likely(cpu_supports_popcnt)
{
uint32_t x0 = uint32_t(x);
uint32_t x1 = uint32_t(x >> 32);
Expand Down Expand Up @@ -166,7 +166,7 @@ NOINLINE uint64_t popcnt64_bitwise_noinline(uint64_t x)

ALWAYS_INLINE uint64_t popcnt64(uint64_t x)
{
if (cpu_supports_popcnt)
if_likely(cpu_supports_popcnt)
return __popcnt64(x);
else
return popcnt64_bitwise_noinline(x);
Expand Down Expand Up @@ -237,7 +237,7 @@ NOINLINE uint64_t popcnt64_bitwise_noinline(uint64_t x)

ALWAYS_INLINE uint64_t popcnt64(uint64_t x)
{
if (cpu_supports_popcnt)
if_likely(cpu_supports_popcnt)
return __popcnt(uint32_t(x)) +
__popcnt(uint32_t(x >> 32));
else
Expand Down

0 comments on commit 0dc57fc

Please sign in to comment.