mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 10:06:23 +02:00
+ define cpudelayslot: set during compiler compilation for CPUs having branch instructions with delay slot (MIPS, SPARC)
git-svn-id: trunk@36958 -
This commit is contained in:
parent
049d7884cd
commit
7f286eb54e
@ -188,11 +188,11 @@ unit aoptbase;
|
|||||||
Current := tai(Current.Next);
|
Current := tai(Current.Next);
|
||||||
While Assigned(Current) And
|
While Assigned(Current) And
|
||||||
((Current.typ In SkipInstr) or
|
((Current.typ In SkipInstr) or
|
||||||
{$if defined(SPARCGEN) or defined(MIPS)}
|
{$ifdef cpudelayslot}
|
||||||
((Current.typ=ait_instruction) and
|
((Current.typ=ait_instruction) and
|
||||||
(taicpu(Current).opcode=A_NOP)
|
(taicpu(Current).opcode=A_NOP)
|
||||||
) or
|
) or
|
||||||
{$endif SPARCGEN or MIPS}
|
{$endif cpudelayslot}
|
||||||
((Current.typ = ait_label) And
|
((Current.typ = ait_label) And
|
||||||
labelCanBeSkipped(Tai_Label(Current)))) Do
|
labelCanBeSkipped(Tai_Label(Current)))) Do
|
||||||
Current := tai(Current.Next);
|
Current := tai(Current.Next);
|
||||||
|
@ -1049,9 +1049,9 @@ Unit AoptObj;
|
|||||||
Repeat
|
Repeat
|
||||||
While Assigned(StartPai) And
|
While Assigned(StartPai) And
|
||||||
((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
|
((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
|
||||||
{$if defined(MIPS) or defined(SPARCGEN)}
|
{$ifdef cpudelayslot}
|
||||||
((startpai.typ=ait_instruction) and (taicpu(startpai).opcode=A_NOP)) or
|
((startpai.typ=ait_instruction) and (taicpu(startpai).opcode=A_NOP)) or
|
||||||
{$endif MIPS or SPARC}
|
{$endif cpudelayslot}
|
||||||
((StartPai.typ = ait_label) and
|
((StartPai.typ = ait_label) and
|
||||||
Not(Tai_Label(StartPai).labsym.Is_Used))) Do
|
Not(Tai_Label(StartPai).labsym.Is_Used))) Do
|
||||||
StartPai := Tai(StartPai.Next);
|
StartPai := Tai(StartPai.Next);
|
||||||
@ -1398,10 +1398,10 @@ Unit AoptObj;
|
|||||||
no-line-info-start/end etc }
|
no-line-info-start/end etc }
|
||||||
if hp1.typ<>ait_marker then
|
if hp1.typ<>ait_marker then
|
||||||
begin
|
begin
|
||||||
{$if defined(SPARC) or defined(MIPS) }
|
{$ifdef cpudelayslot}
|
||||||
if (hp1.typ=ait_instruction) and (taicpu(hp1).is_jmp) then
|
if (hp1.typ=ait_instruction) and (taicpu(hp1).is_jmp) then
|
||||||
RemoveDelaySlot(hp1);
|
RemoveDelaySlot(hp1);
|
||||||
{$endif SPARC or MIPS }
|
{$endif cpudelayslot}
|
||||||
asml.remove(hp1);
|
asml.remove(hp1);
|
||||||
hp1.free;
|
hp1.free;
|
||||||
stoploop:=false;
|
stoploop:=false;
|
||||||
@ -1421,9 +1421,9 @@ Unit AoptObj;
|
|||||||
(p<>blockstart) then
|
(p<>blockstart) then
|
||||||
begin
|
begin
|
||||||
tasmlabel(JumpTargetOp(taicpu(p))^.ref^.symbol).decrefs;
|
tasmlabel(JumpTargetOp(taicpu(p))^.ref^.symbol).decrefs;
|
||||||
{$if defined(SPARC) or defined(MIPS)}
|
{$ifdef cpudelayslot}
|
||||||
RemoveDelaySlot(p);
|
RemoveDelaySlot(p);
|
||||||
{$endif SPARC or MIPS}
|
{$endif cpudelayslot}
|
||||||
hp2:=tai(hp1.next);
|
hp2:=tai(hp1.next);
|
||||||
asml.remove(p);
|
asml.remove(p);
|
||||||
p.free;
|
p.free;
|
||||||
@ -1468,9 +1468,9 @@ Unit AoptObj;
|
|||||||
|
|
||||||
taicpu(p).oper[0]^.ref^.symbol.increfs;
|
taicpu(p).oper[0]^.ref^.symbol.increfs;
|
||||||
}
|
}
|
||||||
{$if defined(SPARC) or defined(MIPS)}
|
{$ifdef cpudelayslot}
|
||||||
RemoveDelaySlot(hp1);
|
RemoveDelaySlot(hp1);
|
||||||
{$endif SPARC or MIPS}
|
{$endif cpudelayslot}
|
||||||
asml.remove(hp1);
|
asml.remove(hp1);
|
||||||
hp1.free;
|
hp1.free;
|
||||||
stoploop:=false;
|
stoploop:=false;
|
||||||
|
@ -109,6 +109,7 @@
|
|||||||
{$define cpuflags}
|
{$define cpuflags}
|
||||||
{$define cputargethasfixedstack}
|
{$define cputargethasfixedstack}
|
||||||
{$define cpurefshaveindexreg}
|
{$define cpurefshaveindexreg}
|
||||||
|
{$define cpudelayslot}
|
||||||
{$define SUPPORT_SAFECALL}
|
{$define SUPPORT_SAFECALL}
|
||||||
{$define sparcgen}
|
{$define sparcgen}
|
||||||
|
|
||||||
@ -124,6 +125,7 @@
|
|||||||
{$define cpuflags}
|
{$define cpuflags}
|
||||||
{$define cputargethasfixedstack}
|
{$define cputargethasfixedstack}
|
||||||
{$define cpurefshaveindexreg}
|
{$define cpurefshaveindexreg}
|
||||||
|
{$define cpudelayslot}
|
||||||
{$define SUPPORT_SAFECALL}
|
{$define SUPPORT_SAFECALL}
|
||||||
{$define sparcgen}
|
{$define sparcgen}
|
||||||
{$endif sparc64}
|
{$endif sparc64}
|
||||||
@ -238,6 +240,7 @@
|
|||||||
{$define cpurequiresproperalignment}
|
{$define cpurequiresproperalignment}
|
||||||
{ define cpumm}
|
{ define cpumm}
|
||||||
{$define cpurefshaveindexreg}
|
{$define cpurefshaveindexreg}
|
||||||
|
{$define cpudelayslot}
|
||||||
{$define SUPPORT_GET_FRAME}
|
{$define SUPPORT_GET_FRAME}
|
||||||
{$define SUPPORT_SAFECALL}
|
{$define SUPPORT_SAFECALL}
|
||||||
{$endif mips}
|
{$endif mips}
|
||||||
|
Loading…
Reference in New Issue
Block a user