mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 02:49:28 +02:00
* patch by J. Gareth Moreton, second part of #38841
git-svn-id: trunk@49341 -
This commit is contained in:
parent
9bad5180bb
commit
964c04aded
@ -203,9 +203,9 @@ Implementation
|
|||||||
not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) then
|
not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) then
|
||||||
begin
|
begin
|
||||||
if taicpu(p).opcode = A_LDR then
|
if taicpu(p).opcode = A_LDR then
|
||||||
DebugMsg('Peephole LdrAdd/Sub2Ldr Postindex done', p)
|
DebugMsg(SPeepholeOptimization + 'LdrAdd/Sub2Ldr Postindex done', p)
|
||||||
else
|
else
|
||||||
DebugMsg('Peephole StrAdd/Sub2Str Postindex done', p);
|
DebugMsg(SPeepholeOptimization + 'StrAdd/Sub2Str Postindex done', p);
|
||||||
|
|
||||||
taicpu(p).oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
|
taicpu(p).oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
|
||||||
if taicpu(hp1).opcode=A_ADD then
|
if taicpu(hp1).opcode=A_ADD then
|
||||||
@ -248,7 +248,7 @@ Implementation
|
|||||||
dealloc:=FindRegDeAlloc(taicpu(p).oper[0]^.reg,tai(movp.Next));
|
dealloc:=FindRegDeAlloc(taicpu(p).oper[0]^.reg,tai(movp.Next));
|
||||||
if assigned(dealloc) then
|
if assigned(dealloc) then
|
||||||
begin
|
begin
|
||||||
DebugMsg('Peephole '+optimizer+' removed superfluous vmov', movp);
|
DebugMsg(SPeepholeOptimization + optimizer+' removed superfluous vmov', movp);
|
||||||
result:=true;
|
result:=true;
|
||||||
|
|
||||||
{ taicpu(p).oper[0]^.reg is not used anymore, try to find its allocation
|
{ taicpu(p).oper[0]^.reg is not used anymore, try to find its allocation
|
||||||
@ -417,7 +417,7 @@ Implementation
|
|||||||
RemoveInstruction(hp1);
|
RemoveInstruction(hp1);
|
||||||
RemoveCurrentp(p);
|
RemoveCurrentp(p);
|
||||||
|
|
||||||
DebugMsg('Peephole FoldShiftProcess done', hp2);
|
DebugMsg(SPeepholeOptimization + 'FoldShiftProcess done', hp2);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
@ -510,7 +510,7 @@ Implementation
|
|||||||
hp3.free;
|
hp3.free;
|
||||||
hp4.free;
|
hp4.free;
|
||||||
p:=hp2;
|
p:=hp2;
|
||||||
DebugMsg('Peephole Bl2B done', p);
|
DebugMsg(SPeepholeOptimization + 'Bl2B done', p);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -525,7 +525,7 @@ Implementation
|
|||||||
(taicpu(p).oppostfix=PF_None) then
|
(taicpu(p).oppostfix=PF_None) then
|
||||||
begin
|
begin
|
||||||
RemoveCurrentP(p);
|
RemoveCurrentP(p);
|
||||||
DebugMsg('Peephole Mov2None done', p);
|
DebugMsg(SPeepholeOptimization + 'Mov2None done', p);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -691,9 +691,9 @@ Implementation
|
|||||||
}
|
}
|
||||||
taicpu(p).opcode := TargetOpcode;
|
taicpu(p).opcode := TargetOpcode;
|
||||||
if TargetOpcode = A_STP then
|
if TargetOpcode = A_STP then
|
||||||
DebugMsg('Peephole Optimization: StrStr2Stp', p)
|
DebugMsg(SPeepholeOptimization + 'StrStr2Stp', p)
|
||||||
else
|
else
|
||||||
DebugMsg('Peephole Optimization: LdrLdr2Ldp', p);
|
DebugMsg(SPeepholeOptimization + 'LdrLdr2Ldp', p);
|
||||||
taicpu(p).ops := 3;
|
taicpu(p).ops := 3;
|
||||||
taicpu(p).loadref(2, taicpu(p).oper[1]^.ref^);
|
taicpu(p).loadref(2, taicpu(p).oper[1]^.ref^);
|
||||||
taicpu(p).loadreg(1, taicpu(hp1).oper[0]^.reg);
|
taicpu(p).loadreg(1, taicpu(hp1).oper[0]^.reg);
|
||||||
@ -717,9 +717,9 @@ Implementation
|
|||||||
}
|
}
|
||||||
taicpu(p).opcode := TargetOpcode;
|
taicpu(p).opcode := TargetOpcode;
|
||||||
if TargetOpcode = A_STP then
|
if TargetOpcode = A_STP then
|
||||||
DebugMsg('Peephole Optimization: StrStr2Stp (reverse)', p)
|
DebugMsg(SPeepholeOptimization + 'StrStr2Stp (reverse)', p)
|
||||||
else
|
else
|
||||||
DebugMsg('Peephole Optimization: LdrLdr2Ldp (reverse)', p);
|
DebugMsg(SPeepholeOptimization + 'LdrLdr2Ldp (reverse)', p);
|
||||||
taicpu(p).ops := 3;
|
taicpu(p).ops := 3;
|
||||||
taicpu(p).loadref(2, taicpu(hp1).oper[1]^.ref^);
|
taicpu(p).loadref(2, taicpu(hp1).oper[1]^.ref^);
|
||||||
taicpu(p).loadreg(1, taicpu(p).oper[0]^.reg);
|
taicpu(p).loadreg(1, taicpu(p).oper[0]^.reg);
|
||||||
@ -774,7 +774,7 @@ Implementation
|
|||||||
p.free;
|
p.free;
|
||||||
hp1.free;
|
hp1.free;
|
||||||
p:=hp2;
|
p:=hp2;
|
||||||
DebugMsg('Peephole CMPB.E/NE2CBNZ/CBZ done', p);
|
DebugMsg(SPeepholeOptimization + 'CMPB.E/NE2CBNZ/CBZ done', p);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user