From 02d177c885ca6de3b0c2f0b7e16ba80b77a6f197 Mon Sep 17 00:00:00 2001 From: ivost Date: Mon, 15 Jun 2009 21:35:52 +0000 Subject: [PATCH] * added FillQWord, IndexQWord, but CompareQWord is still missing git-svn-id: trunk@13282 - --- rtl/inc/generic.inc | 64 +++++++++++++++++++++++++++++++++++++++++++-- rtl/inc/systemh.inc | 2 ++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index 233e97b940..621e364801 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -124,8 +124,9 @@ begin begin v:=(value shl 8) or value; v:=(v shl 16) or v; - if sizeof(ptruint)=8 then - v:=(v shl 32) or v; +{$ifdef CPU64} + v:=(v shl 32) or v; +{$endif CPU64} { Align on native pointer size } pend:=pbyte(align(pdest,sizeof(PtrUInt))); dec(count,pend-pdest); @@ -241,6 +242,24 @@ end; {$endif FPC_SYSTEM_HAS_FILLDWORD} +{$ifndef FPC_SYSTEM_HAS_FILLQWORD} +procedure fillqword(var x;count : SizeInt;value : qword); +var + pdest,pend : pqword; +begin + if count <= 0 then + exit; + pdest:=@x; + pend:=pdest+count; + while pdest high(PtrInt) div 4) or + (psrc+len < psrc) then + pend:=pqword(high(PtrUInt)-sizeof(qword)) + else + pend:=psrc+len; +{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} + if (ptruint(psrc) mod 8)<>0 then + while psrc