cpp/experimental/simd

The SIMD library provides portable types for explicitly stating data-parallelism and structuring data for more efficient SIMD access.

An object of type behaves analogue to objects of type. But while stores and manipulates one value,  stores and manipulates multiple values (called width but identified as  for consistency with the rest of the standard library; cf. ).

Every operator and operation on acts element-wise (except for horizontal operations, which are clearly marked as such). This simple rule expresses data-parallelism and will be used by the compiler to generate SIMD instructions and/or independent execution streams.

The width of the types and  is determined by the implementation at compile-time. In contrast, the width of the type is fixed by the developer to a certain size.

A recommended pattern for using a mix of different SIMD types with high efficiency uses and :

This ensures that the set of types all have the same width and thus can be interconverted. A conversion with mismatching width is not defined because it would either drop values or have to invent values. For resizing operations, the SIMD library provides the and  functions.

Math functions
All functions in, except for the special math functions, are overloaded for.