-
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 hash function MultiplyRotateR.
- Loading branch information
Showing
10 changed files
with
196 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
src/CompiledPerfectHashTable/CompiledPerfectHashTableChm01IndexMultiplyRotateRAnd.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 = _rotr(Vertex1, SEED3_BYTE1); | ||
|
||
Vertex2 = DownsizedKey * SEED2; | ||
Vertex2 = _rotr(Vertex2, SEED3_BYTE2); | ||
|
||
MaskedLow = Vertex1 & HASH_MASK; | ||
MaskedHigh = Vertex2 & HASH_MASK; | ||
|
||
Vertex1 = TABLE_DATA[MaskedLow]; | ||
Vertex2 = TABLE_DATA[MaskedHigh]; | ||
|
||
Index = (CPHINDEX)((Vertex1 + Vertex2) & INDEX_MASK); | ||
|
||
return Index; | ||
} | ||
|
59 changes: 59 additions & 0 deletions
59
src/PerfectHash/CompiledPerfectHashTableChm01IndexMultiplyRotateRAnd_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 CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyRotateRAnd.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 = _rotr(Vertex1, SEED3_BYTE1);\n" | ||
"\n" | ||
" Vertex2 = DownsizedKey * SEED2;\n" | ||
" Vertex2 = _rotr(Vertex2, SEED3_BYTE2);\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 CompiledPerfectHashTableChm01IndexMultiplyRotateRAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyRotateRAndCSourceRawCString) | ||
#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.
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