mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 13:59:29 +02:00
+ 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:
parent
ba89914471
commit
6cd62437f9
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user