|
@@ -367,6 +367,41 @@ asm
|
|
|
@@Done:
|
|
|
end; {SmallBackwardMove}
|
|
|
|
|
|
+
|
|
|
+{ at least valgrind up to 3.3 has a bug which prevents the default code to
|
|
|
+ work so we use a rather simple implementation here
|
|
|
+}
|
|
|
+procedure Forwards_Valgrind;assembler;nostackframe;
|
|
|
+asm
|
|
|
+ push esi
|
|
|
+ push edi
|
|
|
+ mov esi,eax
|
|
|
+ mov edi,edx
|
|
|
+ rep movsb
|
|
|
+ pop edi
|
|
|
+ pop esi
|
|
|
+end;
|
|
|
+
|
|
|
+{ at least valgrind up to 3.3 has a bug which prevents the default code to
|
|
|
+ work so we use a rather simple implementation here
|
|
|
+}
|
|
|
+procedure Backwards_Valgrind;assembler;nostackframe;
|
|
|
+asm
|
|
|
+ push esi
|
|
|
+ push edi
|
|
|
+ lea esi,[eax+ecx-1]
|
|
|
+ lea edi,[edx+ecx-1]
|
|
|
+@@repeat:
|
|
|
+ mov al,[esi]
|
|
|
+ mov [edi],al
|
|
|
+ dec esi
|
|
|
+ dec edi
|
|
|
+ dec ecx
|
|
|
+ jnz @@repeat
|
|
|
+ pop edi
|
|
|
+ pop esi
|
|
|
+end;
|
|
|
+
|
|
|
{-------------------------------------------------------------------------}
|
|
|
{Move ECX Bytes from EAX to EDX, where EAX > EDX and ECX > 36 (SMALLMOVESIZE)}
|
|
|
procedure Forwards_IA32_3;assembler;nostackframe;
|
|
@@ -840,7 +875,11 @@ procedure setup_fastmove;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|
|
{$ifdef FPC_HAS_VALGRINDBOOL}
|
|
|
{ workaround valgrind bug }
|
|
|
if valgrind_used then
|
|
|
- exit;
|
|
|
+ begin
|
|
|
+ fastmoveproc_forward:=@Forwards_Valgrind;
|
|
|
+ fastmoveproc_backward:=@Backwards_Valgrind;
|
|
|
+ end
|
|
|
+ else
|
|
|
{$endif FPC_HAS_VALGRINDBOOL}
|
|
|
|
|
|
if has_sse_support then
|