mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 15:09:19 +02:00
* round returns int64
This commit is contained in:
parent
a1b570bc48
commit
ecc3b24fd4
@ -112,36 +112,43 @@
|
|||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_TRUNC}
|
{$define FPC_SYSTEM_HAS_TRUNC}
|
||||||
function trunc(d : extended) : int64;assembler;[internconst:in_const_trunc];
|
function trunc(d : extended) : int64;assembler;[internconst:in_const_trunc];
|
||||||
|
var
|
||||||
|
oldcw,
|
||||||
|
newcw : word;
|
||||||
|
res : int64;
|
||||||
asm
|
asm
|
||||||
subl $16,%esp
|
fnstcw oldcw
|
||||||
fnstcw -4(%ebp)
|
|
||||||
fwait
|
fwait
|
||||||
movw -4(%ebp),%cx
|
movw oldcw,%cx
|
||||||
orw $0x0c3f,%cx
|
orw $0x0c3f,%cx
|
||||||
movw %cx,-8(%ebp)
|
movw %cx,newcw
|
||||||
fldcw -8(%ebp)
|
fldcw newcw
|
||||||
fwait
|
fwait
|
||||||
fldt d
|
fldt d
|
||||||
fistpq -12(%ebp)
|
fistpq res
|
||||||
movl -12(%ebp),%eax
|
movl res,%eax
|
||||||
movl -8(%ebp),%edx
|
movl res+4,%edx
|
||||||
fldcw -4(%ebp)
|
fldcw oldcw
|
||||||
end ['EAX','ECX','EDX'];
|
end ['EAX','ECX','EDX'];
|
||||||
|
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_ROUND}
|
{$define FPC_SYSTEM_HAS_ROUND}
|
||||||
function round(d : extended) : longint;assembler;[internconst:in_const_round];
|
function round(d : extended) : int64;assembler;[internconst:in_const_round];
|
||||||
|
var
|
||||||
|
oldcw,
|
||||||
|
newcw : word;
|
||||||
|
res : int64;
|
||||||
asm
|
asm
|
||||||
subl $8,%esp
|
fnstcw oldcw
|
||||||
fnstcw -4(%ebp)
|
|
||||||
fwait
|
fwait
|
||||||
movw $0x1372,-8(%ebp)
|
movw $0x1372,newcw
|
||||||
fldcw -8(%ebp)
|
fldcw newcw
|
||||||
fwait
|
fwait
|
||||||
fldt d
|
fldt d
|
||||||
fistpl -8(%ebp)
|
fistpq res
|
||||||
movl -8(%ebp),%eax
|
movl res,%eax
|
||||||
fldcw -4(%ebp)
|
movl res+4,%edx
|
||||||
|
fldcw oldcw
|
||||||
end ['EAX','ECX'];
|
end ['EAX','ECX'];
|
||||||
|
|
||||||
|
|
||||||
@ -197,7 +204,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.8 2002-09-07 16:01:19 peter
|
Revision 1.9 2002-10-06 21:26:17 peter
|
||||||
|
* round returns int64
|
||||||
|
|
||||||
|
Revision 1.8 2002/09/07 16:01:19 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
function int(d : extended) : extended;
|
function int(d : extended) : extended;
|
||||||
function ln(d : extended) : extended;
|
function ln(d : extended) : extended;
|
||||||
function pi : extended;
|
function pi : extended;
|
||||||
function round(d : extended) : longint;
|
function round(d : extended) : int64;
|
||||||
function sin(d : extended) : extended;
|
function sin(d : extended) : extended;
|
||||||
function sqr(d : extended) : extended;
|
function sqr(d : extended) : extended;
|
||||||
function sqrt(d : extended) : extended;
|
function sqrt(d : extended) : extended;
|
||||||
@ -44,7 +44,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.8 2002-09-07 15:07:45 peter
|
Revision 1.9 2002-10-06 21:26:18 peter
|
||||||
|
* round returns int64
|
||||||
|
|
||||||
|
Revision 1.8 2002/09/07 15:07:45 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
Revision 1.7 2002/07/26 22:46:06 florian
|
Revision 1.7 2002/07/26 22:46:06 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user