[PATCH] D99037: [Matrix] Implement explicit type conversions for matrix types

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 2 07:06:53 PDT 2021


fhahn added inline comments.


================
Comment at: clang/lib/Sema/SemaCast.cpp:2916
 
   // Require the operand to be a scalar or vector.
+  if (!SrcType->isScalarType() && !SrcType->isVectorType() &&
----------------
` ... or a matrix`?


================
Comment at: clang/test/Sema/matrix-cast.c:3
+
+typedef char cx4x4 __attribute__((matrix_type(4, 4)));
+typedef int ix4x4 __attribute__((matrix_type(4, 4)));
----------------
I think it would be good to add additional test coverage casting between matrix types and other types, e.g.  vector types, pointer types and struct types.

It would also be good to have C++ tests that test casting with matrix types where some of the dimensions are template arguments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99037



More information about the cfe-commits mailing list