473,671 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3521
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
2334
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 need to: 1. Click a submit button on an asp page, calling another page that saves the contents of that form to a database and then displays
2
1826
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 Subselect. Any plans to enhance this for the future? Any workaround suggestions? Thanks in advance Susanne
1
2376
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 elimination for a query like "SELECT * FROM Q1 WHERE TDATE = '01.01.2004'". Explains shows that all 3 tables are accessed. But with a a constraint "check (tdate between '01.01.2004' and '31.01.2004')" DB2 will do branch elimination - means only...
0
1153
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 line and block coverage details. Brian --
2
2995
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 that I would like some help with. I create both the pgsql and pltcl languages. I get two messages that I don't understand. The first is a warning from the pgsql with reads:
1
1354
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 version 1.2 is being developed. Now let's say that I decide to upgrade a 3rd party component library I'm using (I currently use Infragistics, Janus GridEx and Syncfusion ExcelRW) - will I be able to build version 1.1 with its matching components...
3
1155
by: John A. Bailo | last post by:
Is there a way to branch a source safe'd project from within VS03 ?
2
1144
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 leek? -- Ian Collins.
6
1421
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 one office. We use forms.net as interfaces to the sql server database. However, we are looking into expanding to multiple branch offices. We are also looking into a way to expose some of the data to the internet, so certain data can be viewed...
0
8474
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8912
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8669
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.