<div>>I'm pretty sure that's already implemented... are you passing<br>>-faltivec to clang?<br></div>
<div>Yes.<br> <br>This stops the error, but is it enough?:<br> <br>Index: lib/Sema/SemaInit.cpp<br>===================================================================<br>--- lib/Sema/SemaInit.cpp (revision 101528)<br>+++ lib/Sema/SemaInit.cpp (working copy)<br>
@@ -886,7 +886,7 @@<br> <br>     // OpenCL & AltiVec require all elements to be initialized.<br>     if (numEltsInit != maxElements)<br>-      if (SemaRef.getLangOptions().OpenCL || SemaRef.getLangOptions().AltiVec)<br>
+      if (SemaRef.getLangOptions().OpenCL)<br>         SemaRef.Diag(IList->getSourceRange().getBegin(),<br>                      diag::err_vector_incorrect_num_initializers)<br>           << (numEltsInit < maxElements) << maxElements << numEltsInit;<br>
<br></div>
<div class="gmail_quote">On Mon, Apr 19, 2010 at 4:07 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@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">On Mon, Apr 19, 2010 at 3:00 PM, John Thompson<br>
<div class="im"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>> wrote:<br></div>
<div class="im">> My colleague pointed out that it's not a cast, but a literal, which Clang<br>> should support.<br><br></div>I'm pretty sure that's already implemented... are you passing<br>-faltivec to clang?<br>
<br>-Eli<br>
<div>
<div></div>
<div class="h5"><br>> -John<br>><br>> On Mon, Apr 19, 2010 at 11:45 AM, John Thompson<br>> <<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>> wrote:<br>>><br>
>> According to the AltiVec standard (section 2.4.6 in<br>>> <a href="http://www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPIM.pdf" target="_blank">http://www.freescale.com/files/32bit/doc/ref_manual/ALTIVECPIM.pdf</a>), casting<br>
>> a scalar to a vector is illegal, yet gcc seems to support it, as seen in<br>>> many of those little files in the PS3 SDK in target\ppu\include\bits, which<br>>> have statements like:<br>>><br>>> vec_uint4 mask = (vec_uint4)(vec_int4)(-1);<br>
>><br>>> where vec_uint4 and vec_int4 are typedefs for vector types, i.e.:<br>>><br>>> typedef vector int vec_int4;<br>>><br>>> What does this actually do? I'm guessing it's supposed to fill the vector<br>
>> components with -1.<br>>><br>>> How should this be handled in Clang?<br>>><br>>> I filed a Bugzilla bug 6846 on this.<br>>><br>>> If Clang should support it<br>>> , I might be able to take a crack at it, with a little guidance.<br>
>><br>>> --<br>>> John Thompson<br>>> <a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br>>><br>><br>><br>><br>> --<br>> John Thompson<br>
> <a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br>><br>><br></div></div>> _______________________________________________<br>> cfe-dev mailing list<br>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>><br>><br></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>