<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Anton,<div><br></div><div>I do not this is all necessary. All the support already exists for all the valid test cases except the last one ((float4)( float )). One just has to modify <span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">ActOnCastOfParenListExpr which is now BuildVectorLiteral to handle the splat case. I have not modified our patch to match the recent changes in TOT, but will do shortly. </span></div><div><br></div><div>For the invalid cases, I don't see why one needs to modify the parser, but the last invalid case does crash the compiler which shouldn't ever happen. </div><div><br></div><div>Also, I'd really appreciate if you didn't just remove regression tests. Yes, you are 100% right that the test violates the OpenCL spec (my mistake and haste in making a patch), but its catching a nasty compiler crash and I'd rather try to modify the test instead of just removing it. I've fixed this in TOT.</div><div><br></div><div>Lastly, please make sure any unrelated code is not included (ie. lib/Frontend/CompilerInvocation.cpp changes).</div><div><br></div><div>Thanks,</div><div>Tanya</div><div><br></div><div><div><div>On Jun 30, 2011, at 5:04 AM, Anton Lokhmotov wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Please find attached the patch providing support for vector literals in<br>OpenCL.  <br><br>Two files with test cases are provided:<br>CodeGenOpenCL/vector_literals_valid.cl and<br>SemaOpenCL/vector_literals_invalid.cl.  One file is removed:<br>CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl, because it contained invalid<br>OpenCL code (cast between vectors of different types: int2 and uchar8).<br><br>Please review!<br><br>Many thanks,<br>Anton.<br><br>P.S. The quote below is on page 164 in opencl-1.1-rev44<br>(<a href="http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf">http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf</a>).<br><br><blockquote type="cite">Date: Wed, 1 Jun 2011 11:13:10 +0200<br></blockquote><blockquote type="cite">From: Alberto Magni <<a href="mailto:alberto.magni86@gmail.com">alberto.magni86@gmail.com</a>><br></blockquote><blockquote type="cite">Subject: Re: [cfe-dev] OpenCL vector initialization<br></blockquote><blockquote type="cite">To: <a href="mailto:Anton.Lokhmotov@arm.com">Anton.Lokhmotov@arm.com</a><br></blockquote><blockquote type="cite">Cc: <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br></blockquote><blockquote type="cite">Message-ID: <<a href="mailto:BANLkTik4ouTQ_WV--vnjNvBDmuj-cyYtMA@mail.gmail.com">BANLkTik4ouTQ_WV--vnjNvBDmuj-cyYtMA@mail.gmail.com</a>><br></blockquote><blockquote type="cite">Content-Type: text/plain; charset=ISO-8859-1<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Ok, thank you Anton.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'll wait for your patch.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Bye<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">2011/6/1 Anton Lokhmotov <<a href="mailto:Anton.Lokhmotov@arm.com">Anton.Lokhmotov@arm.com</a>>:<br></blockquote><blockquote type="cite"><blockquote type="cite">Hi Alberto,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Thanks for working on OpenCL support in Clang. It's an important<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">area we should aim to enable for the 3.0 release.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The OpenCL requirement for vector literals is actually quite<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">involved.  To quote from a recent revision of the spec <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(to which you don't have access yet):<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">"A vector literal is written as a parenthesized vector type followed<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">by a parenthesized comma delimited list of parameters. A vector <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">literal operates as an overloaded function. The forms of the function<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">that are available is the set of possible argument lists for which all<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">arguments have the same element type as the result vector, and the <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">total number of elements is equal to the number of elements in the <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">result vector. In addition, a form with a single scalar of the same<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">type as the element type of the vector is available."<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">"For example, the following forms are available for float4:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float, float, float, float )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float2, float, float )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float, float2, float )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float, float, float2 )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float2, float2 )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float3, float )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float, float3 )<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(float4)( float )"<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">As I understand, your patch handles only the last case.  We are going <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">to submit a patch shortly to accept valid cases and reject invalid<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Thanks,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Anton.</blockquote></blockquote><span><arm-vector-literals.patch></span>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></div></blockquote></div><br></div></body></html>