Răsfoiți Sursa

* simplified fpc_mul_qword so it compiles again on avr, fixes #36236 but does not solve the root of the problem

git-svn-id: trunk@43342 -
florian 5 ani în urmă
părinte
comite
3b1903b430
1 a modificat fișierele cu 6 adăugiri și 8 ștergeri
  1. 6 8
      rtl/inc/int64.inc

+ 6 - 8
rtl/inc/int64.inc

@@ -395,18 +395,16 @@
 {$ifndef FPC_SYSTEM_HAS_MUL_QWORD}
     function fpc_mul_qword(f1,f2 : qword) : qword;[public,alias: 'FPC_MUL_QWORD']; compilerproc;
       var
-         bitpos : qword;
-         l : longint;
+        b : byte;
       begin
         result:=0;
-        bitpos:=1;
 
-        for l:=0 to 63 do
+        for b:=0 to 63 do
           begin
-            if (f2 and bitpos)<>0 then
+            if odd(f2) then
               result:=result+f1;
             f1:=f1 shl 1;
-            bitpos:=bitpos shl 1;
+            f2:=f2 shr 1;
           end;
       end;
 
@@ -414,14 +412,14 @@
     function fpc_mul_qword_checkoverflow(f1,f2 : qword) : qword;[public,alias: 'FPC_MUL_QWORD_CHECKOVERFLOW']; compilerproc;
       var
          _f1,bitpos : qword;
-         l : longint;
+         b : byte;
          f1overflowed : boolean;
       begin
         result:=0;
         bitpos:=1;
         f1overflowed:=false;
 
-        for l:=0 to 63 do
+        for b:=0 to 63 do
           begin
             if (f2 and bitpos)<>0 then
               begin