Anastasia accepted this revision.
Anastasia added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4789
-
-    if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) {
-      Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src,
----------------
While I agree with this fix and it obviously looks incorrect, I wonder if the 
original intent was to condition the previous statement instead so that we 
avoid converting to size 4 at all? Although I have a feeling we are entering 
the behavior that is not documented anywhere. In the spec I can see this:


```
When the operand and result type contain a different number of elements, the 
result shall be implementation-defined except if the operand is a 4-component 
vector and the result is a 3-component vector. In this case, the bits in the 
operand shall be returned directly without modification as the new type. 
```

but it seems to cover the inverse conversion?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107963/new/

https://reviews.llvm.org/D107963

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to