pawosm-arm wrote:

> I don't think a negative number is the most straightforward solution.

I looked into it more closely, and I guess there is a better solution for this. 
We may try to extend the `ext_vector_type` attribute with an optional boolean 
parameter. Similarly to the optional `offset` parameter in the `assume_aligned` 
attribute, where `offset` is taken to be zero if omitted:

```
__attribute__((assume_aligned(<alignment>[, <offset>]))
```

We could do similar thing to the `ext_vector_type` attribute, where 
`is_scalable` is taken to be `false` if omitted:

```
__attribute__((ext_vector_type(<size>[, <is_scalable>]))
```

The C++ `simd` template would be simply something like this:

```
template <typename T,
                   size_t N = internal::native_vector_size<T>,
                   bool S = internal::native_vector_is_scalable<T>>
using simd = T [[clang::ext_vector_type(N, S)]];
```

Meanwhile, I'll try to prepare a rudimentary PoC for this.

https://github.com/llvm/llvm-project/pull/183307
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to