-
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 functions MultiplyRotateLR, MultiplyShiftL, MultiplySh…
…iftLR.
- Loading branch information
Showing
14 changed files
with
589 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/CompiledPerfectHashTableChm01IndexMultiplyRotateLRAnd.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 = _rotl(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; | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
src/CompiledPerfectHashTable/CompiledPerfectHashTableChm01IndexMultiplyShiftLRAnd.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 = Vertex1 << SEED3_BYTE1; | ||
|
||
Vertex2 = DownsizedKey * SEED2; | ||
Vertex2 = 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; | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
src/CompiledPerfectHashTable/CompiledPerfectHashTableChm01IndexMultiplyShiftRAnd.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 = Vertex1 >> SEED3_BYTE1; | ||
|
||
Vertex2 = DownsizedKey * SEED2; | ||
Vertex2 = 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/CompiledPerfectHashTableChm01IndexMultiplyRotateLRAnd_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 CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyRotateLRAnd.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 = _rotl(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 CompiledPerfectHashTableChm01IndexMultiplyRotateLRAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyRotateLRAndCSourceRawCString) | ||
#endif |
59 changes: 59 additions & 0 deletions
59
src/PerfectHash/CompiledPerfectHashTableChm01IndexMultiplyShiftLRAnd_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 CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyShiftLRAnd.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 = Vertex1 << SEED3_BYTE1;\n" | ||
"\n" | ||
" Vertex2 = DownsizedKey * SEED2;\n" | ||
" Vertex2 = 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 CompiledPerfectHashTableChm01IndexMultiplyShiftLRAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyShiftLRAndCSourceRawCString) | ||
#endif |
59 changes: 59 additions & 0 deletions
59
src/PerfectHash/CompiledPerfectHashTableChm01IndexMultiplyShiftRAnd_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 CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCStr[] = | ||
"\n" | ||
"//\n" | ||
"// Begin CompiledPerfectHashTableChm01IndexMultiplyShiftRAnd.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 = Vertex1 >> SEED3_BYTE1;\n" | ||
"\n" | ||
" Vertex2 = DownsizedKey * SEED2;\n" | ||
" Vertex2 = 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 CompiledPerfectHashTableChm01IndexMultiplyShiftRAnd.c.\n" | ||
"//\n" | ||
"\n" | ||
; | ||
|
||
const STRING CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCString = { | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCStr) - sizeof(CHAR), | ||
sizeof(CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCStr), | ||
#ifdef _WIN64 | ||
0, | ||
#endif | ||
(PCHAR)&CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCStr, | ||
}; | ||
|
||
#ifndef RawCString | ||
#define RawCString (&CompiledPerfectHashTableChm01IndexMultiplyShiftRAndCSourceRawCString) | ||
#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.