[PATCH] D70456: [Matrix] Add first set of matrix intrinsics and initial lowering pass.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 13:58:38 PST 2019


fhahn added a comment.

In D70456#1761117 <https://reviews.llvm.org/D70456#1761117>, @LuoYuanke wrote:

> Interesting. Do you have any patch for the C/C++ frontend? What does the C/C++ code look like?


I'm currently preparing the patches on the clang side in addition to an update to cfe-dev. Please stay tuned and we would really appreciate any feedback there.

In the original RFC, we sketched the C/C++ support we envisioned using builtins. A simple example that loads two 4x4 matrixes, multiplies them, adds a third matrix to the result and stores the it can be found in the code below. Our initial proposal is quite stripped down and intended to be exposed to end users via something like a C++ matrix wrapper class.

  typedef float m4x4_t __attribute__((matrix_type(4, 4)));
   
   
  void f(m4x4_t *a, m4x4_t *b, m4x4_t *c, m4x4_t *r) {
    *r = __builtin_matrix_add(__builtin_matrix_multiply(*a, *b), *c);
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70456





More information about the llvm-commits mailing list