Why do the x4/x8 types seem to be the default in rust?
A portable SIMD feature should encurage portable SIMD and not a specific vector register size.
A portable SIMD feature should encurage portable SIMD and not a specific vector register size.
I need to think through the consequences. It might involve feature gates, and/or an enum. So, for example, instead of:
pub struct f32x8(__m256);
It might be this internally, with some method to auto-choose variant based on system capability?: pub enum f32_simd {
X8(__m256),
X16(__m512),
}
etc. Thoughts?I can recommens lookig at the highway library: https://github.com/google/highway
Writing an application in terms of a specific lane count loses performance portability - either it's too many, or too few, for the particular CPU. And it also enables/encourages antipatterns like putting RGB in Vec4.