mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 02:59:13 +02:00
* don't waste a register for inc/dec(<pointer>,const);
git-svn-id: trunk@11812 -
This commit is contained in:
parent
fc6ae58b9b
commit
0a8f621a6b
@ -444,6 +444,8 @@ implementation
|
|||||||
{ when constant, just multiply the addvalue }
|
{ when constant, just multiply the addvalue }
|
||||||
if is_constintnode(tcallparanode(tcallparanode(left).right).left) then
|
if is_constintnode(tcallparanode(tcallparanode(left).right).left) then
|
||||||
addvalue:=addvalue*get_ordinal_value(tcallparanode(tcallparanode(left).right).left)
|
addvalue:=addvalue*get_ordinal_value(tcallparanode(tcallparanode(left).right).left)
|
||||||
|
else if is_constpointernode(tcallparanode(tcallparanode(left).right).left) then
|
||||||
|
addvalue:=addvalue*tpointerconstnode(tcallparanode(tcallparanode(left).right).left).value
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
location_force_reg(current_asmdata.CurrAsmList,tcallparanode(tcallparanode(left).right).left.location,cgsize,addvalue<=1);
|
location_force_reg(current_asmdata.CurrAsmList,tcallparanode(tcallparanode(left).right).left.location,cgsize,addvalue<=1);
|
||||||
|
@ -460,6 +460,7 @@ interface
|
|||||||
function is_constboolnode(p : tnode) : boolean;
|
function is_constboolnode(p : tnode) : boolean;
|
||||||
function is_constenumnode(p : tnode) : boolean;
|
function is_constenumnode(p : tnode) : boolean;
|
||||||
function is_constwidecharnode(p : tnode) : boolean;
|
function is_constwidecharnode(p : tnode) : boolean;
|
||||||
|
function is_constpointernode(p : tnode) : boolean;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -670,6 +671,13 @@ implementation
|
|||||||
is_constenumnode:=(p.nodetype=ordconstn) and (p.resultdef.typ=enumdef);
|
is_constenumnode:=(p.nodetype=ordconstn) and (p.resultdef.typ=enumdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function is_constpointernode(p : tnode) : boolean;
|
||||||
|
begin
|
||||||
|
is_constpointernode:=(p.nodetype=pointerconstn);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
TNODE
|
TNODE
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
Loading…
Reference in New Issue
Block a user