1
- From 426384ce34cf410d892eeeeeb7f6046d52bff8e7 Mon Sep 17 00:00:00 2001
1
+ From 8d3446fbd6c73710ef2ea6bfe46fd3b7a1a787a7 Mon Sep 17 00:00:00 2001
2
2
From: Tom Kaitchuck <Tom.Kaitchuck@gmail.com>
3
- Date: Sat, 11 Jul 2020 17:15:56 -0700
4
- Subject: [PATCH] Add support for ahash
3
+ Date: Wed, 13 Jan 2021 21:56:02 -0800
4
+ Subject: [PATCH] Add support for aHash
5
5
6
6
---
7
7
CMakeLists.txt | 1 +
@@ -12,26 +12,32 @@ Subject: [PATCH] Add support for ahash
12
12
create mode 100644 ahash.h
13
13
14
14
diff --git a/CMakeLists.txt b/CMakeLists.txt
15
- index 6ebab1a..9d79e98 100644
15
+ index 3420a56..921d111 100644
16
16
--- a/CMakeLists.txt
17
17
+++ b/CMakeLists.txt
18
- @@ -470,10 +470,11 @@ add_executable(
19
- target_link_libraries(
20
- SMHasher
21
- SMHasherSupport
22
- ${HIGHWAY_LIB}
23
- ${BLAKE3_LIB}
24
- + libahash_c.a
25
- ${CMAKE_THREAD_LIBS_INIT}
26
- )
18
+ @@ -638,14 +638,15 @@ if(ipo_supported)
19
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLTO")
20
+ # set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "-DLTO")
21
+ else()
22
+ message(STATUS "IPO / LTO not supported: <${error}>")
23
+ endif()
27
24
28
- #add_executable(
29
- # bittest
25
+ target_link_libraries(SMHasher SMHasherSupport ${HIGHWAY_LIB} ${BLAKE3_LIB}
26
+ + libahash_c.a
27
+ ${CMAKE_THREAD_LIBS_INIT})
28
+
29
+ # add_executable( bittest bittest.cpp )
30
+ #
31
+ # target_link_libraries( bittest SMHasherSupport ${CMAKE_THREAD_LIBS_INIT} )
32
+
33
+ if(NOT (CMAKE_CROSSCOMPILING))
30
34
diff --git a/Hashes.h b/Hashes.h
31
- index 4e111c1..fcd3e38 100644
35
+ index 472f4e4..9fae4e9 100644
32
36
--- a/Hashes.h
33
37
+++ b/Hashes.h
34
- @@ -19,10 +19,11 @@
38
+ @@ -17,14 +17,15 @@
39
+ #include "opt_cmetrohash.h"
40
+
35
41
#if defined(__SSE4_2__) && defined(__x86_64__)
36
42
#include "metrohash/metrohash64crc.h"
37
43
#include "metrohash/metrohash128crc.h"
@@ -43,7 +49,11 @@ index 4e111c1..fcd3e38 100644
43
49
#include "jody_hash64.h"
44
50
45
51
// objsize: 0-0x113 = 276
46
- @@ -356,10 +357,14 @@ inline void fasthash32_test ( const void * key, int len, uint32_t seed, void * o
52
+ #include "tifuhash.h"
53
+ // objsize: 5f0-85f = 623
54
+ @@ -356,14 +357,18 @@ inline void cmetrohash64_2_test ( const void * key, int len, uint32_t seed, void
55
+ inline void fasthash32_test ( const void * key, int len, uint32_t seed, void * out ) {
56
+ *(uint32_t*)out = fasthash32(key, (size_t) len, seed);
47
57
}
48
58
#ifdef HAVE_INT64
49
59
inline void fasthash64_test ( const void * key, int len, uint32_t seed, void * out ) {
@@ -58,6 +68,8 @@ index 4e111c1..fcd3e38 100644
58
68
// objsize 0-778: 1912
59
69
void mum_hash_test(const void * key, int len, uint32_t seed, void * out);
60
70
71
+ inline void mum_low_test ( const void * key, int len, uint32_t seed, void * out ) {
72
+ uint64_t result;
61
73
diff --git a/ahash.h b/ahash.h
62
74
new file mode 100644
63
75
index 0000000..6c59caf
@@ -114,22 +126,26 @@ index 0000000..6c59caf
114
126
+ #endif
115
127
\ No newline at end of file
116
128
diff --git a/main.cpp b/main.cpp
117
- index 04060f2..7489aaf 100644
129
+ index e9cf20d..ae3d273 100644
118
130
--- a/main.cpp
119
131
+++ b/main.cpp
120
- @@ -263,11 +263,11 @@ HashInfo g_hashes[] =
121
-
122
- { xxh3_test, 64, 0x39CD9E4A, "xxh3", "xxHash v3, 64-bit", GOOD },
123
- { xxh3low_test, 32, 0xFAE8467B, "xxh3low", "xxHash v3, 64-bit, low 32-bits part", GOOD },
124
- { xxh128_test, 128, 0xEB61B3A0, "xxh128", "xxHash v3, 128-bit", GOOD },
125
- { xxh128low_test, 64, 0x54D1CC70, "xxh128low", "xxHash v3, 128-bit, low 64-bits part", GOOD },
132
+ @@ -302,15 +302,15 @@ HashInfo g_hashes[] =
133
+ { MeowHash64_test, 64, 0xB04AC842, "MeowHash64low","MeowHash (requires x64 AES-NI)", POOR },
134
+ { MeowHash128_test, 128, 0xA0D29861, "MeowHash", "MeowHash (requires x64 AES-NI)", POOR },
135
+ #endif
136
+ { t1ha1_64le_test, 64, 0xD6836381, "t1ha1_64le", "Fast Positive Hash (portable, aims 64-bit, little-endian)", POOR },
137
+ { t1ha1_64be_test, 64, 0x93F864DE, "t1ha1_64be", "Fast Positive Hash (portable, aims 64-bit, big-engian)", POOR },
138
+ { t1ha0_32le_test, 64, 0x7F7D7B29, "t1ha0_32le", "Fast Positive Hash (portable, aims 32-bit, little-endian)", POOR },
139
+ { t1ha0_32be_test, 64, 0xDA6A4061, "t1ha0_32be", "Fast Positive Hash (portable, aims 32-bit, big-endian)", POOR },
126
140
-
127
141
+ { ahash64_test, 64, 0x00000000, "ahash64", "ahash 64bit", GOOD }, //Expected value set to zero because aHash does not adhere to a fixed output.
128
142
#if __WORDSIZE >= 64
129
143
# define TIFU_VERIF 0x644236D4
130
144
#else
131
145
// broken on certain travis
132
146
# define TIFU_VERIF 0x0
147
+ #endif
148
+ // and now the quality hash funcs, slowest first
133
149
- -
134
150
2.25.1
135
151
0 commit comments