DSPRelated.com
Forums

Blackfin function epilogue

Started by jenikh July 21, 2006
Hi,
  deas anybody know what's diference between:

   SP + = 16; 
   P0=[FP+4]; 
   (R7:4)=[SP++]; 
   UNLINK; 
   JUMP (P0); 

and

   SP + = 16; 
   (R7:4)=[SP++]; 
   UNLINK; 
   RTS; 

Thanks

JkH



jenikh <jenikh@centrum.cz> wrote:
[ADI blackfin]
> deas anybody know what's diference between: > SP + = 16; > P0=[FP+4]; > (R7:4)=[SP++]; > UNLINK; > JUMP (P0);
> and
> SP + = 16; > (R7:4)=[SP++]; > UNLINK; > RTS;
your solution is one cycle faster. ;-) WD --
> > your solution is one cycle faster. ;-) > >WD >--
So why VisualDSP++ use longer solution? ;-) JkH
jenikh wrote:

> Hi, > deas anybody know what's diference between: > > SP + = 16; > P0=[FP+4]; > (R7:4)=[SP++]; > UNLINK; > JUMP (P0); > > and > > SP + = 16; > (R7:4)=[SP++]; > UNLINK; > RTS; > > Thanks > > JkH
It has been long time since I have programmed BF asm, but IIRC RTS returns to address pointed by register RETS, while the longer version fetches the return address from memory. Functionally they seem identical. All I can think of is that the the longer version migth not issue a pipeline stall as the memory fetch for the return address is done earlier and stored in P0. This is only a guess though.. perhaps you should benchmark the two version. -- ---- Jani Huhtanen Tampere University of Technology, Pori