mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 13:59:29 +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}
|
||||
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}
|
||||
|
Loading…
Reference in New Issue
Block a user