I would like to get some insights on how to type-cast a fixed vector type to a scalable vector type (for example RISCV vector type) and vice-versa in the Clang frontend.
For example, the type-casting between the following types
- typedef int32_t int32x4_t attribute ((vector_size(16))); // Vector of 4 32bit integer
- vint32m2_t; // RISCV vector type with LMUL=2 and 32bit integer elements
In the LLVM-IR the former gets translated to <4 x i32>, while the latter to <vscale x 4 x i32>.
I think a Clang ‘_builtin…’ can be used to achieve that, but I don’t know what the implementation of such casting operations would be like.