Branch prediction



There is something that is confusing about what I understand about
branch prediction. If the processor is reading ahead of the program
counter then it must be emulating the instructions at least and I find
that unusual.

Please correct me if I have got this right. But from what I know, when
the x86 processor is seeking ahead and reaches a branch it has a
problem. That is it doesn't know what the outcome of the condition
until the program counter gets there.

So, it emulates both paths from the branch until the program counter
gets there. When the processor is seeking ahead/emulating the future
instructions, what exactly is it doing with the code - p-code or
whatever.

There aint much documentation on processors these days like there used
to years back. Even Wikipedia does not have much to say.

I have a registered copy of A386 that I intend to use soon, but my
knowledge of 386> is not much. Can anybody recommend a book, something
like the equivalent of the 8086 book.

TIA

Muscipula

.



Relevant Pages

  • Re: OT: conversations about life
    ... frequently explaining to colleagues that no amount of well-written ... instructions or explanation can stop someone from emulating a ...
    (alt.support.diabetes)
  • Re: OT: conversations about life
    ... frequently explaining to colleagues that no amount of well-written ... instructions or explanation can stop someone from emulating a ...
    (alt.support.diabetes)
  • Re: Branch prediction
    ... branch prediction. ... counter then it must be emulating the instructions at least and I find ... It's not really that the CPU is emulating any instructions, ...
    (comp.lang.asm.x86)
  • Re: Valgrind work with Intel Fortran/C++
    ... Valgrind works by emulating the instructions, ... from any compiler. ... which valgrind either does not understand or fails correctly to emulate. ...
    (comp.lang.fortran)