C and C++ have no vector types or operations but many compilers offer their own non-portable extensions such as __attribute__((__ext_vector_type__()))
. The issue is vector types corresponding to vector registers and specific CPU vector instructions are not portable and the semantics vary for different CPUs.
However all SIMD implementations are conceptually the same: Applying the same operation to many different values at a time. What semantics could a language include that supports vectorization or constructs that could be trivially vectorized by a compiler and would be more or less independent of the underlying SIMD semantics of the CPU? What would be a good abstraction for vector operations that a language could provide?