mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
* Moved SkipEntryExitMarker method from ARM optimizer to the base one, since it is not target-dependent. Now it can be reused by other targets.
git-svn-id: trunk@25738 -
This commit is contained in:
parent
a3364a4b80
commit
a5ae26da7e
@ -67,6 +67,7 @@ unit aoptbase;
|
|||||||
{ false and sets last to nil }
|
{ false and sets last to nil }
|
||||||
Function GetLastInstruction(Current: tai; Var Last: tai): Boolean;
|
Function GetLastInstruction(Current: tai; Var Last: tai): Boolean;
|
||||||
|
|
||||||
|
function SkipEntryExitMarker(current: tai; var next: tai): boolean;
|
||||||
|
|
||||||
{ processor dependent methods }
|
{ processor dependent methods }
|
||||||
|
|
||||||
@ -246,6 +247,21 @@ unit aoptbase;
|
|||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
function TAOptBase.SkipEntryExitMarker(current: tai; var next: tai): boolean;
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
|
if current.typ<>ait_marker then
|
||||||
|
exit;
|
||||||
|
next:=current;
|
||||||
|
while GetNextInstruction(next,next) do
|
||||||
|
begin
|
||||||
|
if (next.typ<>ait_marker) or not(tai_marker(next).Kind in [mark_Position,mark_BlockStart]) then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TAOptBase.RegUsedBetween(reg : TRegister;p1,p2 : tai) : Boolean;
|
Function TAOptBase.RegUsedBetween(reg : TRegister;p1,p2 : tai) : Boolean;
|
||||||
Begin
|
Begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
@ -54,8 +54,6 @@ Type
|
|||||||
{ outputs a debug message into the assembler file }
|
{ outputs a debug message into the assembler file }
|
||||||
procedure DebugMsg(const s: string; p: tai);
|
procedure DebugMsg(const s: string; p: tai);
|
||||||
|
|
||||||
private
|
|
||||||
function SkipEntryExitMarker(current: tai; var next: tai): boolean;
|
|
||||||
protected
|
protected
|
||||||
function LookForPreindexedPattern(p: taicpu): boolean;
|
function LookForPreindexedPattern(p: taicpu): boolean;
|
||||||
function LookForPostindexedPattern(p: taicpu): boolean;
|
function LookForPostindexedPattern(p: taicpu): boolean;
|
||||||
@ -525,22 +523,6 @@ Implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ skip harmless marker marking entry/exit code, so it can be optimized as well }
|
|
||||||
function TCpuAsmOptimizer.SkipEntryExitMarker(current : tai;var next : tai) : boolean;
|
|
||||||
begin
|
|
||||||
result:=true;
|
|
||||||
if current.typ<>ait_marker then
|
|
||||||
exit;
|
|
||||||
next:=current;
|
|
||||||
while GetNextInstruction(next,next) do
|
|
||||||
begin
|
|
||||||
if (next.typ<>ait_marker) or not(tai_marker(next).Kind in [mark_Position,mark_BlockStart]) then
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
result:=false;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
|
function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
|
||||||
var
|
var
|
||||||
hp1,hp2,hp3,hp4: tai;
|
hp1,hp2,hp3,hp4: tai;
|
||||||
|
Loading…
Reference in New Issue
Block a user