p12tic / libsimdpp

Portable header-only C++ low level SIMD library
Boost Software License 1.0
1.24k stars 129 forks source link

Support for small vectors: `int32<1>`, `float32<2>`, etc. #93

Open p12tic opened 7 years ago

p12tic commented 7 years ago

Add support for small vectors, such as int32<1>. Currently there's no way to specify that we indeed want to perform operation on small number of vector elements. A possible solution is to extract appropriate C++ scalars such as int from the vector types and use regular C++. The problem with that is that often the most efficient way to do this is to keep the data in the SIMD execution domain and simply perform some wider vector operation. This is quite difficult for the compiler to spot. Implementing small vectors would allow to select the most efficient implementation for the target architecture.