mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-08 17:37:32 +01:00
* fixed multiplication by 64-bit constants on x86_64, mantis #26230
git-svn-id: trunk@27822 -
This commit is contained in:
parent
2936335f68
commit
daf71e6d88
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13931,6 +13931,7 @@ tests/webtbs/tw2602.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw2607.pp svneol=native#text/plain
|
tests/webtbs/tw2607.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw26162.pp svneol=native#text/pascal
|
tests/webtbs/tw26162.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw2620.pp svneol=native#text/plain
|
tests/webtbs/tw2620.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw26230.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2626.pp svneol=native#text/plain
|
tests/webtbs/tw2626.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2627.pp svneol=native#text/plain
|
tests/webtbs/tw2627.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2631.pp svneol=native#text/plain
|
tests/webtbs/tw2631.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -1589,7 +1589,7 @@ unit cgx86;
|
|||||||
list.concat(taicpu.op_ref_reg(A_LEA,TCgSize2OpSize[size],href,dst));
|
list.concat(taicpu.op_ref_reg(A_LEA,TCgSize2OpSize[size],href,dst));
|
||||||
end
|
end
|
||||||
else if (op in [OP_MUL,OP_IMUL]) and (size in [OS_32,OS_S32,OS_64,OS_S64]) and
|
else if (op in [OP_MUL,OP_IMUL]) and (size in [OS_32,OS_S32,OS_64,OS_S64]) and
|
||||||
(a>1) and not ispowerof2(int64(a),power) then
|
(a>1) and (a<=maxLongint) and not ispowerof2(int64(a),power) then
|
||||||
begin
|
begin
|
||||||
{ MUL with overflow checking should be handled specifically in the code generator }
|
{ MUL with overflow checking should be handled specifically in the code generator }
|
||||||
if (op=OP_MUL) and (cs_check_overflow in current_settings.localswitches) then
|
if (op=OP_MUL) and (cs_check_overflow in current_settings.localswitches) then
|
||||||
|
|||||||
22
tests/webtbs/tw26230.pp
Normal file
22
tests/webtbs/tw26230.pp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
program tw26230;
|
||||||
|
|
||||||
|
const
|
||||||
|
C1 = 86400000000; //MCS in a day
|
||||||
|
|
||||||
|
var
|
||||||
|
AInput,
|
||||||
|
Product : Int64;
|
||||||
|
|
||||||
|
begin
|
||||||
|
AInput := 1;
|
||||||
|
//asm int3 end; //debug trap; `disassemble`
|
||||||
|
Product := AInput * C1;
|
||||||
|
WriteLn(AInput, ' * ', C1, ' = ', Product);
|
||||||
|
if Product <> 86400000000 then
|
||||||
|
begin
|
||||||
|
Writeln('Error!');
|
||||||
|
Halt(1);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Writeln('Ok');
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user