Sorry, I forgot to attach the updated patch.<br><br>
<div class="gmail_quote">On Wed, Jan 20, 2010 at 4:11 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">Hi, I haven't heard back about this patch regarding a first step towards AltiVec support.  Is it okay to check-in? 
<div>
<div></div>
<div class="h5"><br><br>
<div class="gmail_quote">On Tue, Jan 5, 2010 at 9:05 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com" target="_blank">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>
<div>Sorry, I forgot to include the two updated altivec tests, plus update the tree before making the patch.  Please disregard the altivec1a.patch and look at this one instead.</div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div>-John<br><br></div></div>
<div>
<div></div>
<div>
<div class="gmail_quote">On Tue, Jan 5, 2010 at 6:33 PM, John Thompson <span dir="ltr"><<a href="mailto:john.thompson.jtsoftware@gmail.com" target="_blank">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>Thanks, Doug.</div>
<div> </div>
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Typo "preceeded".<br></blockquote></div>
<div>Fixed.</div>
<div><br> </div>
<div class="gmail_quote">
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>I think this is right, but I want to check: are AltiVec vectors more like GCC's vectors (handled by VectorType) or more like OpenCL's vectors (handled by ExtVectorType)? OpenCL vectors are mainly GCC's vectors + the swizzling syntax like "myvec.xy".</div>

<div> </div></div></div></div></div></blockquote>
<div> </div></div>
<div>I checked the Altivec standard, and don't see anything like the swizzling syntax, so I think they're more like the GCC vectors.</div>
<div>
<div><br></div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">It would be more efficient just to keep the IdentiferInfo * for the identifiers "vector" and "pixel" in the parser (only when AltiVec is enabled, of course), then do a pointer comparison rather than a string comparison. </blockquote>
</div></div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Good idea.  I've fixed this.</div>
<div>
<div class="gmail_quote"> </div>
<div class="gmail_quote"><br></div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>+        const Token &nextToken = NextToken();</div>
<div><br></div>
<div>Tokens are small; it's best to just copy them, e.g.,</div>
<div><br></div>
<div>  Token nextToken = NextToken();</div>
<div> </div></div></div></div></div></blockquote>
<div> </div></div>
<div>Got it.</div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>By changing the current token, we lose track of whether we saw "vector" or "__vector"; I guess it doesn't really matter. Still, wouldn't it be easier just to update the DeclSpec at this point?</div>
</div></div></div></div></blockquote>
<div> </div></div>
<div>Yep.</div>
<div>
<div><br> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div>At some point, we'll need more semantic checking here, e.g., to ignore "long long" and complain about the deprecation of "long", if I'm to believe</div></div></div></div></div></div></blockquote>

<div> </div></div>
<div>Yep.  I put in a warning for use of "long", and an error for use of "double".</div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div><span style="WHITE-SPACE: pre"><a href="http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc03altivec_types.htm" target="_blank">http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc03altivec_types.htm</a></span></div>

<div><br></div>
<div>Or perhaps there's some actual AltiVec specification I could use to help understand this stuff better?</div></div></div></div></div></div></blockquote>
<div> </div></div>
<div>Here's the one I've been using: <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></div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div>
<div>It would probably be better to print with "__vector" and "__pixel", since those keywords are always available.</div></div></div></div></div></div></div></blockquote>
<div> </div></div>
<div>Got it.</div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div>
<div>This makes it so that AltiVec vectors are completely distinct types from equivalently-sized vectors (as declared with __attribute__((vector_size(blah))). If we want to be able to cast between AltiVec vectors and GCC-style vectors, we'll need to add type-compatibility logic (for C) and type-conversion logic (for C++). I don't know which way is correct... how does GCC handle compatibility between the various kinds of vectors? We'll need to follow its lead.</div>
</div></div></div></div></div></div></blockquote>
<div> </div></div>
<div>I took a crack at this in SemaOverload.cpp.</div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div>
<div><br></div>
<div>
<div>Index: lib/Parse/ParseDecl.cpp</div>
<div>===================================================================</div>
<div>--- lib/Parse/ParseDecl.cpp<span style="WHITE-SPACE: pre"> </span>(revision 91204)</div>
<div>+++ lib/Parse/ParseDecl.cpp<span style="WHITE-SPACE: pre"> </span>(working copy)</div>
<div>@@ -393,6 +393,12 @@</div>
<div>   }</div>
<div> </div>
<div>   if (AllowFunctionDefinitions && D.isFunctionDeclarator()) {</div>
<div>+    // If attributes are present, parse them now.</div>
<div>+    if (<a href="http://tok.is/" target="_blank">Tok.is</a>(tok::kw___attribute)) {</div>
<div>+      SourceLocation Loc;</div>
<div>+      AttributeList *AttrList = ParseGNUAttributes(&Loc);</div>
<div>+      D.AddAttributes(AttrList, Loc);</div>
<div>+    }</div>
<div><br></div>
<div>This seems totally unrelated to AltiVec vectors?</div></div></div></div></div></div></div></div></blockquote>
<div> </div></div>
<div>Sorry.  Some code from my attribute position fix that hasn't gotten through yet.</div>
<div>I pulled it for now.</div>
<div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">
<div>
<div>
<div>
<div>
<div>
<div>
<div>pixel is an unsigned short? Weird.</div></div></div></div></div></div></div></div></blockquote>
<div> </div></div>
<div>Yeah, totally weird.</div>
<div> </div>
<div>I've enclosed an updated patch.</div>
<div> </div><font color="#888888">
<div>-John</div>
<div> </div></font></blockquote></div><br><br clear="all"><br></div></div>
<div>
<div></div>
<div>-- <br>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" 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>