SaurabhJha added inline comments.

================
Comment at: clang/lib/Sema/SemaExpr.cpp:7315
+/// is not a scalar type.
+bool Sema::areCompatibleMatrixTypes(QualType srcTy, QualType destTy) {
+  assert(destTy->isMatrixType() && srcTy->isMatrixType());
----------------
rjmccall wrote:
> "Compatible" has a specific meaning in the C standard, so if you aren't 
> intending to invoke that concept of compatibility, you should find a new word.
> 
> It looks like this kind of cast is supposed to be doing an elementwise 
> conversion.  I guess all the types you can have matrices of are 
> interconvertible, so there are no restrictions on the element types.  But you 
> definitely need this to produce a new `CastKind` for elementwise conversion 
> instead of using `CK_BitCast`, which does a bitwise reinterpretation, which 
> is not what you want.
> 
> Matrix element types already have to be scalar types, so those checks aren't 
> doing anything.
I see, so we need a new `CK_MatrixCast`, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99037

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

Reply via email to