Program Counter in PPC750

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
How do I get a current  PC in assembly for PPC750?
As far as I know there is no PC register that I can read.
Is there any trick? I tried with a dummy function call and reading Link
Register,
but that is not good enough.
Regards,
Goran




Re: Program Counter in PPC750
Quoted text here. Click to load it

Which PC do you mean?  The one for the 6 instructions executing in
parallel?  Which of those 6?  Or perhaps you mean the PC used to fetch one
of the 6 instructions sitting in the instruction fetch queue, but that
have not yet been dispatched... which of THOSE six do you mean?  Or should
we discuss the PC being used to bring in four instructions from the cache
that might never be executed because a prior branch is about to
speculatively change directions?

Which PC WOULD be good enough for you?

How about the one you get by doing something like:
; stack lr, how you do that is your problem
          bl next  ; LR will be set with run time addr of next
next:     mflr r31 ; capture that run time value
; unstack lr, how you do that is your problem

If that isn't good enough, I would like to know what is.

--
Skipper Smith                         Helpful Knowledge Consulting
Worldwide         Microprocessor       Architecture       Training
We've slightly trimmed the long signature. Click to see the full one.
Re: Program Counter in PPC750
This smacks of arrogance.  A bit more courtesy would be expected from
somebody working for a company called "Helpful" Knowledge Consulting.


Quoted text here. Click to load it



Re: Program Counter in PPC750

Quoted text here. Click to load it

Actually, although the PPC does not have a user-visible PC, and is
super-scaler, it acts as though it were entirely sequential.  You can
pretend that it reads one instruction, interpretes it, executes it, stores
the results, and then moves on to the next instuction - from the programmers
viewpoint, that is exactly what is happening.  Somehow the chip manages to
get through several of these sequences in every clock tick, but you can
normally ignore that (except for cache flushes, hardware access and the
like, when you need the occasional "isync" or "eieio" - IBM *does* have a
sense of humour).

So your code below reads *the* program counter, according to the
programmer's model.  As far as I know, it is the only way to do it, so it
had better be "good enough" for the O/P.


Quoted text here. Click to load it



Site Timeline