* Z80: JR can be both conditional and uncoditional jump, just like JP

git-svn-id: trunk@45411 -
This commit is contained in:
nickysn 2020-05-17 23:38:23 +00:00
parent a88eee4080
commit edcc14a5ce
2 changed files with 8 additions and 6 deletions

View File

@ -1557,11 +1557,11 @@ Unit AoptObj;
{ Returns True if hp is an unconditional jump to a label }
function IsJumpToLabelUncond(hp: taicpu): boolean;
begin
{$if defined(avr)}
{$if defined(avr) or defined(z80)}
result:=(hp.opcode in aopt_uncondjmp) and
{$else avr}
{$else}
result:=(hp.opcode=aopt_uncondjmp) and
{$endif avr}
{$endif}
{$if defined(arm) or defined(aarch64) or defined(z80)}
(hp.condition=c_None) and
{$endif arm or aarch64 or z80}
@ -1626,7 +1626,9 @@ Unit AoptObj;
{$else powerpc}
p.condition := C_None;
{$endif powerpc}
{$ifndef z80}
p.opcode := aopt_uncondjmp;
{$endif not z80}
{$ifdef RISCV}
p.loadoper(1, p.oper[p.ops-1]^);
p.loadreg(0, NR_X0);
@ -2231,7 +2233,7 @@ Unit AoptObj;
stoploop := False;
end
{$ifndef JVM}
else if (taicpu(p).opcode = aopt_condjmp) then
else if (taicpu(p).opcode {$ifdef z80}in{$else}={$endif} aopt_condjmp) then
ThisPassResult := OptimizeConditionalJump(ThisLabel, p, hp1, stoploop)
{$endif JVM}
;

View File

@ -99,8 +99,8 @@ Const
StoreDst = 0;
aopt_uncondjmp = A_JP;
aopt_condjmp = A_JP;
aopt_uncondjmp = [A_JP,A_JR];
aopt_condjmp = [A_JP,A_JR];
Implementation