Skip to content

Commit

Permalink
AVX512 VPOPCNT: use the compiler's intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMula committed Nov 22, 2017
1 parent a51250e commit 92979cb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ FLAGS_SSE=$(FLAGS_INTEL) -mssse3 -DHAVE_SSE_INSTRUCTIONS
FLAGS_AVX=$(FLAGS_INTEL) -mavx -DHAVE_AVX_INSTRUCTIONS
FLAGS_AVX2=$(FLAGS_INTEL) -mavx2 -DHAVE_AVX2_INSTRUCTIONS
FLAGS_AVX512BW=$(FLAGS_INTEL) -mavx512bw -DHAVE_AVX512BW_INSTRUCTIONS
# Use the flag -mavx512bw bacuse my current GCC installation doesn't support AVX512 VPOPCNT yet.
FLAGS_AVX512VPOPCNT=$(FLAGS_INTEL) -mavx512bw -DHAVE_AVX512VPOPCNT_INSTRUCTIONS
FLAGS_AVX512VPOPCNT=$(FLAGS_INTEL) -mavx512bw -mavx512vpopcntdq -DHAVE_AVX512VPOPCNT_INSTRUCTIONS

DEPS=popcnt-*.cpp function_registry.cpp sse_operators.cpp config.h
ALL=speed_$(COMPILER) verify_$(COMPILER)
Expand Down
1 change: 0 additions & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# if !defined(HAVE_AVX512BW_INSTRUCTIONS)
# define HAVE_AVX512BW_INSTRUCTIONS
# endif
# define AVX512POPCNT_SW_EMULATOR
#endif

#if defined(HAVE_AVX512BW_INSTRUCTIONS)
Expand Down
15 changes: 0 additions & 15 deletions popcnt-avx512-vpopcnt.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
#if defined(AVX512POPCNT_SW_EMULATOR) // waiting for SDE updates
__m512i _mm512_popcnt_epi64(const __m512i& val) {

uint64_t tmp[8] __attribute__((aligned(64)));

_mm512_store_si512((__m512i*)tmp, val);

for (int i=0; i < 8; i++) {
tmp[i] = _mm_popcnt_u64(tmp[i]);
}

return _mm512_load_si512((__m512i*)tmp);
}
#endif

uint64_t avx512_vpopcnt(const uint8_t* data, const size_t size) {

const size_t chunks = size / 64;
Expand Down

0 comments on commit 92979cb

Please sign in to comment.