mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:19:21 +02:00
* x86: Some refactoring to use aoc_ForceNewIteration instead of manually advancing p
This commit is contained in:
parent
3cec86390a
commit
b8933dd267
@ -126,6 +126,22 @@ unit aoptcpu;
|
|||||||
end;
|
end;
|
||||||
Break;
|
Break;
|
||||||
until False;
|
until False;
|
||||||
|
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -300,6 +316,21 @@ unit aoptcpu;
|
|||||||
else
|
else
|
||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -402,6 +433,21 @@ unit aoptcpu;
|
|||||||
else
|
else
|
||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -14612,9 +14612,10 @@ unit aoptx86;
|
|||||||
taicpu(hp1).clearop(1);
|
taicpu(hp1).clearop(1);
|
||||||
taicpu(hp1).ops := 0;
|
taicpu(hp1).ops := 0;
|
||||||
|
|
||||||
{ A change was made, but not with p, so move forward 1 }
|
{ A change was made, but not with p, so don't set Result, but
|
||||||
p := tai(p.Next);
|
notify the compiler that a change was made }
|
||||||
Result := True;
|
Include(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
Exit; { and -> btr won't happen because an opsize of S_W won't be optimised anyway }
|
Exit; { and -> btr won't happen because an opsize of S_W won't be optimised anyway }
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -63,6 +63,22 @@ uses
|
|||||||
else
|
else
|
||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -218,6 +234,21 @@ uses
|
|||||||
else
|
else
|
||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -270,6 +301,21 @@ uses
|
|||||||
else
|
else
|
||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
{ If this flag is set, something was optimised ahead of p, so move
|
||||||
|
ahead by 1 instruction but treat as if Result was set to True }
|
||||||
|
if aoc_ForceNewIteration in OptsToCheck then
|
||||||
|
begin
|
||||||
|
Exclude(OptsToCheck, aoc_ForceNewIteration);
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
begin
|
||||||
|
if (p.typ in SkipInstr) then
|
||||||
|
UpdateUsedRegs(p);
|
||||||
|
|
||||||
|
p := tai(p.Next);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user