traits: simplify has_subscript_operator & allow testing parameter type

not every operator[] works with std::size_t so it's useful to have that
configurable. Also the any class is not needed.
Finally a little static_asserting is always safer.

Signed-off-by: Matthias Kretz <kretz@kde.org>
traits: add has_contiguous_storage trait

This trait cannot really be implemented generically without compiler
support. Therefore this works with specializations for the container
types that implement contiguous storage. The default (and safer)
assumption is that an unknown type implements non-contiguous storage.

The trait is needed for making gather/scatter operations do proper error
reporting.

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

Simple trait that reports whether the addition of two objects of types T
and U is well-defined.

Signed-off-by: Matthias Kretz <kretz@kde.org>
traits: new is_initializer_list trait

simple internal helper trait to simplify specializing functions on
initializer lists

Signed-off-by: Matthias Kretz <kretz@kde.org>
traits: default second type of has_multiply_operator

if a second type is not specified take the same as the first

Signed-off-by: Matthias Kretz <kretz@kde.org>
array: non-member begin/end

provide non-member begin/end for Vc::array

Signed-off-by: Matthias Kretz <kretz@kde.org>
macros: drop GCC 4.2 workaround

since we require C++11 this is dead code

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

basically I want to not look for extra instructions only for the scalar
fallback. All others should take what they can get.

Signed-off-by: Matthias Kretz <kretz@kde.org>
macros: define VC_IMPL_POPCNT whenever possible

I don't want to have to specify POPCNT - this is a bit special because
it's much less related to the SIMD instruction selection. So unless the
implemention is set to Scalar, if __POPCNT__ is defined define
VC_IMPL_POPCNT.

Signed-off-by: Matthias Kretz <kretz@kde.org>
SSE::Vector: implement %=

%= was still missing here. Implemented using operator%

Signed-off-by: Matthias Kretz <kretz@kde.org>
AVX::Vector: implement masked scatters with helper

use the common implementation for masked scatters for AVX, too.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: fix for non-integer source vectors

it was missing a cast to __m128i to really work generically

Signed-off-by: Matthias Kretz <kretz@kde.org>
iterators: make non-member begin/end for simd_array

the functions enable_if were missing a check for simd_array in addition
to the vector types

Signed-off-by: Matthias Kretz <kretz@kde.org>
where: move WhereMask to own namespace

WhereMask is an internal class and therefore shouldn't be directly in
the Vc namespace.

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

Signed-off-by: Matthias Kretz <kretz@kde.org>
traits: make IsLoadStoreFlag work for Prefetch<>

even if Prefetch<...> derives from LoadStoreFlags this specialization
didn't match. Added a second specialization to catch it.

Signed-off-by: Matthias Kretz <kretz@kde.org>
array: forward declare Vc::array

this is useful for traits and specialization

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

This is a lambda / recursion based implementation of what I previously
had only as a macro hack. This is much cleaner now as I don't have to
pass code as macro argument anymore.

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