mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 20:09:19 +02:00
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 -
This commit is contained in:
parent
d4d7778e86
commit
a635f435b9
@ -14,20 +14,8 @@
|
|||||||
|
|
||||||
{$ifdef FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
|
{$ifdef FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
|
||||||
function fpc_longword_to_double(i: longword): double; compilerproc;
|
function fpc_longword_to_double(i: longword): double; compilerproc;
|
||||||
var
|
|
||||||
l : longint;
|
|
||||||
begin
|
begin
|
||||||
{$ifopt R+}
|
qword(result):=(qword(1075) shl 52) + i;
|
||||||
{$define HAS_OPTR}
|
result:=result - (qword(1) shl 52);
|
||||||
{$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));
|
|
||||||
end;
|
end;
|
||||||
{$endif FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
|
{$endif FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
|
||||||
|
Loading…
Reference in New Issue
Block a user