Skip to content

Commit 8e32ef3

Browse files
committed
Reenable asm packarray for fpc > 3.1. Recent fpc now have the same behavior as delphi
1 parent b02a553 commit 8e32ef3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Source/VTConfig.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@
4545
{$define EnableThreadSupport}
4646
{$endif}
4747

48-
{$if (FPC_FULLVERSION >= 30100) or defined(CPU64) or defined(LCLCarbon)}
48+
{$if defined(CPU64) or defined(LCLCarbon)}
4949
{$define PACKARRAYPASCAL}
5050
{$endif}

Source/VirtualTrees.pas

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13224,8 +13224,12 @@ function TBaseVirtualTree.PackArray(TheArray: TNodeArray; Count: Integer): Integ
1322413224
PUSH EBX
1322513225
PUSH EDI
1322613226
PUSH ESI
13227-
MOV ECX, EDX //fpc: count is in EDX. Move to ECX
13228-
MOV ESI, [EBP+8] //fpc: TheArray is in EBP+8
13227+
{$if FPC_FULLVERSION >= 30100}
13228+
MOV ESI, EDX
13229+
{$else}
13230+
MOV ECX, EDX //fpc < 3.1: count is in EDX. Move to ECX
13231+
MOV ESI, [EBP+8] //fpc < 3.1: TheArray is in EBP+8
13232+
{$endif}
1322913233
MOV EDX, -1
1323013234
JCXZ @@Finish // Empty list?
1323113235
INC EDX // init remaining entries counter

0 commit comments

Comments
 (0)