Content deleted Content added
Guy Harris (talk | contribs) Mark a dead link as such. |
|||
Line 14:
<syntaxhighlight lang="c">
if condition
{
else
{
</syntaxhighlight>
Line 22:
<syntaxhighlight lang="c">
branch_if_condition_to label1
do_something_else
label1:
do_something
label2:
...
</syntaxhighlight>
Line 34:
<syntaxhighlight lang="c">
(condition)
(not condition)
</syntaxhighlight>
Besides eliminating branches, less code is needed in total, provided the architecture provides predicated instructions. While this does not guarantee faster execution in general, it will if the <code>
Predication's simplest form is ''partial predication'', where the architecture has ''conditional move'' or ''conditional select'' instructions. Conditional move instructions write the contents of one register over another only if the predicate's value is true, whereas conditional select instructions choose which of two registers has its contents written to a third based on the predicate's value. A more generalized and capable form is ''full predication''. Full predication has a set of predicate registers for storing predicates (which allows multiple nested or sequential branches to be simultaneously eliminated) and most instructions in the architecture have a register specifier field to specify which predicate register supplies the predicate.<ref>{{cite conference |last1=Mahlke|first1=Scott A.|last2=Hank|first2=Richard E.|last3=McCormick|first3=James E.|last4=August|first4=David I.|last5=Hwn|first5=Wen-mei W.|title=A Comparison of Full and Partial Predicated Execution Support for ILP Processors |conference=The 22nd International Symposium on Computer Architecture, 22–24 June 1995 |year=1995 |doi=10.1145/223982.225965 |isbn=0-89791-698-0 |citeseerx=10.1.1.19.3187}}</ref>
|