cglm icon indicating copy to clipboard operation
cglm copied to clipboard

Clang vector/matrix intrin support

Open Emily-TTG opened this issue 3 years ago • 1 comments

Clang has a WIP matrix implementation: https://clang.llvm.org/docs/LanguageExtensions.html#matrix-types

And several functional vector implementations: https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors (The vector extension I personally have had the best experience with being ext_vector_type, which also seems to be the most commonly used in the llvm repo)

Which support/will-support nice C++-reminiscent features like using normal binary operators and some degree of auto-SIMD, at least planned support.

Given the incompleteness of these features I understand this is a bit of an empty request - but could there possibly be a mechanism provided for overriding the types used for matrices and vectors? Like -DOVERRIDE_VECTOR_TYPENAME or something of the sort? Since it seems like CGLM has features not planned to be implemented for the intrinsic matrices and vectors.

Thanks either way!

Emily-TTG avatar Nov 30 '21 20:11 Emily-TTG

Hi @Th3T3chn0G1t ,

Thanks for the feedbacks annd suggestions,

I guess we have discussed related idea at https://github.com/recp/cglm/issues/58 (try search with vector_size or ext_vector_type). Auto vectorization seems to be good feature but we already did vectorization manually which may not be enough for some operations maybe.

If this can give us some advantages or performance benefits, we can consider to support it optionally for some compilers (llvm, clang, gcc...)

Let's get some more feedbacks

recp avatar Dec 02 '21 11:12 recp