simd_cast: fix AVX::(u)short_v -> SSE::Vector<T>

The implementation was relying on the AVX vector to have 256 bits. I had
to split it in two to implement it correctly for 128-bit sized AVX
vectors.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: fix argument order of alignr call

Signed-off-by: Matthias Kretz <kretz@kde.org>
casts test: remove unused type alias

Signed-off-by: Matthias Kretz <kretz@kde.org>
casts test: rename types for consistency

Signed-off-by: Matthias Kretz <kretz@kde.org>
simdarray: make storage_type[01] public types

This allows to avoid the decltype(internal_data[01](std::declval<T>()))
hacks.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: more corrections

* The simd_cast_with_offset and simd_cast_drop_arguments functions may
  need to reference other simd_cast functions and therefore need
  declaration on top and definition below.
* Fix the offset=0 simd_cast_with_offset overload to not drop the
  first argument.
* Swap two simd_cast functions where one would call the other one.
* Simplify the code with the storage_type[01] member types.
* Add some documentation to summarize the intention of the longish
  enable_if expressions.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simdarray binary operators: disable promotion >int

There is no generic support for 64-bit int SIMD types. Therefore
promotion to a 64-bit integral type (including `long` because it can
potentially have 64 bits) also is not done. But if one of the operands
is a scalar type that is larger than int then the operator is disabled
altogether. We do not want an implicit demotion.

Signed-off-by: Matthias Kretz <kretz@kde.org>
AVX permutes: fix set to 0

This was supposed to set bit 3, for some reason I was thinking bit 2...

Signed-off-by: Matthias Kretz <kretz@kde.org>
AVX: new alignr helper for AVX/AVX2 abstraction

Signed-off-by: Matthias Kretz <kretz@kde.org>
Mask: add shifted(int) member function

* complete with unit tests
* the simd_mask_array::shifted function does not use an optimized
  implementation

Signed-off-by: Matthias Kretz <kretz@kde.org>