mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-08 16:17:12 +01:00
* made PostPeepholeOptMov a function
git-svn-id: trunk@37550 -
This commit is contained in:
parent
a7ea7fb569
commit
3097eaf8ee
@ -1312,7 +1312,8 @@ begin
|
||||
if PostPeepholeOptCmp(p) then
|
||||
Continue;
|
||||
A_MOV:
|
||||
PostPeepholeOptMov(p);
|
||||
if PostPeepholeOptMov(p) then
|
||||
Continue;
|
||||
A_MOVZX:
|
||||
{ if register vars are on, it's possible there is code like }
|
||||
{ "cmpl $3,%eax; movzbl 8(%ebp),%ebx; je .Lxxx" }
|
||||
|
||||
@ -72,7 +72,7 @@ unit aoptx86;
|
||||
function OptPass2Jmp(var p : tai) : boolean;
|
||||
function OptPass2Jcc(var p : tai) : boolean;
|
||||
|
||||
procedure PostPeepholeOptMov(const p : tai);
|
||||
function PostPeepholeOptMov(const p : tai) : Boolean;
|
||||
function PostPeepholeOptCmp(var p : tai) : Boolean;
|
||||
|
||||
procedure OptReferences;
|
||||
@ -2634,8 +2634,9 @@ unit aoptx86;
|
||||
end;
|
||||
|
||||
|
||||
procedure TX86AsmOptimizer.PostPeepholeOptMov(const p : tai);
|
||||
function TX86AsmOptimizer.PostPeepholeOptMov(const p : tai) : Boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
if (taicpu(p).oper[1]^.typ = Top_Reg) and
|
||||
not(RegInUsedRegs(NR_DEFAULTFLAGS,UsedRegs)) then
|
||||
begin
|
||||
@ -2663,7 +2664,6 @@ unit aoptx86;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -141,7 +141,7 @@ uses
|
||||
begin
|
||||
case taicpu(p).opcode of
|
||||
A_MOV:
|
||||
PostPeepholeOptMov(p);
|
||||
Result:=PostPeepholeOptMov(p);
|
||||
A_CMP:
|
||||
Result:=PostPeepholeOptCmp(p);
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user