Merged revisions 1373 via svnmerge from

svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/trunk

r1373 (florian)
* synched with i386

git-svn-id: branches/fixes_2_0@1435 -
This commit is contained in:
peter 2005-10-16 20:46:55 +00:00
parent 09028306e3
commit 04ca9513ac

View File

@ -168,7 +168,7 @@
fwait fwait
fldt d fldt d
frndint frndint
fnclex fwait
fldcw -4(%rbp) fldcw -4(%rbp)
end; end;
@ -181,39 +181,29 @@
newcw : word; newcw : word;
res : int64; res : int64;
asm asm
fnstcw oldcw fnstcw oldcw
fwait fwait
movw oldcw,%cx movw oldcw,%cx
orw $0x0c3f,%cx orw $0x0c3f,%cx
movw %cx,newcw movw %cx,newcw
fldcw newcw fldcw newcw
fwait fldt d
fldt d fistpq res
fistpq res fwait
movq res,%rax movq res,%rax
fnclex fldcw oldcw
fldcw oldcw
end; end;
{$define FPC_SYSTEM_HAS_ROUND} {$define FPC_SYSTEM_HAS_ROUND}
function fpc_round_real(d : ValReal) : int64;assembler;compilerproc; function fpc_round_real(d : ValReal) : int64;assembler;compilerproc;
var var
oldcw,
newcw : word;
res : int64; res : int64;
asm asm
fnstcw oldcw fldt d
fwait fistpq res
movw $0x1372,newcw fwait
fnclex movq res,%rax
fldcw newcw
fwait
fldt d
fistpq res
movq res,%rax
fnclex
fldcw oldcw
end; end;