瀏覽代碼

* fix bootstrapping with 2.6.0

git-svn-id: trunk@22293 -
florian 13 年之前
父節點
當前提交
2db4606eb0
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 1 1
      rtl/inc/compproc.inc
  2. 12 1
      rtl/inc/generic.inc

+ 1 - 1
rtl/inc/compproc.inc

@@ -506,7 +506,7 @@ function fpc_shr_int64(value,shift : int64) : int64; compilerproc;
 function fpc_popcnt_byte(AValue : Byte): Byte;compilerproc;
 function fpc_popcnt_word(AValue : Word): Word;compilerproc;
 function fpc_popcnt_dword(AValue : DWord): DWord;compilerproc;
-function fpc_popcnt_qword(Const AValue : QWord): QWord;compilerproc;
+function fpc_popcnt_qword(AValue : QWord): QWord;compilerproc;
 
 
 {$ifndef FPUNONE}

+ 12 - 1
rtl/inc/generic.inc

@@ -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}