libgenua
Basic Geometry, Numerical Algorithms and Interfaces

Base class for vector types.
This is a thin wrapper base class which serves to make the vector width available to algorithms which avoid specifying the width as an additional template argument. Strictly speaking, this would only be required for compilers which don't understand C++11 constexpr.
Furthermore, there are a few general gather/scatter operations implemented here. These are often needed to transpose scalar arrays for SIMD processing. Although these are implemented in a very basic manner, inspection of the generated assembler shows that compilers turn this into appropriate sequences of extract/insert instructions where available.
#include <simdbase.h>
Static Public Member Functions  
template<typename VectorType >  
static void  gather (int m, const Scalar x[], VectorType &xp) 
strided gather (x need not be aligned)  
template<typename VectorType >  
static void  scatter (int m, const VectorType &xp, Scalar x[]) 
strided scatter (x need not be aligned)  
template<typename VectorType >  
static void  pack (int m, const Scalar x[], VectorType xp[]) 
pack W*m values from x where they are stored with stride m  
template<typename VectorType >  
static void  unpack (int m, const VectorType xp[], Scalar x[]) 
store W*m values to x where they are stored with stride m  
Static Public Attributes  
static const int  lanes = W 
the number of lanes, or vector width  