Permalink
Browse files

small optimizations and fixes - no functional change

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Aug 7, 2018
1 parent 3aeec93 commit 815d52ac305b9e03e6ac1b6c901415b7db378cce
Showing with 29 additions and 13 deletions.
  1. +26 −10 SynCommons.pas
  2. +1 −1 SynEcc.pas
  3. +1 −1 SynLizard.pas
  4. +1 −1 SynopseCommit.inc
@@ -24549,7 +24549,7 @@ function IdemPCharAndGetNextLine(var source: PUTF8Char; searchUp: PAnsiChar): bo
end;
function fnv32(crc: cardinal; buf: PAnsiChar; len: cardinal): cardinal;
var i: integer;
var i: PtrInt;
begin
if buf<>nil then
for i := 0 to len-1 do
@@ -24558,7 +24558,7 @@ function fnv32(crc: cardinal; buf: PAnsiChar; len: cardinal): cardinal;
end;
function kr32(crc: cardinal; buf: PAnsiChar; len: cardinal): cardinal;
var i: integer;
var i: PtrInt;
begin
for i := 0 to len-1 do
crc := ord(buf[i])+crc*31;
@@ -25978,7 +25978,7 @@ function strcspnsse42(s,reject: pointer): integer;
{$endif}
movd eax, xmm0
jns @5
@2: cmp ax, -1
@2: cmp eax, 65535
jne @3
add rdi, 16 // first 16 chars matched, continue with next 16 chars
add rcx, 16
@@ -26002,7 +26002,11 @@ function strcspnsse42(s,reject: pointer): integer;
jns @4
mov rsi, r8 // restore set pointer
and eax, edx // accumulate matches
jmp @2
cmp eax, 65535
jne @3
add rdi, 16
add rcx, 16
jmp @1
end;
function strspnsse42(s,accept: pointer): integer;
{$ifdef FPC}nostackframe; assembler; asm {$else}
@@ -26025,7 +26029,7 @@ function strspnsse42(s,accept: pointer): integer;
{$endif}
movd eax, xmm0
jns @5
@2: cmp ax, -1
@2: cmp eax, 65535
jne @3
add rdi, 16 // first 16 chars matched, continue with next 16 chars
add rcx, 16
@@ -26049,7 +26053,11 @@ function strspnsse42(s,accept: pointer): integer;
jns @4
mov rsi, r8 // restore set pointer
and eax, edx // accumulate matches
jmp @2
cmp eax, 65535
jne @3
add rdi, 16 // first 16 chars matched, continue with next 16 chars
add rcx, 16
jmp @1
end;
{$endif CPUX64}
{$ifdef CPUX86}
@@ -26074,7 +26082,7 @@ function strcspnsse42(s,reject: pointer): integer;
db $66,$0F,$7E,$C0
{$endif}
jns @5
@2: cmp ax, -1
@2: cmp eax, 65535
jne @3
add edi, 16 // first 16 chars matched, continue with next 16 chars
add ecx, 16
@@ -26100,7 +26108,11 @@ function strcspnsse42(s,reject: pointer): integer;
jns @4
mov esi, ebx // restore set pointer
and eax, edx // accumulate matches
jmp @2
cmp eax, 65535
jne @3
add edi, 16 // first 16 chars matched, continue with next 16 chars
add ecx, 16
jmp @1
end;
function strspnsse42(s,accept: pointer): integer;
asm // eax=s, edx=accept
@@ -26123,7 +26135,7 @@ function strspnsse42(s,accept: pointer): integer;
db $66,$0F,$7E,$C0
{$endif}
jns @5
@2: cmp ax, -1
@2: cmp eax, 65535
jne @3
add edi, 16 // first 16 chars matched, continue with next 16 chars
add ecx, 16
@@ -26149,7 +26161,11 @@ function strspnsse42(s,accept: pointer): integer;
jns @4
mov esi, ebx // restore set pointer
and eax, edx // accumulate matches
jmp @2
cmp eax, 65535
jne @3
add edi, 16 // first 16 chars matched, continue with next 16 chars
add ecx, 16
jmp @1
end;
{$ifndef DELPHI5OROLDER}
function StrLenSSE2(S: pointer): PtrInt;
@@ -367,7 +367,7 @@ procedure ecc_uncompress_key_pas(const Compressed: TECCPublicKey;
Signature: TECCSignature;
/// FNV-1a checksum of all previous fields
// - we use fnv32 and not crc32c here to avoid colision with crc64c hashing
// - avoiding to compute slow ECDSA verification in case of corrumption,
// - avoiding to compute slow ECDSA verification in case of corruption,
// due e.g. to unexpected transmission/bug/fuzzing
// - should be the very last field in the record
CRC: cardinal;
@@ -580,7 +580,7 @@ constructor TSynLizardDynamic.Create(const aLibraryFile: TFileName;
else
raise Exception.CreateFmt('%s has unexpected versionNumber=%d',
[fLibraryName, versionNumber]);
inherited Create; // register AlgoLizard/AlgoLizardFast
inherited Create; // register AlgoLizard/AlgoLizardFast/AlgoLizardHuffman
fLoaded := true;
end;
@@ -1 +1 @@
'1.18.4716'
'1.18.4717'

0 comments on commit 815d52a

Please sign in to comment.