-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Multiply and MultiplyXor hash functions.
- Loading branch information
Showing
12 changed files
with
380 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/CompiledPerfectHashTable/CompiledPerfectHashTableChm01IndexMultiplyAnd.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
DECLARE_INDEX_ROUTINE() | ||
{ | ||
CPHINDEX Index; | ||
CPHDKEY Vertex1; | ||
CPHDKEY Vertex2; | ||
CPHDKEY MaskedLow; | ||
CPHDKEY MaskedHigh; | ||
CPHDKEY DownsizedKey; | ||
|
||
DownsizedKey = DOWNSIZE_KEY(Key); | ||
|
||
Vertex1 = DownsizedKey * SEED1; | ||
|
||
Vertex2 = DownsizedKey * SEED2; | ||
|
||
MaskedLow = Vertex1 & HASH_MASK; | ||
MaskedHigh = Vertex2 & HASH_MASK; | ||
|
||
Vertex1 = TABLE_DATA[MaskedLow]; | ||
Vertex2 = TABLE_DATA[MaskedHigh]; | ||
|
||
Index = (CPHINDEX)((Vertex1 + Vertex2) & INDEX_MASK); | ||
|
||
return Index; | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
src/CompiledPerfectHashTable/CompiledPerfectHashTableChm01IndexMultiplyXorAnd.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
DECLARE_INDEX_ROUTINE() | ||
{ | ||
CPHINDEX Index; | ||
CPHDKEY Vertex1; | ||
CPHDKEY Vertex2; | ||
CPHDKEY MaskedLow; | ||
CPHDKEY MaskedHigh; | ||
CPHDKEY DownsizedKey; | ||
|
||
DownsizedKey = DOWNSIZE_KEY(Key); | ||
|
||
Vertex1 = DownsizedKey * SEED1; | ||
Vertex1 ^= SEED2; | ||
|
||
Vertex2 = DownsizedKey * SEED3; | ||
Vertex2 ^= SEED4; | ||
|
||
MaskedLow = Vertex1 & HASH_MASK; | ||
MaskedHigh = Vertex2 & HASH_MASK; | ||
|
||
Vertex1 = TABLE_DATA[MaskedLow]; | ||
Vertex2 = TABLE_DATA[MaskedHigh]; | ||
|
||
Index = (CPHINDEX)((Vertex1 + Vertex2) & INDEX_MASK); | ||
|
||
return Index; | ||
} | ||
|
57 changes: 57 additions & 0 deletions
57
src/PerfectHash/CompiledPerfectHashTableChm01IndexMultiplyAnd_CSource_RawCString.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// Auto-generated. | ||
// | ||
|
||
DECLSPEC_ALIGN(16) | ||
const CHAR CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
"\n" | ||
"DECLARE_INDEX_ROUTINE()\n" | ||
"{\n" | ||
" CPHINDEX Index;\n" | ||
" CPHDKEY Vertex1;\n" | ||
" CPHDKEY Vertex2;\n" | ||
" CPHDKEY MaskedLow;\n" | ||
" CPHDKEY MaskedHigh;\n" | ||
" CPHDKEY DownsizedKey;\n" | ||
"\n" | ||
" DownsizedKey = DOWNSIZE_KEY(Key);\n" | ||
"\n" | ||
" Vertex1 = DownsizedKey * SEED1;\n" | ||
"\n" | ||
" Vertex2 = DownsizedKey * SEED2;\n" | ||
"\n" | ||
" MaskedLow = Vertex1 & HASH_MASK;\n" | ||
" MaskedHigh = Vertex2 & HASH_MASK;\n" | ||
"\n" | ||
" Vertex1 = TABLE_DATA[MaskedLow];\n" | ||
" Vertex2 = TABLE_DATA[MaskedHigh];\n" | ||
"\n" | ||
" Index = (CPHINDEX)((Vertex1 + Vertex2) & INDEX_MASK);\n" | ||
"\n" | ||
" return Index;\n" | ||
"}\n" | ||
"\n" | ||
"\n" | ||
"//\n" | ||
"// End CompiledPerfectHashTableChm01IndexMultiplyAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyAndCSourceRawCString) | ||
#endif |
59 changes: 59 additions & 0 deletions
59
src/PerfectHash/CompiledPerfectHashTableChm01IndexMultiplyXorAnd_CSource_RawCString.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// Auto-generated. | ||
// | ||
|
||
DECLSPEC_ALIGN(16) | ||
const CHAR CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyXorAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
"\n" | ||
"DECLARE_INDEX_ROUTINE()\n" | ||
"{\n" | ||
" CPHINDEX Index;\n" | ||
" CPHDKEY Vertex1;\n" | ||
" CPHDKEY Vertex2;\n" | ||
" CPHDKEY MaskedLow;\n" | ||
" CPHDKEY MaskedHigh;\n" | ||
" CPHDKEY DownsizedKey;\n" | ||
"\n" | ||
" DownsizedKey = DOWNSIZE_KEY(Key);\n" | ||
"\n" | ||
" Vertex1 = DownsizedKey * SEED1;\n" | ||
" Vertex1 ^= SEED2;\n" | ||
"\n" | ||
" Vertex2 = DownsizedKey * SEED3;\n" | ||
" Vertex2 ^= SEED4;\n" | ||
"\n" | ||
" MaskedLow = Vertex1 & HASH_MASK;\n" | ||
" MaskedHigh = Vertex2 & HASH_MASK;\n" | ||
"\n" | ||
" Vertex1 = TABLE_DATA[MaskedLow];\n" | ||
" Vertex2 = TABLE_DATA[MaskedHigh];\n" | ||
"\n" | ||
" Index = (CPHINDEX)((Vertex1 + Vertex2) & INDEX_MASK);\n" | ||
"\n" | ||
" return Index;\n" | ||
"}\n" | ||
"\n" | ||
"\n" | ||
"//\n" | ||
"// End CompiledPerfectHashTableChm01IndexMultiplyXorAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyXorAndCSourceRawCString) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.