Skip to content

Commit

Permalink
WIP++
Browse files Browse the repository at this point in the history
  • Loading branch information
darkk committed Sep 26, 2024
1 parent 8638606 commit 325c829
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions Hashes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,13 +1278,17 @@ void crc32c_pclmul_test(const void *key, int len, uint32_t seed, void *out)
#endif

#include "hash-garage/nmhash.h"

#define NMHASH32_DESC_STR "NMHASH_LITTLE_ENDIAN:" MACRO_ITOA(NMHASH_LITTLE_ENDIAN) ", " \
"NMH_VECTOR:" MACRO_ITOA(NMH_VECTOR) ", " \
"NMH_ACC_ALIGN:" MACRO_ITOA(NMH_ACC_ALIGN) ", " \
"NMH_RESTRICT:" MACRO_ITOA(NMH_RESTRICT)

const char * const nmhash32_ver("nmhash32, " NMHASH32_DESC_STR);
const char * const nmhash32x_ver("nmhash32x, " NMHASH32_DESC_STR);
const char * const nmhash32_desc(nmhash32_broken()
? "nmhash32 (broken), " NMHASH32_DESC_STR
: "nmhash32, " NMHASH32_DESC_STR);
const char * const nmhash32x_desc(nmhash32_broken()
? "nmhash32x (broken), " NMHASH32_DESC_STR
: "nmhash32x, " NMHASH32_DESC_STR);

bool nmhash32_broken( void ) {
static bool done = false, result;
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,8 @@ HashInfo g_hashes[] =
{ rapidhash_test, 64, 0xAF404C4B, "rapidhash", "rapidhash v1", GOOD, {}},
{ rapidhash_unrolled_test, 64, 0xAF404C4B, "rapidhash_unrolled", "rapidhash v1 - unrolled", GOOD, {}},
#endif
{ nmhash32_test, 32, nmhash32_broken() ? 0U : 0x12A30553, "nmhash32", nmhash32_ver, GOOD, {}},
{ nmhash32x_test, 32, nmhash32_broken() ? 0U : 0xA8580227, "nmhash32x", nmhash32x_ver, GOOD, {}},
{ nmhash32_test, 32, nmhash32_broken() ? 0U : 0x12A30553, "nmhash32", nmhash32_desc, GOOD, {}},
{ nmhash32x_test, 32, nmhash32_broken() ? 0U : 0xA8580227, "nmhash32x", nmhash32x_desc, GOOD, {}},
#ifdef HAVE_KHASHV
// There are certain GCC versions producing 0x9A8F7952 and 0X90A2A4F9 as verification values
// for k-hashv32 and k-hashv64. That deserves further investigation.
Expand Down

0 comments on commit 325c829

Please sign in to comment.