+ i8086 asm implementation of fpc_trunc_real, based on the i386 version. Fixes

i8086 compilation after r26122.

git-svn-id: trunk@26125 -
This commit is contained in:
nickysn 2013-11-24 02:00:57 +00:00
parent ba89914471
commit 6cd62437f9

View File

@ -134,3 +134,22 @@
fldcw [bp-2]
end;
{$define FPC_SYSTEM_HAS_TRUNC}
function fpc_trunc_real(d : ValReal) : int64;assembler;compilerproc;
asm
sub sp, 10
fld tbyte [d]
fnstcw [bp-10]
mov cx, [bp-10]
or word [bp-10], $0f00
fldcw [bp-10]
mov [bp-10], cx
fistp qword [bp-8]
fldcw [bp-10]
fwait
mov dx, [bp-8]
mov cx, [bp-6]
mov bx, [bp-4]
mov ax, [bp-2]
end;