<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 29, 2010, at 12:35 PM, Daniel Dunbar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Wed, Sep 29, 2010 at 11:23 AM, Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>> wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Sep 29, 2010, at 11:08 AM, Sebastian Redl wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Sep 29, 2010, at 11:01 AM, Daniel Dunbar wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On Wed, Sep 29, 2010 at 10:41 AM, Sebastian Redl<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>> wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">It seems weird to me too, but I think the question here is not whether to have it - IIUC OpenCL demands it - but whether it makes sense to make it work conditionally only for some language flags. And IMO, if you have ?: mean vector select in one dialect, you might as well make it work in all of them.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Why? OpenCL is a different language in many ways.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">AltiVec vector support isn't.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">For AltiVec support, we have precedent to follow: what does GCC do? We need to do the same.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Now, Clang's ext_vector_type is a specific vector type that Clang added for OpenCL. It seems reasonable that it would have OpenCL's semantics, regardless of dialect. For example, we permit the OpenCL "vec.xyzw" syntax for ext_vector_type vectors in all dialects.<br></blockquote><br>Yes, but that syntax has no (sensical) precedent in C, so programmers<br>aren't likely to confuse it with "what C would normally do", at least<br>in code that compiles.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>I think that's a wonderful argument against OpenCL's abuse of the ? : notation to mean vector selection. But, OpenCL made that decision, so our only decision is whether this syntax applies to Clang's extended vectors (the purpose of which is to support OpenCL) or to Clang when in OpenCL mode. We have precedent for the format.</div><div><br></div><div>Note that there's no conversion from a vector type to bool, so </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vec? vec1 : vec2</div><div><br></div><div>is currently ill-formed. So, while having that expression turn into a select might confuse a C programmer, at least we're not changing the semantics of existing, well-formed code.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>