<div>I've run into a problem with vector literal/casting confusion:</div>
<div> </div>
<div>vector float v = (vector float)((vector unsigned int)(0x49800000));<br></div>
<div>vecinit1.cpp:1:33: error: cannot initialize a vector element of type 'float' with an lvalue of type '__vector unsigned int'<br>vector float v = (vector float)((vector unsigned int)(0x49800000));<br></div>

<div>It appears to be treating the outer paren expression as a vector literal instead of a cast.</div>
<div> </div>
<div>I'm looking into to it, but if someone knows a quick fix already...<br></div>
<div>-John</div>
<div> </div>
<div class="gmail_quote">On Tue, Apr 20, 2010 at 12:45 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Anton,</div>
<div> </div>
<div>Clang was generating an error on vector initializers, when all the vector slots are not provided, i.e.:</div>
<div> </div>
<div>vector unsigned int v = (vector unsigned int)(vector int)(-1); </div>
<div> </div>
<div>Instead of:</div>
<div> </div>
<div>vector unsigned int v = (vector unsigned int)(vector int)(-1, -1, -1, -1); </div>
<div> </div>
<div>I'm seeing these kinds of statements in some headers in the PS3 sdk, which gcc allows.</div>
<div> </div>
<div>I've checked in a fix and revised the altivec tests.  (Sorry I missed a test last night, and broke the build.)</div>
<div><br>I have a question, though (for Anton or anyone).  What will the initializers be for the unspecified slots?  Will they be 0?  What does gcc do?</div>
<div> </div><font color="#888888">
<div>-John<br></div></font>
<div>
<div></div>
<div class="h5">
<div class="gmail_quote">On Tue, Apr 20, 2010 at 2:34 AM, Anton Lokhmotov <span dir="ltr"><<a href="mailto:Anton.Lokhmotov@arm.com" target="_blank">Anton.Lokhmotov@arm.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>> This stops the error, but is it enough?<br><br></div>Sorry, I couldn't understand from the thread what was the error?<br><br>> -      if (SemaRef.getLangOptions().OpenCL ||<br>
<div>SemaRef.getLangOptions().AltiVec)<br>> +      if (SemaRef.getLangOptions().OpenCL)<br><br></div>In other words, it's something that's not required for AltiVec but is<br>required for OpenCL?<br><br>Cheers,<br>
<font color="#888888">Anton.<br><br><br></font></blockquote></div><br><br clear="all"><br></div></div>-- <br>
<div>
<div></div>
<div class="h5">John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br>
<a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>