Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PLATFORM_PATH := /usr/local
# First, find what the Lua executable is called
# - when a new Lua is released, then add it before 5.4 here
LUA_CMD := $(shell luajit -e 'print("luajit")' 2> /dev/null || lua -e 'print("lua")' 2> /dev/null || lua5.4 -e 'print("lua5.4")' 2> /dev/null || lua5.3 -e 'print("lua5.3")' 2> /dev/null || lua5.2 -e 'print("lua5.2")' 2> /dev/null || lua5.1 -e 'print("lua5.1")' 2> /dev/null)
ifeq ($(LUA_CMD),"")
ifeq ($(LUA_CMD),)
$(error Couldn't find Lua interpreter)
endif
$(info Using ${LUA_CMD})
Expand Down
10 changes: 5 additions & 5 deletions include/external/libpopcnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ extern "C" {
* It uses 12 arithmetic operations, one of which is a multiply.
* http://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation
*/
static inline uint64_t popcount64(uint64_t x)
static inline uint64_t popcnt64_bitwise(uint64_t x)
{
uint64_t m1 = 0x5555555555555555ll;
uint64_t m2 = 0x3333333333333333ll;
Expand Down Expand Up @@ -222,7 +222,7 @@ static inline uint64_t popcnt64(uint64_t x)

static inline uint64_t popcnt64(uint64_t x)
{
return popcount64(x);
return popcnt64_bitwise(x);
}

#endif
Expand Down Expand Up @@ -645,14 +645,14 @@ static inline uint64_t popcnt(const void* data, uint64_t size)
* We use unaligned memory accesses here to improve performance.
*/
for (; i < size - size % 8; i += 8)
cnt += popcount64(*(const uint64_t*)(ptr + i));
cnt += popcnt64_bitwise(*(const uint64_t*)(ptr + i));

if (i < size)
{
uint64_t val = 0;
size_t bytes = (size_t)(size - i);
memcpy(&val, &ptr[i], bytes);
cnt += popcount64(val);
cnt += popcnt64_bitwise(val);
}

return cnt;
Expand Down Expand Up @@ -750,7 +750,7 @@ static inline uint64_t popcnt(const void* data, uint64_t size)
uint64_t val = 0;
size_t bytes = (size_t)(size - i);
memcpy(&val, &ptr[i], bytes);
cnt += popcount64(val);
cnt += popcnt64_bitwise(val);
}

return cnt;
Expand Down
2 changes: 1 addition & 1 deletion src/sorted_node_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace SortedNodeStoreTypes {
#if defined(SORTED_NODE_STORE_RUNTIME_POPCNT)
if (cpuHasPopcnt)
return popcnt64(x);
return ::popcount64(x);
return ::popcnt64_bitwise(x);
#elif defined(__GNUC__) || defined(__clang__)
return __builtin_popcountll(x);
#elif defined(_MSC_VER) && defined(_M_X64)
Expand Down
Loading