<div>My colleague pointed out that it's not a cast, but a literal, which Clang should support.</div>
<div> </div>
<div>-John<br><br></div>
<div class="gmail_quote">On Mon, Apr 19, 2010 at 11:45 AM, 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"><font size="2" face="Helv"><font size="2" face="Helv">
<p dir="ltr">According to the AltiVec standard (section 2.4.6 in <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 a scalar to a vector is illegal, yet gcc seems to support it, as seen in many of those little files in the PS3 SDK in target\ppu\include\bits, which have statements like:</p>

<p dir="ltr">vec_uint4 mask = (vec_uint4)(vec_int4)(-1);</p>
<div dir="ltr">where vec_uint4 and vec_int4 are typedefs for vector types, i.e.:</div>
<div dir="ltr"> </div>
<div dir="ltr">typedef vector int vec_int4;</div>
<p dir="ltr">What does this actually do? I'm guessing it's supposed to fill the vector components with -1.</p>
<p dir="ltr">How should this be handled in Clang?</p>
<div dir="ltr">I filed a Bugzilla bug 6846 on this.</div>
<div dir="ltr"> </div>
<div dir="ltr">If Clang should support it</div></font></font>, I might be able to take a crack at it, <font face="Helv">w</font><font size="3" face="Times New Roman">ith a little guidance</font>.<br clear="all"><font color="#888888"><br>
-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></font></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>