Explorar o código

m68k: replaced fpc_longword_to_double function with a working and branchless version. fixes tcnvint4 test among others with FPU enabled.

git-svn-id: trunk@36503 -
Károly Balogh %!s(int64=8) %!d(string=hai) anos
pai
achega
a635f435b9
Modificáronse 1 ficheiros con 2 adicións e 14 borrados
  1. 2 14
      rtl/m68k/math.inc

+ 2 - 14
rtl/m68k/math.inc

@@ -14,20 +14,8 @@
 
 {$ifdef FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
 function fpc_longword_to_double(i: longword): double; compilerproc;
-var
-  l : longint;
 begin
-{$ifopt R+}
-{$define HAS_OPTR}
-{$endif}
-{$r-}
-  l:=longint(i);
-{$ifdef HAS_OPTR}
-{$r+}
-{$endif}
-  if l>=0 then
-    fpc_longword_to_double:=double(l)
-  else
-    fpc_longword_to_double:=-double(abs(l));
+  qword(result):=(qword(1075) shl 52) + i;
+  result:=result - (qword(1) shl 52);
 end;
 {$endif FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}