|
@@ -2483,9 +2483,20 @@ function fpc_PopCnt_dword(AValue : DWord): DWord;[Public,Alias:'FPC_POPCNT_DWORD
|
|
|
|
|
|
|
|
|
{$ifndef FPC_SYSTEM_HAS_POPCNT_QWORD}
|
|
|
-function fpc_PopCnt_qword(Const AValue : QWord): QWord;[Public,Alias:'FPC_POPCNT_QWORD'];compilerproc;
|
|
|
+function fpc_PopCnt_qword(AValue : QWord): QWord;[Public,Alias:'FPC_POPCNT_QWORD'];compilerproc;
|
|
|
+ var
|
|
|
+ i : SizeInt;
|
|
|
begin
|
|
|
+{$ifdef VER2_6}
|
|
|
+ Result:=0;
|
|
|
+ for i:=0 to 15 do
|
|
|
+ begin
|
|
|
+ inc(Result,PopCntData[AValue and $f]);
|
|
|
+ AValue:=AValue shr 4;
|
|
|
+ end;
|
|
|
+{$else VER2_6}
|
|
|
Result:=PopCnt(lo(AValue))+PopCnt(hi(AValue))
|
|
|
+{$endif VER2_6}
|
|
|
end;
|
|
|
{$endif}
|
|
|
|