[cfe-dev] Vector conversion

Eric Christopher echristo at apple.com
Thu Sep 2 13:37:16 PDT 2010


On Sep 2, 2010, at 8:51 AM, Douglas Gregor wrote:

> 
> On Sep 2, 2010, at 8:19 AM, Gonsolo wrote:
> 
>> Hi!
>> 
>> Is this correct (SemaExpr.cpp, line 4763)?
>> 
>>      // If we are allowing lax vector conversions, and LHS and RHS are both
>>      // vectors, the total size only needs to be the same. This is a bitcast;
>>      // no bits are changed but the result type is different.
>>      if (getLangOptions().LaxVectorConversions &&
>>         (Context.getTypeSize(lhsType) == Context.getTypeSize(rhsType)))
>>        return IncompatibleVectors;
>> 
>> I thought that if we are in "lax" mode and sizes match they are compatible.
> 
> Yes, but we still seem to warn about it:
> 
>   case IncompatibleVectors:
>     DiagKind = diag::warn_incompatible_vectors;
>     break;
> 

This stuff does need to be straightened out.  I was in there a while back and
it was much the same, basically the lax vector stuff depends on returning
incompatible and then ignoring that they're incompatible as a warning - instead
of just doing the sane thing and warning on the spot if we're going to warn and
then returning success and handling that success.

Anyhow, on the list of things to clean up for sure.

-eric





More information about the cfe-dev mailing list