Talk:Branch predication

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computer science (Rated Start-class, Low-importance)
WikiProject icon This article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 Low  This article has been rated as Low-importance on the project's importance scale.

Unnamed section[edit]

The binary GCD algorithm in ARM assembly is probably appropriate on this page (but not on the page it references). I'm not sure how I copy the code from the latest page that had the code: — Preceding unsigned comment added by (talk) 20:33, 27 March 2013 (UTC)

There is a problem with the first sentence,

"Because computer programs respond to a user, there is no way around the fact that portions of a program need to be executed conditionally."

A program which computes a formula from user input may not need to branch, and conversely a program with complex logic which receives no direct inputs from a user (paging in the OS) may need to branch.

It is unclear exactly how to introduce this topic. Mjr1007 (talk) 17:24, 29 July 2008 (UTC)

Correct Term?[edit]

I would like to ask whether this article should not be called "branch prediction". This term seems to be used more frequently The reverse term "misprediction" seems to be uncontested Semantically, "branch predication" seems to be something related to a predicate rather than to prediction.

— Preceding unsigned comment added by (talk) 07:30, 22 April 2014 (UTC)

It should not be called "branch prediction". As the hatnote in the article says, branch predication is not to be confused with a branch predictor; it should also not be confused with what a branch predictor does, namely branch prediction. So, yes, "branch predication" is something related to a predicate rather than to prediction, which is why this article is called "branch predication", not "branch prediction".
"Branch prediction" is used more frequently than "branch predication" or just "predication" because branch prediction is done more frequently than predication - most general-purpose processors, and many embedded processors, do branch prediction, but only some instruction sets have predicated non-branch instructions, and, for x86, at least, most instructions aren't predicated.
I'm not sure why this article's title is "branch predication"; the instructions that are typically made conditional are non-branch instructions, such as moves (in the case of x86's CMOVE, as introduced in, as I remember, the Pentium Pro) or other non-branch instructions (as on 32-bit ARM). Guy Harris (talk) 09:48, 22 April 2014 (UTC)
It's called "branch predication" as predication actually substitutes the branches used for conditional execution. So, it's like "predicating branches" or something like that, what leads to "branch predication". — Dsimic (talk | contribs) 20:43, 22 April 2014 (UTC)

Additional advantage[edit]

According to the Intel® Itanium® Architecture Software Developer’s Manual Volume 1: Application Architecture

In section

This code takes 18 cycles to complete if p2 is true and five cycles if p2 is false. When analyzing such cases, consider execution weights, branch misprediction probabilities, and prediction costs along each path.

The execution times decreases if the predicate is false.

Mjr1007 (talk) 18:16, 29 July 2008 (UTC)