simd_cast: reorder and restructure code

The reordering, especially into declaration on top and implementation at
the bottom, helps to have all relevant functions that could get called
from the implementation visible.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: add helper overload for offset > input

If the requested offset to simd_cast_with_offset is larger than the
input just return Return::Zero(). This is easier to generalize than
adding the logic for avoiding this call altogether.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: catch more cases with new overloads and reordering

especially simd_cast with offset can become hairy once non-power-of-two
simdarrays are involved in the casts. This change improves the situation
because it instead uses simd_cast_with_offset which doesn't require
offset to be a multiple of the Return::Size.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simd_cast: fix template args to simd_cast_without_last

This simd_cast was calling simd_cast_without_last with internal_data but
passing the original simdarray types as functions template args. Now it
correctly uses storage_type.

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