mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 23:49:07 +02:00
* improved qword*qword code, if no overflow checking is done
This commit is contained in:
parent
d680066e7c
commit
042cb265c0
@ -123,7 +123,8 @@
|
|||||||
{ can the fpu do the work? }
|
{ can the fpu do the work? }
|
||||||
if fpuint64 then
|
if fpuint64 then
|
||||||
begin
|
begin
|
||||||
c:=comp(z)/comp(n);
|
// the c:=comp(...) is necessary to shut up the compiler
|
||||||
|
c:=comp(comp(z)/comp(n));
|
||||||
divint64:=qword(c);
|
divint64:=qword(c);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -161,8 +162,38 @@
|
|||||||
_f1,bitpos : qword;
|
_f1,bitpos : qword;
|
||||||
l : longint;
|
l : longint;
|
||||||
|
|
||||||
|
{$ifdef i386}
|
||||||
|
r : qword;
|
||||||
|
{$endif i386}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$ifdef i386}
|
||||||
|
if not(checkoverflow) then
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
movl f1+4,%edx
|
||||||
|
movl f2+4,%ecx
|
||||||
|
orl %ecx,%edx
|
||||||
|
movl f2,%edx
|
||||||
|
movl f1,%eax
|
||||||
|
jnz .Lqwordmultwomul
|
||||||
|
mull %edx
|
||||||
|
jmp .Lqwordmulready
|
||||||
|
.Lqwordmultwomul:
|
||||||
|
imul f1+4,%edx
|
||||||
|
imul %eax,%ecx
|
||||||
|
addl %edx,%ecx
|
||||||
|
mull f2
|
||||||
|
add %ecx,%edx
|
||||||
|
.Lqwordmulready:
|
||||||
|
movl %eax,r
|
||||||
|
movl %edx,r+4
|
||||||
|
end;
|
||||||
|
mulqword:=r;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
{$endif i386}
|
||||||
|
begin
|
||||||
mulqword:=0;
|
mulqword:=0;
|
||||||
bitpos:=1;
|
bitpos:=1;
|
||||||
|
|
||||||
@ -183,6 +214,7 @@
|
|||||||
if checkoverflow and ((_f1>mulqword) or (f2>mulqword)) then
|
if checkoverflow and ((_f1>mulqword) or (f2>mulqword)) then
|
||||||
HandleErrorFrame(215,get_frame);
|
HandleErrorFrame(215,get_frame);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ multiplies two int64 ....
|
{ multiplies two int64 ....
|
||||||
fpuint64 = false:
|
fpuint64 = false:
|
||||||
@ -202,7 +234,8 @@
|
|||||||
{ can the fpu do the work ? }
|
{ can the fpu do the work ? }
|
||||||
if fpuint64 and not(checkoverflow) then
|
if fpuint64 and not(checkoverflow) then
|
||||||
begin
|
begin
|
||||||
c:=comp(f1)*comp(f2);
|
// the c:=comp(...) is necessary to shut up the compiler
|
||||||
|
c:=comp(comp(f1)*comp(f2));
|
||||||
mulint64:=int64(c);
|
mulint64:=int64(c);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -400,7 +433,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 2000-01-23 12:27:39 florian
|
Revision 1.17 2000-01-27 15:43:02 florian
|
||||||
|
* improved qword*qword code, if no overflow checking is done
|
||||||
|
|
||||||
|
Revision 1.16 2000/01/23 12:27:39 florian
|
||||||
* int64/int64 and int64*int64 is now done by the fpu if possible
|
* int64/int64 and int64*int64 is now done by the fpu if possible
|
||||||
|
|
||||||
Revision 1.15 2000/01/23 12:22:37 florian
|
Revision 1.15 2000/01/23 12:22:37 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user