<div dir="ltr">On Thu, Sep 12, 2013 at 2:14 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><div>----- Original Message -----<br>
><br>
> On Sep 12, 2013, at 2:08 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>> wrote:<br>
><br>
> > ----- Original Message -----<br>
> >><br>
> >> On Wed, Sep 11, 2013 at 3:34 PM, Hal Finkel < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> ><br>
> >> wrote:<br>
> >><br>
> >> ----- Original Message -----<br>
> >>> On Sep 11, 2013, at 3:29 PM, Hal Finkel < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> ><br>
> >>> wrote:<br>
> >>><br>
> >>><br>
> >>><br>
> >>><br>
> >>><br>
> >>> ----- Original Message -----<br>
> >>><br>
> >>><br>
> >>> ----- Original Message -----<br>
> >>><br>
> >>><br>
> >>> Hal —<br>
> >>><br>
> >>> Am I understanding this correctly:<br>
> >>><br>
> >>> vector4float x;<br>
> >>> vector4int16 y = (vector4int16)x; // this is a conversion<br>
> >>> vector4int32 z = (vector4int32)x; // this is a bitcast<br>
> >>><br>
> >>> This seems confusing in the extreme.<br>
> >>><br>
> >>> On the other hand, I don't really like the implied int-to-float<br>
> >>> bitcast semantics. Maybe it would be better to just add a warning<br>
> >>> for this case. What do you think?<br>
> >>><br>
> >>> bitcast semantics for vector casts are an essential tool for SIMD<br>
> >>> programming. Essentially all warnings generated would be false<br>
> >>> positives.<br>
> >><br>
> >> Do you specifically mean in OpenCL, or generally? (I've worked on<br>
> >> SIMD special function implementations, so I understand the<br>
> >> utility).<br>
> >><br>
> >> OpenCL doesn't allow writing casts like this at all, if that's<br>
> >> what<br>
> >> you're asking; OpenCL requires using intrinsics.<br>
> ><br>
> > So is there already an intrinsic that does what I want here?<br>
><br>
> In OpenCL there are ~5000 of them (IIRC), yes.<br>
<br>
</div></div>OIC, all of the convert_* functions.<br>
<br>
I've been thinking about constructing a patch to implement __builtin_vectorconvert(type, value), do you think that is a reasonable approach?<br><br></blockquote><div><br></div><div>You mean, as a generic replacement for intrinsics like _mm_cvtepi32_ps?  That seems reasonable.</div>

</div><br></div><div class="gmail_extra">-Eli</div></div>