Vector conversion

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Vector conversion

Gonsolo
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.

g
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Vector conversion

Douglas Gregor

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;

- Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Vector conversion

Eric Christopher-2

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


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev