473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

branch prediction and C#???

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?

Any help would be appreciated.

Thanks.
Nov 17 '05 #1
4 3505
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-
Nov 17 '05 #2
> would allow me see how branch prediction is done in C# or if it implements
some type of Branch Target Buffer?


C# is a programming language, not a microprocessor. And the C# compiler
doesn't do any kind of compile time branch prediction.
Nov 17 '05 #3
Correct me if I'm wrong, but if branch prediction in the CPU is working
correctly, you shouldn't be able to tell from the outside that it's
even happening. Branch prediction is a speed optimization within the
CPU that should be transparent from the level even of assembly language
programming, no?

Nov 17 '05 #4
Bruce Wood wrote:
Correct me if I'm wrong, but if branch prediction in the CPU is working
correctly, you shouldn't be able to tell from the outside that it's
even happening. Branch prediction is a speed optimization within the
CPU that should be transparent from the level even of assembly language
programming, no?


Yes, of course you should be able to tell - else why bother building the extra
hardware? - but certainly not from the application level. It would have to be a
very CPU-specific low-level diagnostic program, running on bare hardware, and
likely using indirect methods such as carefully tailored timed loops. A more
direct sort of test *might* be possible if one has access to the machine's
native microcode (if it has one). In general, to write this kind of probe it is
most helpful to have access to the CPU manufacturer's internal design
documents for the CPU at hand.

Regards,
-rick-
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
2
by: Susanne Bandi | last post by:
Hello I've experienced that DB2 unfortunately does not eliminate subselects of a UnionAll-View if the predicate's content is not hardcoded but derived from a base-table with a noncorrelated...
1
by: Joachim Klassen | last post by:
Hi all, I'm investigating partitioned tables using a UNION ALL VIEW and found the following (see ddl below): If I create a check constraint like "check (month(tdate) = 1)" DB2 won't do branch...
0
by: Brian Delahunty | last post by:
Hi All, Just wondering if anybody know how to get branch (decision) coverage details from codecoverage results in Visiual Studio 2005 or from the commandline version of mstest. All I can see are...
2
by: Bob Powell | last post by:
Hello everyone: I am attempting to upgrade from 7.2 to 7.4 Postgresql. I have successfully installed 7.4 and am attempting to use the pgdump from 7.2 for 7.4. I'm having only one slight error...
1
by: Uri Dor | last post by:
Hi, I'm developing a WinForms C# 1.1 application and am reaching a point at which my code may face a branch - let's say version 1.1 is released to end users and we'll continue to fix bugs, but...
3
by: John A. Bailo | last post by:
Is there a way to branch a source safe'd project from within VS03 ?
2
by: Ian Collins | last post by:
I'm no sure of this, If a branch is dynamically created and appended to an element and then orphaned by removing and replacing it, are all the elements of that branch cleaned up, or do they...
6
by: Blast | last post by:
I was wondering if someone can tell me what Microsoft Technologies I need to employ for the given situation: As a small business, we keep all of our data currently in sql server and we only have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.