<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 19, 2019, at 21:24, Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:</div><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class=""><br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class=""><h2 class=""><span style="font-size: 14px;" class="">Support in Clang</span></h2><span class="">We are also planning to expose the matrix support in Clang via a matrix type on the C/C++ level (</span><span class="">similar to the ext_vector_type attribute</span><span class="">) together with a set of matrix builtins. Similar to the LLVM part, we would like to propose a pragmatic solution for common matrix operations, while being flexible enough to allow iterative improvements to accommodate additional requirements. The main motivation for the matrix support on the Clang side is to give users a way to</span><br class=""><ul class=""><li class=""><u class=""></u>Guarantee generating high-quality code for matrix operations and trees of matrix operations. For isolated operations, we can guarantee vector code generation suitable for the target. For trees of operations, the proposed value type helps with eliminating temporary loads & stores.<u class=""></u></li><li class=""><u class=""></u>Make use of specialized matrix ISA extensions, like the new matrix instructions in ARM v8.6 or various proprietary matrix accelerators, in their C/C++ code.<u class=""></u></li><li class=""><u class=""></u>Move optimisations from matrix wrapper libraries into the compiler. We use it internally to simplify an Eigen-style matrix library, by relying on LLVM for generating tiled & fused loops for matrix operations.<u class=""></u></li></ul><br class=""><span class="">We propose adding a new matrix value type, that can be declared via a `matrix_type` attribute. Alternatively we could also generalise the existing ext_vector_type attribute (</span><a href="https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors" target="_blank" class="">[6]</a><span class="">), if that is preferred. Initially, the matrix type supports 2 dimensions (rows & columns). For example, a 4x4 float matrix would be declared as `typedef float m4x4_t __attribute__((matrix_type(4, 4)));`. </span></div></blockquote><div class=""><br class=""></div><div class="">Hi Florian,</div><div class=""><br class=""></div><div class="">You can find Clang's policy for accepting language extensions described at <a href="http://clang.llvm.org/get_involved.html" class="">http://clang.llvm.org/get_involved.html</a></div><div class=""><br class=""></div><div class="">This extension clearly satisfies point 2, and I'm happy to trust that we can iterate to satisfying points 6 and 7. I would like to hear your thoughts on the other criteria.</div></div></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">Hi Richard,</div><div class=""><br class=""></div><div class="">Thank you very much for taking a look! We are working on a clang-focused update to the proposal to get a discussion rolling on the Clang integration. Thanks for pointing me to the policy for language extensions, we will make sure to cover the points mentioned there. </div><div class=""><br class=""></div><div class="">With Thanksgiving coming up in the US, it will probably take us until after the holidays to share the update.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Florian</div></body></html>