[libc-commits] [clang] [libc] [RFC][clang][libc] Extend the ext_vector_type attribute to support the scalable vector sizes (PR #183307)
Paul Osmialowski via libc-commits
libc-commits at lists.llvm.org
Sun Mar 1 13:34:59 PST 2026
pawosm-arm wrote:
> Meanwhile, I'll try to prepare a rudimentary PoC for this.
I've prepared a PoC (presented here in a new commit), it's not perfect (an assertion is failing on one of the clang tests, and there are some formatting complaints), but at least it demonstrates the idea and the challenges it produces. The amount of code that had to be changed is stunning, and I've got a feeling, the usability of it (in the C++ code) is not as pleasant as it used to be with encoding scalable sizes as negative values (it is still OK-ish in C though). Some notorious example is the `concat<>()` function, some may wish to mix scalable and fixed vectors in one concatenation, and it won't be easy to express with current approach. It would be best to encode scalability as a trait of the size-handling data type (e.g. some custom-made `vector_size_t`), which could carry both the size and scalability information, but this couldn't be passed as a template parameter to the `cpp:simd<>` type, not in C++17 at least (and, as I checked, some of the C++ codes in libc that include this `simd.h` file are explicitly compiled with `-std=c++17`). I still think my previous idea was neater.
https://github.com/llvm/llvm-project/pull/183307
More information about the libc-commits
mailing list