news.microsoft.com wrote:
In my engineering class we're discussing microprocessor branch predictors.
Is it possible to write a Windows application (anything whatsoever) that
would allow me see how branch prediction is done in C# or if it implements
some type of Branch Target Buffer?
It's a while since I worked on CPUs, but surely branch prediction would still be
a hardware function existing down at the instruction pipeline level? C# is a
programming language running on top of a managed framework which itself is
running on top of an OS - this is many levels above what you are asking about.
In assembly language on bare hardware, one *might* write a diagnostic to confirm
the presence/absence of specific types of branch prediction - IF one knows
enough about the hardware internals of the specific processor one is probing.
But even that low-level diagnostic is more likely to be effective if it can be
written in the processor's native microcode. Or so I would think . . .
HTH,
-rick-