<div class="gmail_quote">On Tue, May 24, 2011 at 3:02 AM, roy rosen <span dir="ltr"><<a href="mailto:roy.1rosen@gmail.com">roy.1rosen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I was wondering if LLVM supports predicates and conditional execution.<br>
Something like we have in IA64.<br>
There is a register class of predicates and then every instruction may<br>
be predicated by a register from this class.<br>
For example:<br>
<br>
cmp_less p, x, y // p is a predicate which gets the result of x < y<br>
p add x, x, 2 // if p then do the add instruction<br>
<br>
Is there support in LLVM to something like that?</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Which architecture can show a good example for the implementation of that?<br></blockquote><div><br></div><div>You may want to look at the PTX back-end.  The PTX assembly language supports exactly what you are describing, and we currently use it to implement conditional branching.  There is a register class for predicates (i1 in LLVM) and all machine instructions have a predicate operand and predicate filter (PTX supports inverted predicates).  For un-predicated instructions, the predicate operand is just set to the special NoRegister constant.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks, Roy.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>