Re: [hatari-devel] Re: BM407 + symbols

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Doh, now I see it.

Ah ok. Understood.
 
Any idea what would be the best way to check, on next instruction
from conditional subroutine call instruction, whether subroutine
call was actually done or not?

For example, how safe assumption it would be that if the "called" subroutine
is on next instruction, it actually wasn't a call?

I think the code would have to be pretty scary to permit that arrangement and still be useful.

The only 'likely' case I can think of is this:

   move dummy_fn_ptr,r0
   ...
   jscc (r0)
dummy_fn:   <- rts is aliased for multiple jobs
   rts

...which I suppose is possible in a real program but not at all common.
 

For subroutine call instructions that take an absolute address instead of
destination being specified indirectly (e.g. in register), that would
probably be very safe as absolute subroutine call to next instruction
would be really dumb.  :-)

Exactly. It would need to be conditional via a register to make any sense. And TBH it's an assumption you could mandate in the profiler 'dont do this if you want sensible profiles'. :-)
 

I would assume that even for indirect destinations that is pretty safe.
I'd guess it rare for code to call subroutine on next instruction before
going to it by normal PC increment.  It might still happen though, if one
needs to do tail call to the same function multiple times and wants to
save one branch & rts instruction...

Yes pretty much what I wrote above. I think its ok providing you document the limitation.
 
D.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/