mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 20:29:24 +02:00
* in the generic implementation of fpc_mul_int64, fallback directly to
fpc_mul_qword directly in case overflow checking is not used git-svn-id: trunk@26483 -
This commit is contained in:
parent
e210d5f30e
commit
34cf432600
@ -310,6 +310,13 @@
|
|||||||
q1,q2,q3 : qword;
|
q1,q2,q3 : qword;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{ there's no difference between signed and unsigned multiplication,
|
||||||
|
when the destination size is equal to the source size and overflow
|
||||||
|
checking is off }
|
||||||
|
if not checkoverflow then
|
||||||
|
{ qword(f1)*qword(f2) is coded as a call to mulqword }
|
||||||
|
fpc_mul_int64:=int64(qword(f1)*qword(f2))
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
sign:=false;
|
sign:=false;
|
||||||
if f1<0 then
|
if f1<0 then
|
||||||
@ -329,7 +336,7 @@
|
|||||||
{ the q1*q2 is coded as call to mulqword }
|
{ the q1*q2 is coded as call to mulqword }
|
||||||
q3:=q1*q2;
|
q3:=q1*q2;
|
||||||
|
|
||||||
if checkoverflow and (q1 <> 0) and (q2 <>0) and
|
if (q1 <> 0) and (q2 <>0) and
|
||||||
((q1>q3) or (q2>q3) or
|
((q1>q3) or (q2>q3) or
|
||||||
{ the bit 63 can be only set if we have $80000000 00000000 }
|
{ the bit 63 can be only set if we have $80000000 00000000 }
|
||||||
{ and sign is true }
|
{ and sign is true }
|
||||||
|
Loading…
Reference in New Issue
Block a user