mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 07:50:27 +02:00
* compile float*2 as float+float if possible as proposed by Rika, resolves #40116
This commit is contained in:
parent
ec28b7586c
commit
789031a6e6
@ -1100,6 +1100,12 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=right.getcopy;
|
result:=right.getcopy;
|
||||||
exit;
|
exit;
|
||||||
|
end
|
||||||
|
else if (trealconstnode(left).value_real=2) and (nodetype=muln) and not(might_have_sideeffects(right,[mhs_exceptions])) and
|
||||||
|
(node_complexity(right)<=1) then
|
||||||
|
begin
|
||||||
|
result:=caddnode.create_internal(addn,right.getcopy,right.getcopy);
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if rt=realconstn then
|
else if rt=realconstn then
|
||||||
@ -1127,6 +1133,12 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=left.getcopy;
|
result:=left.getcopy;
|
||||||
exit;
|
exit;
|
||||||
|
end
|
||||||
|
else if (trealconstnode(right).value_real=2) and (nodetype=muln) and not(might_have_sideeffects(left,[mhs_exceptions])) and
|
||||||
|
(node_complexity(left)<=1) then
|
||||||
|
begin
|
||||||
|
result:=caddnode.create_internal(addn,left.getcopy,left.getcopy);
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
{ optimize a/a and a-a }
|
{ optimize a/a and a-a }
|
||||||
|
Loading…
Reference in New Issue
Block a user