File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 33** 1 billion row Challenge entry**
44
55## Version
6- Version 1.50
6+ Version 1.51
77
88## How to compile
99The program was developed with FPC 3.2.2 and Lazarus 2.2.4
@@ -36,3 +36,4 @@ To speed things up:
3636
3737- Version 1.00: initial version
3838- Version 1.50: hash-list optimized, small improvements in parsing the file
39+ - Version 1.51: small improvements in asm function
Original file line number Diff line number Diff line change 2020 sysutils, strutils, math;
2121
2222const
23- M_version = ' 1.50 ' ; { version number}
23+ M_version = ' 1.51 ' ; { version number}
2424
2525{ ------------------------------ Common routines: ------------------------------}
2626
@@ -106,23 +106,20 @@ procedure error_halt(s: ansistring);
106106{ $ASMMODE INTEL}
107107
108108function FPHashX_ASM (var buf; len: dword): dword; assembler; nostackframe;
109- { returns a hash code similar to function FPHash() from FPC-Unit 'Contnrs',
110- but with the difference, that all hash codes for all cities here are UNIQUE.
111- I: len: MUST BE > 0!}
112- // var buf = RDI
113- // var len = ESI
109+ { returns a hash code similar to function FPHash() from FPC-Unit 'Contnrs',
110+ but with the difference, that all hash codes for all cities here are UNIQUE.
111+ I: len: MUST BE > 0!}
114112asm
115- MOV ECX,len
116113 MOV EAX,dword(-1 )
117114
118115 @LOOP:
119116 MOV EDX,EAX // save Result
120117 SHL EAX,5 // eax := Result shl 5
121118 SUB EAX,EDX // eax := Result shl 5 - Result
122119
123- XOR AL, [RDI ]
124- INC RDI
125- DEC ECX
120+ XOR AL, [buf ]
121+ INC buf
122+ DEC len
126123 JNZ @LOOP
127124end ; { FPHashX_ASM}
128125
You can’t perform that action at this time.
0 commit comments