<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 5, 2015, at 12:03 PM, Artem Belevich <<a href="mailto:tra@google.com" class="">tra@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, May 5, 2015 at 11:37 AM, escha <span dir="ltr" class=""><<a href="mailto:escha@apple.com" target="_blank" class="">escha@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 5, 2015, at 11:02 AM, Artem Belevich <<a href="mailto:tra@google.com" target="_blank" class="">tra@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 5, 2015 at 10:38 AM, Eric Christopher <span dir="ltr" class=""><<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
><br class="">
> c) Got an in-tree user where this would be useful?<br class="">
<br class=""></span>
I was kinda hoping someone from R600 would know, since I think I recall R600 having a select instruction? I figure it’d be useful to have some feedback from another architecture to see what they’d find useful here, since I’m not big on the idea of shoving in something solely based on an OOT arch’s needs (plus, I probably haven’t even fully thought through its possible benefits either).<br class=""></blockquote><div class=""><br class=""></div><div class="">Yeah. Maybe poke them and the nvptx guys?</div><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">NVIDIA's PTX supports predicated execution of almost all instructions. Itis, generally speaking, preferred over branches.</div><div class=""><a href="http://docs.nvidia.com/cuda/parallel-thread-execution/#predicated-execution" target="_blank" class="">http://docs.nvidia.com/cuda/parallel-thread-execution/#predicated-execution</a><br class=""></div><div class=""><br class=""></div><div class="">It's really easy to kill GPU performance with branches and by 'kill' I mean 'couple of orders of magnitude' of a difference. :-/</div><div class="">For small fragments of code, predicated execution is likely to be a win.</div></div></div></div></div></blockquote><br class=""></div></div></div><div class="">This isn’t about predication/unconditional code versus branches; this is about select instructions versus unconditional expansions such as the 3-instruction integer absolute value expansion. It was written with an out-of-tree GPU in mind that has a very powerful select() instruction.</div></div></blockquote><div class=""><br class=""></div><div class="">Wouldn't flexible predicate calculation + ability to predicate an arbitrary instruction be an equivalent of 'powerful select() instruction' and more?</div></div></div></div></div></blockquote><br class=""></div><div>I think in some cases? My thought was that the concept of “select is fast” here maps to “any SELECT_CC is one instruction”, while predicate calculation may only give you 2 instructions for a given SELECT_CC, I think?  But this feels kind of besides the point; the idea of this patch is if a target believes that a SELECT_CC is better than a more-than-one-node expansion, regardless of the real reason, right?</div><div><br class=""></div><div>— escha</div><br class=""></body></html>