Skip to content

Commit 2ed641f

Browse files
committed
additional LEMIRE hash function
1 parent abc6f04 commit 2ed641f

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

entries/ghatem-fpc/src/OneBRCproj.lpi

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<UseAppBundle Value="False"/>
1616
<ResourceType Value="res"/>
1717
</General>
18-
<BuildModes Count="5">
18+
<BuildModes Count="7">
1919
<Item1 Name="Default" Default="True"/>
2020
<Item2 Name="Debug">
2121
<CompilerOptions>
@@ -137,6 +137,64 @@
137137
</Other>
138138
</CompilerOptions>
139139
</Item5>
140+
<Item6 Name="HashMod">
141+
<CompilerOptions>
142+
<Version Value="11"/>
143+
<PathDelim Value="\"/>
144+
<Target>
145+
<Filename Value="..\..\..\bin\ghatem"/>
146+
</Target>
147+
<SearchPaths>
148+
<IncludeFiles Value="$(ProjOutDir)"/>
149+
<UnitOutputDirectory Value="..\..\..\bin\lib\$(TargetCPU)-$(TargetOS)"/>
150+
</SearchPaths>
151+
<CodeGeneration>
152+
<SmartLinkUnit Value="True"/>
153+
<Optimizations>
154+
<OptimizationLevel Value="3"/>
155+
</Optimizations>
156+
</CodeGeneration>
157+
<Linking>
158+
<Debugging>
159+
<GenerateDebugInfo Value="False"/>
160+
<RunWithoutDebug Value="True"/>
161+
</Debugging>
162+
<LinkSmart Value="True"/>
163+
</Linking>
164+
<Other>
165+
<CustomOptions Value="-dRELEASE -dHASHMOD"/>
166+
</Other>
167+
</CompilerOptions>
168+
</Item6>
169+
<Item7 Name="LEMIRE">
170+
<CompilerOptions>
171+
<Version Value="11"/>
172+
<PathDelim Value="\"/>
173+
<Target>
174+
<Filename Value="..\..\..\bin\ghatem"/>
175+
</Target>
176+
<SearchPaths>
177+
<IncludeFiles Value="$(ProjOutDir)"/>
178+
<UnitOutputDirectory Value="..\..\..\bin\lib\$(TargetCPU)-$(TargetOS)"/>
179+
</SearchPaths>
180+
<CodeGeneration>
181+
<SmartLinkUnit Value="True"/>
182+
<Optimizations>
183+
<OptimizationLevel Value="3"/>
184+
</Optimizations>
185+
</CodeGeneration>
186+
<Linking>
187+
<Debugging>
188+
<GenerateDebugInfo Value="False"/>
189+
<RunWithoutDebug Value="True"/>
190+
</Debugging>
191+
<LinkSmart Value="True"/>
192+
</Linking>
193+
<Other>
194+
<CustomOptions Value="-dRELEASE -dLEMIRE"/>
195+
</Other>
196+
</CompilerOptions>
197+
</Item7>
140198
</BuildModes>
141199
<PublishOptions>
142200
<Version Value="2"/>

entries/ghatem-fpc/src/onebrc.pas

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ procedure TMyDictionary.InternalFind(const aKey: Cardinal; out aFound: Boolean;
140140
vDbl := aKey * cHashConst;
141141
vDbl := vDbl - Trunc (vDbl);
142142
vIdx := Trunc (vDbl * cDictSize);
143-
{$ELSE}
143+
{$ENDIF}
144+
{$IFDEF LEMIRE}
145+
vIdx := aKey * cDictSize shr 32;
146+
{$ENDIF}
147+
{$IFDEF HASHMOD}
144148
vIdx := aKey mod cDictSize;
145149
{$ENDIF}
146150

0 commit comments

Comments
 (0)